github-repo
Model Context Protocol server for Github Repo // Reading Github Repo
claude mcp add --transport stdio ryan0204-github-repo-mcp npx -y github-repo-mcp \ --env GITHUB_TOKEN="Your_GitHub_Token_if_needed"
How to use
GitHub Repo MCP lets your AI assistant browse public GitHub repositories, navigate directories, and display file contents using a simple standard I/O protocol. It exposes three primary tools: getRepoAllDirectories, which lists the root contents of a repository; getRepoDirectories, which lists the items within a specific directory path; and getRepoFile, which fetches and displays the contents of a given file. This enables chat-based exploration of codebases, quick checks of file contents, and directory-wide navigation without leaving the chat interface. The server can be run via npx, Smithery, or integrated into your IDE via an mcp.json configuration, and it supports optional GitHub authentication to increase API rate limits when needed. When using authentication, set GITHUB_TOKEN to a personal access token to avoid low unauthenticated rate limits.
How to install
Prerequisites:
- Node.js 18+ installed on your system
- npm or yarn (comes with Node.js)
- Optional: a GitHub Personal Access Token for higher API rate limits
Install and run via NPX (simplest):
- Ensure Node.js and npm/yarn are installed.
- Run:
npx -y github-repo-mcp
Install via Smithery (for Claude Desktop or managed deployments):
- Ensure Node.js installed.
- Run:
npx -y @smithery/cli install @Ryan0204/github-repo-mcp --client claude
Alternative: configure in your IDE's mcp.json (example):
{
"mcpServers": {
"github-repo-mcp": {
"command": "npx",
"args": ["-y", "github-repo-mcp"],
"enabled": true
}
}
}
Optional GitHub token setup (for higher rate limits):
- Create a token at https://github.com/settings/tokens
- Add it to your mcp.json as an environment variable:
{
"mcpServers": {
"github-repo-mcp": {
"command": "npx",
"args": ["-y", "github-repo-mcp"],
"env": {
"GITHUB_TOKEN": "Your_Github_Token"
},
"enabled": true
}
}
}
Additional notes
Tips and common considerations:
- GITHUB_TOKEN is optional but recommended for higher API rate limits; unauthenticated requests are rate-limited.
- The server interacts with public repositories by default; private repos require a token with appropriate permissions.
- If you encounter command-not-found errors, ensure the MCP server package is installed globally or available in the execution environment (via npx or your IDE's integration).
- The three main tools (getRepoAllDirectories, getRepoDirectories, getRepoFile) support standard parameters as described in the feature section of the README; use repoUrl (e.g., https://github.com/owner/repo) and paths like src or README.md to fetch data.
- When using Windows with WSL or similar environments, you may need to adjust the command paths to point to the correct npx binary in your Windows/Linux interop setup.
Related MCP Servers
Gitingest
mcp server for gitingest
bitbucket
Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs
github-brain
An experimental GitHub MCP server with local database.
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
website-publisher
AI Website builder and publisher MCP. Quickly publish and deploy your AI generated code as real website URL. Support html, css, js, python etc.