A Python MCP (Model Context Protocol) server that gives Claude the ability to browse GitHub repositories and search code — in real time, directly from chat.
Built with FastMCP · Deployed on Railway · No setup needed to connect
In progress — Issues & PR tools coming soon.
Add this URL as a Custom Connector in Claude (Pro/Team plan):
git-hub-mcp.up.railway.app
Note: This server uses a shared GitHub token scoped to public repositories only. For private repo access or heavy usage, deploy your own instance (see Self-hosting).
- Get full details about any public repository — stars, forks, language, open issues
- List all public repositories for any GitHub user
- Browse the file and folder tree of any repo at any path
- Read the actual contents of any file (README, source code, configs)
- Search for code across all of GitHub by keyword
- Scope searches to a specific user or repository
- Find repositories by keyword, filtered by language
Once connected, just talk to Claude naturally:
Show me all repos for user khushi09-oss, sorted by most recently updated
Search for MCP server Python repos on GitHub, sorted by stars
Read the README.md from microsoft/vscode
Browse the files inside khushi09-oss/MCP-Servers
Search for "FastMCP" in the khushi09-oss/MCP-Servers repo
Find Python repos about machine learning on GitHub
| Tool | Description | Key inputs |
|---|---|---|
get_repo |
Repository details — stars, forks, language, last push | owner, repo |
list_user_repos |
All public repos for a GitHub user | username, sort |
list_repo_contents |
Browse files and folders at any path | owner, repo, path |
read_file |
Read a file's full contents | owner, repo, path |
search_code |
Search code across GitHub, optionally scoped to a repo | query, owner?, repo? |
| Tool | Description |
|---|---|
list_commits |
Recent commits on any branch |
search_repos |
Find repos by keyword and language |
list_issues |
Open or closed issues in a repo |
get_issue |
Full details of a specific issue |
list_pull_requests |
Open or closed PRs in a repo |
get_pull_request |
Full PR details with diff stats |
Deploy your own instance with your own GitHub token for private repo access and no rate-limit sharing.
- Python 3.10+
- A GitHub personal access token (create one here)
- For public repos only: no scopes needed
- For private repos: enable the
reposcope
1. Clone and install
git clone https://github.com/YOUR_USERNAME/github-mcp.git
cd github-mcp
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt2. Switch to STDIO transport
In server.py, change the last line to:
if __name__ == "__main__":
mcp.run(transport="stdio")3. Add to Claude Desktop config
Find your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this entry (use absolute paths):
{
"mcpServers": {
"github": {
"command": "/absolute/path/to/venv/bin/python",
"args": ["/absolute/path/to/github-mcp/server.py"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}4. Restart Claude Desktop — your tools will appear automatically.
1. Push to GitHub
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/YOUR_USERNAME/github-mcp.git
git push -u origin main2. Deploy on Railway
- Go to railway.app and sign in with GitHub
- Click New Project → Deploy from GitHub repo
- Select your
github-mcprepo — Railway auto-detects Python via theProcfile
3. Add your GitHub token
In Railway, click your service card → Variables tab → New Variable:
GITHUB_TOKEN = ghp_your_token_here
Railway will automatically redeploy with the token set.
4. Get your live URL
Click your service card → Settings tab → Networking → Generate Domain
You'll get a URL like:
https://github-mcp-production.up.railway.app
5. Connect to Claude
In Claude.ai → tools icon → Add more tools → Custom connector → paste:
https://github-mcp-production.up.railway.app/mcp
Click Save → Always Allow.
pip install "mcp[cli]"
mcp inspect server.pyThis opens a browser UI where you can call every tool directly and see the raw responses — great for debugging before connecting to Claude.
github-mcp/
├── server.py # MCP tools (5 tools currently)
├── requirements.txt # mcp[cli], requests
├── Procfile # Railway start command
└── README.md
- MCP Python SDK — FastMCP server framework
- GitHub REST API — v2022-11-28
- Railway — deployment platform