MCP (Model Context Protocol) server exposing GitHub repository data as tools, a resource, and a prompt. Backed by GitHub's REST API via httpx.
- Install deps:
uv sync
- Copy env template and fill in your token:
Generate a token at https://github.com/settings/tokens (needs
cp .env.example .env
reposcope for private repos, no scope needed for public read-only).
Start the MCP server (stdio transport):
uv run python server.pyRun the sample client (spawns the server and calls a tool):
uv run python client.py| Tool | Description |
|---|---|
get_repository(owner, repo) |
Repo summary — stars, forks, open issues, language |
search_issues(owner, repo, state="open") |
List issues (excludes PRs) |
list_pull_requests(owner, repo, state="open") |
List pull requests |
search_repository_issues(owner, repo, keyword) |
Keyword search over repo issues |
github://repo/{owner}/{repo} — repository details as text.
review_repository(owner, repo) — generates a prompt to analyze repo health (issues, PRs, activity, risks).
server.py— MCP server, all tools/resource/promptclient.py— sample MCP client exercising the server over stdiogithub_service.py,test_github.py— early prototype scratch, superseded byserver.py(kept commented for reference)
No manual clone needed — uv fetches and runs the server directly from the git repo. Each person still runs their own local copy with their own token; nothing is centrally hosted.
- Register the server with Claude Code (one command, no clone/install step):
Replace the URL with this repo's actual location once pushed.
claude mcp add github-assistant --scope local -- uvx --from git+https://github.com/ritesh31/github-mcp github-mcpuvcaches the repo behind the scenes on first run — no visible clone step.--scope localkeeps it private to their machine. - Provide
GITHUB_TOKEN. Since there's no local clone, there's no.envfile to edit — pass the token as an environment variable on theclaude mcp addcommand instead:Each person uses their own token (generate at https://github.com/settings/tokens — read-only, fine-grained, scoped to needed repos).claude mcp add github-assistant --scope local -e GITHUB_TOKEN=ghp_yourColleaguesOwnTokenHere -- uvx --from git+https://github.com/ritesh31/github-mcp github-mcp - Verify:
Should show
claude mcp list
github-assistantas Connected. Open a Claude Code session and run/mcpto confirm all 4 tools, the resource, and the prompt are discovered. - Test: ask Claude something like "what's the star count on
<owner>/<repo>?" — it should pick theget_repositorytool on its own.