gh_get_file

Pack: github_private · Endpoint: https://gateway.pipeworx.io/github_private/mcp

Get file contents from a repository. Specify owner, repo name, and file path (e.g., ‘README.md’). Returns raw content and metadata.

Parameters

NameTypeRequiredDescription
ownerstringyesRepository owner
repostringyesRepository name
pathstringyesFile path (e.g., “src/index.ts”)
refstringnoBranch or commit SHA (default: default branch)

Example call

Arguments

{
  "owner": "octocat",
  "repo": "Hello-World",
  "path": "README.md"
}

curl

curl -X POST https://gateway.pipeworx.io/github_private/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gh_get_file","arguments":{"owner":"octocat","repo":"Hello-World","path":"README.md"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('gh_get_file', {
  "owner": "octocat",
  "repo": "Hello-World",
  "path": "README.md"
});

More examples

{
  "owner": "octocat",
  "repo": "Hello-World",
  "path": "src/index.ts",
  "ref": "main"
}

Response shape

FieldTypeDescription
namestringFile name
pathstringFile path in repository
shastringFile content SHA
sizenumberFile size in bytes
typestringContent type (file or dir)
contentstringBase64 encoded file content
encodingstringContent encoding (base64)
urlstringAPI URL for this file
html_urlstringWeb URL for this file
download_urlstring | nullRaw download URL
Full JSON Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "File name"
    },
    "path": {
      "type": "string",
      "description": "File path in repository"
    },
    "sha": {
      "type": "string",
      "description": "File content SHA"
    },
    "size": {
      "type": "number",
      "description": "File size in bytes"
    },
    "type": {
      "type": "string",
      "description": "Content type (file or dir)"
    },
    "content": {
      "type": "string",
      "description": "Base64 encoded file content"
    },
    "encoding": {
      "type": "string",
      "description": "Content encoding (base64)"
    },
    "url": {
      "type": "string",
      "description": "API URL for this file"
    },
    "html_url": {
      "type": "string",
      "description": "Web URL for this file"
    },
    "download_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Raw download URL"
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "github_private": {
      "url": "https://gateway.pipeworx.io/github_private/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026