Home / MCP / GitHub MCP Server
Provides MCP-based access to browse GitHub repos, list directories, and view file contents from public repositories.
Configuration
View docs{
"mcpServers": {
"github_repo_mcp": {
"command": "npx",
"args": [
"github-repo-mcp"
],
"env": {
"GITHUB_TOKEN": "YOUR_TOKEN"
}
}
}
}GitHub Repo MCP lets your AI assistants browse GitHub repositories, explore directories, and view file contents. It supports interactive repository navigation from MCP clients over the standard stdio protocol, making it easy to fetch directory listings and file contents from public repositories without leaving your conversational workspace.
You connect to the GitHub Repo MCP server through an MCP client that supports the stdio protocol. Once connected, you can ask your assistant to list repository contents, drill into directories, and display file content from public GitHub repositories. The three core tools are designed to help you navigate any repository you specify by URL and path.
Prerequisites you need on your system are Node.js 18+ and npm or yarn.
# MacOS / other environments using NPX directly
npx github-repo-mcp
# Windows via NPX
cmd /c npx -y github-repo-mcp
# Smithery installation (Claude Desktop)
npx -y @smithery/cli install @Ryan0204/github-repo-mcp --client claudeThere are multiple ways to start the MCP server, depending on how you want to integrate it with your workflow. The most straightforward method is to run the NPX command directly in a terminal. If you use your IDE’s MCP file, you can place the appropriate entry in your mcpServers configuration to start it automatically.
// Example mcpServers entry using stdio to run the MCP locally
{
"mcpServers": {
"github_repo_mcp": {
"command": "npx",
"args": ["github-repo-mcp"],
"enabled": true
}
}
}You can optionally provide a GitHub personal access token to increase API rate limits when accessing the GitHub API.
{
"mcpServers": {
"github_repo_mcp": {
"command": "npx",
"args": ["github-repo-mcp"],
"env": {
"GITHUB_TOKEN": "Your_Github_Token"
},
"enabled": true
}
}
}Lists all files and directories at the root of a GitHub repository. Parameters include repoUrl.
Lists contents of a specific directory within a GitHub repository. Parameters include repoUrl and path.
Retrieves and displays the content of a specific file from a GitHub repository. Parameters include repoUrl and path.