
How to add GitHub Repo MCP to Claude Desktop
Let AI assistants browse public GitHub repositories, explore directories, and view file contents. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 27โ ยท stdio ยท apikey
Claude Desktop config for GitHub Repo MCP
npx github-repo-mcp{
"mcpServers": {
"github-repo-mcp": {
"command": "wsl",
"args": [
"bash",
"-c",
"cmd /c npx -y github-repo-mcp"
],
"env": {
"GITHUB_TOKEN": "Your_Github_Token"
}
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the GitHub Repo MCP config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm GitHub Repo MCP's tools appear under the ๐ tools menu.
Before you start
- Node.js 18+
- npm or yarn
- Optional: a GitHub personal access token for higher API rate limits
What GitHub Repo MCP can do in Claude Desktop
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").
Security
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 + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the GitHub Repo MCP config there under the "mcpServers" key and restart the client.
Is GitHub Repo MCP safe to use with Claude Desktop?
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.
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.