MCP Hub Logo

GitHub File Reader

Read files and repository contents from GitHub repositories directly in your AI conversations.

githubcodefilesrepository
CuratedLast reviewed: Dec 1, 2024API Key Required

About

GitHub File Reader

Access any public or private GitHub repository from your AI assistant. Browse directory trees, read source files, and analyze codebases without leaving your conversation.

Setup

  1. Generate a GitHub Personal Access Token at https://github.com/settings/tokens
  2. Grant repo scope for private repositories (or public_repo for public only)
  3. Add to your MCP client config:
{
  "mcpServers": {
    "github-file-reader": {
      "command": "npx",
      "args": ["-y", "@mcpnodehub/github-file-reader"],
      "env": {
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}

Example Prompts

  • "Read the README from owner/repo"
  • "List all TypeScript files in the src/ directory of owner/repo"
  • "Show me the contents of package.json in owner/repo at branch main"

Permissions & Access

Permissions Required

read:repositoryread:files

External Systems Accessed

GitHub