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
| Name | Type | Required | Description |
|---|---|---|---|
owner | string | yes | Repository owner |
repo | string | yes | Repository name |
path | string | yes | File path (e.g., “src/index.ts”) |
ref | string | no | Branch 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
| Field | Type | Description |
|---|---|---|
name | string | File name |
path | string | File path in repository |
sha | string | File content SHA |
size | number | File size in bytes |
type | string | Content type (file or dir) |
content | string | Base64 encoded file content |
encoding | string | Content encoding (base64) |
url | string | API URL for this file |
html_url | string | Web URL for this file |
download_url | string | null | Raw 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.