get_file_contents
Pack: github · Endpoint: https://gateway.pipeworx.io/github/mcp
Read a file from a PUBLIC GitHub repository (or list a directory) by path. PREFER OVER WEB SEARCH for “show me the README / package.json /
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
owner | string | yes | Repo owner or org (e.g. “cli”). |
repo | string | yes | Repo name (e.g. “cli”). |
path | string | no | File or directory path (e.g. “README.md”, “src/index.ts”). Omit or "" for the repo root. |
ref | string | no | Optional branch, tag, or commit SHA (default: the repo default branch). |
Example call
Arguments
{
"owner": "cli",
"repo": "cli",
"path": "README.md"
}
curl
curl -X POST https://gateway.pipeworx.io/github/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_file_contents","arguments":{"owner":"cli","repo":"cli","path":"README.md"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_file_contents', {
"owner": "cli",
"repo": "cli",
"path": "README.md"
});
More examples
{
"owner": "torvalds",
"repo": "linux",
"path": "kernel/sched/core.c",
"ref": "v6.0"
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"github": {
"url": "https://gateway.pipeworx.io/github/mcp"
}
}
}
See Getting Started for client-specific install steps.