When an assistant needs to understand a codebase it does not have locally, the usual options are pasting files or cloning by hand. I wanted something better: point the assistant at owner/repo and let it explore, the way a developer would. So I wrote github-repo-mcp, a local Model Context Protocol server.
Architecture
The server runs over stdio. Repos are cloned once and reused from a local cache.
REQUEST PATH Claude (MCP client) ──▶ github-repo-mcp (stdio server, written in TypeScript on Bun) ──▶ Local clone cache (~/.cache/github-repo-mcp/owner/repo) ──▶ GitHub (Cloned once, pulled on refresh)
FIVE TOOLS load_repo (Clone or reuse, return a summary) ──▶ get_repo_map (Files and exported symbols) ──▶ grep (Regex search with context) ──▶ read_file (A file or a line range) ──▶ refresh_repo (Pull latest, invalidate the map)
Enter fullscreen mode
Exit fullscreen mode
How it works
load_repo clones a repo (or reuses the cached copy) and returns languages, file count, a top-level tree and a README excerpt,…