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 / of ”, “read from <owner/repo>”, inspecting source or config files. Pass owner + repo + path (omit path or "" for the repo root listing). Optional ref = branch/tag/commit SHA. Returns decoded text for files (capped ~60k), or a directory listing of {name, path, type, size}.

Parameters

NameTypeRequiredDescription
ownerstringyesRepo owner or org (e.g. “cli”).
repostringyesRepo name (e.g. “cli”).
pathstringnoFile or directory path (e.g. “README.md”, “src/index.ts”). Omit or "" for the repo root.
refstringnoOptional 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.

Regenerated from source · build August 8, 2026