
GitHub Repo MCP
Let AI assistants browse public GitHub repositories, explore directories, and view file contents.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx github-repo-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"github-repo-mcp": {
"command": "wsl",
"args": [
"bash",
"-c",
"cmd /c npx -y github-repo-mcp"
],
"env": {
"GITHUB_TOKEN": "Your_Github_Token"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js 18+
- npm or yarn
- Optional: a GitHub personal access token for higher API rate limits
About GitHub Repo MCP
GitHub Repo MCP is an open-source stdio MCP server that gives AI assistants read access to public GitHub repositories. Through three tools it can list the root contents of a repo, list the contents of any sub-directory, and fetch the text content of individual files. It is installable via NPX or Smithery and works with Cursor, Windsurf, Claude Desktop, and other stdio-compatible MCP clients. Authentication is optional: supplying a GitHub personal access token via the GITHUB_TOKEN environment variable raises the otherwise low (60/hour) GitHub API rate limit.
Tools & capabilities (3)
getRepoAllDirectoriesLists all files and directories at the root of a GitHub repository. Parameters: repoUrl (the URL of the GitHub repository, e.g. "https://github.com/owner/repo").
getRepoDirectoriesLists the contents of a specific directory in a GitHub repository. Parameters: repoUrl (the repository URL) and path (the directory path to fetch, e.g. "src").
getRepoFileRetrieves and displays the content of a specific file from a GitHub repository. Parameters: repoUrl (the repository URL) and path (the file path to fetch, e.g. "src/index.js").
When to use it
- Browsing the root contents of any public GitHub repository from within an AI assistant
- Exploring a specific directory such as src to understand a project's structure
- Viewing the contents of a specific file (e.g. README.md or a source file) without leaving the chat
- Giving an AI coding assistant read-only context from external GitHub repositories
Security notes
Works without authentication against public repositories only (60 requests/hour rate limit). An optional GitHub personal access token (GITHUB_TOKEN) can be supplied for higher rate limits and to access repositories the token has permission for. The server detects common binary file extensions and will not display their contents, and large files may be unavailable due to GitHub API size limits.
GitHub Repo MCP FAQ
Do I need a GitHub token?
No. The server works without authentication, but unauthenticated GitHub API access is limited to 60 requests per hour. Setting a personal access token via the GITHUB_TOKEN environment variable in mcp.json raises this limit.
Can it access private repositories?
Only public repositories are accessible by default. A token with appropriate permissions is required to access private repositories.
Can it read any file type?
It displays code and text files. The server detects common binary file extensions and will not display their contents, and very large files may be unavailable due to GitHub API size limits.
Which MCP clients are supported?
Any client supporting the stdio protocol, including Cursor, Windsurf, and Claude Desktop. It can be installed via NPX or automatically via Smithery.
Alternatives to GitHub Repo MCP
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
Code intelligence engine that indexes repos into a persistent knowledge graph for AI coding agents.
Compare GitHub Repo MCP with: