GitHub Repository MCP Server
GitHub context server for AI models. Fetch files, structure, filter, and more.
Overview
GitHub Repository MCP Server is a Model Context Protocol (MCP) server that allows AI models to access GitHub repository contents as context, enabling enhanced interactions with AI.
To use the server, clone the repository, install dependencies, and set up GitHub authentication to increase API request limits. Then, integrate it with tools like Cursor for seamless operation.
- Fetch entire repository contents as context - Retrieve specific file contents from a repository - Get repository structure (file listing) - Filter files by extension - Exclude specific paths - Limit the number of files returned
- Enabling AI models to access and analyze code from GitHub repositories.
- Assisting developers in fetching repository structures for better project understanding.
- Facilitating the retrieval of specific files for AI-driven code analysis.
Add to your AI client
Use these steps to connect GitHub Repository MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"gh-mcp-server-shanksxz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"gh-mcp-server-shanksxz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"gh-mcp-server-shanksxz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"gh-mcp-server-shanksxz": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"gh-mcp-server-shanksxz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"gh-mcp-server-shanksxz": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gh-mcp-server-shanksxz"
]
}
}
}FAQ
Can I use this server with private repositories?
Yes, but you need to authenticate using a GitHub personal access token.
What is the rate limit for unauthenticated requests?
The limit is 60 requests per hour; authenticated requests can go up to 5000 requests per hour.
How do I set up the server with Cursor?
Follow the provided steps in the usage section to add the MCP server in Cursor settings.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2182,"uuid":"3af59c22-cdc7-4391-80c9-8c7c739c9135","name":"gh-mcp-server","title":"GitHub Repository MCP Server","description":"GitHub context server for AI models. Fetch files, structure, filter, and more.","avatar_url":"https://avatars.githubusercontent.com/u/121852611?v=4","created_at":"2025-03-09T03:57:48.081Z","updated_at":"2025-03-12T10:19:30.025Z","status":"created","author_name":"shanksxz","author_avatar_url":"https://avatars.githubusercontent.com/u/121852611?v=4","tags":"mcp,cursor,mcp-server","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/shanksxz/gh-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"2\",\"license\":\"MIT license\",\"language\":\"JavaScript\",\"is_official\":false,\"latest_commit_time\":\"2025-04-24 20:22:15\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]