Repo Insight MCP
Provides read-only, structured access to a GitHub repository through six tools: repo_profile (metadata, size, languages, maintenance status), list_tree (file listing filtered by directory or extension), read_file (file contents with explicit 40 KB truncation), list_dependencies (normalised dependency list parsed across pypi, npm, maven, go and rubygems manifests in one call, with per-file parse problems reported separately), file_history (commit churn and last-touched data) and search_code (symbol/string usage search, requires a token). Responses are cached for 300 seconds, secondary rate limits are waited out and retried, typed errors (RepoNotFound, RateLimited, GitHubError) are surfaced to the agent, and vendored directories such as node_modules and vendor are skipped.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Repo Insight MCP profile github.com/psf/requests and list its dependencies"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
repo-insight-mcp
An MCP server that gives an AI agent read-only, structured access to a GitHub repository.
Built for the case where an agent has to reason about a codebase nobody on the team wrote: a legacy service being migrated, a dependency audit, a repo you have been handed on day one. The agent gets six tools instead of a shell and a prayer.
Written against the Model Context Protocol Python SDK v2 (MCPServer).
Why these six tools
An agent exploring an unfamiliar repository asks the same questions in the same order, so the tools are shaped around that sequence rather than around GitHub's API surface.
Tool | Answers |
| What is this, how big, what languages, still maintained? |
| What files exist, filtered by directory or extension |
| What does this specific file say |
| What does it depend on, across every ecosystem at once |
| Is this code churning or has it sat untouched for years |
| Where is this symbol or string used |
list_dependencies is the one that earns its place. It walks the tree, finds
every requirements.txt, pyproject.toml, package.json, pom.xml, go.mod
and Gemfile, parses each one and returns a single normalised list:
{
"ecosystems": ["maven", "npm", "pypi"],
"count": 47,
"dependencies": [
{"name": "httpx", "version": ">=0.27", "ecosystem": "pypi",
"source_file": "requirements.txt", "scope": "runtime"},
{"name": "org.springframework:spring-core", "version": "5.3.39",
"ecosystem": "maven", "source_file": "service/pom.xml", "scope": "runtime"}
],
"problems": []
}The agent does not need to know that Maven nests coordinates in XML and npm uses
a flat object. A manifest that fails to parse lands in problems and the rest of
the results still come back, because one broken file in a monorepo should not
fail the whole call.
Related MCP server: atelier-busco-github-mcp
Install
git clone https://github.com/viradm/repo-insight-mcp
cd repo-insight-mcp
pip install -e ".[dev]"Python 3.11 or newer.
Configure
Add it to any MCP client. For Claude Desktop, in claude_desktop_config.json:
{
"mcpServers": {
"repo-insight": {
"command": "repo-insight-mcp",
"env": { "GITHUB_TOKEN": "ghp_your_token_here" }
}
}
}For Claude Code:
claude mcp add repo-insight --env GITHUB_TOKEN=ghp_... -- repo-insight-mcpOr run it directly over stdio:
GITHUB_TOKEN=ghp_... python -m repo_insight_mcpThe token
Everything except search_code works unauthenticated, but GitHub allows only 60
requests an hour that way and a single agent run will spend them. A classic token
with the public_repo scope raises the limit to 5000 and enables code search.
Set GITHUB_TOKEN or GH_TOKEN.
Design notes
Caching. An agent chaining tool calls asks for the same tree three times in a
row. Responses are cached in memory with a 300 second TTL, which is long enough
for a conversation and short enough that a push mid-session is picked up. Override
with REPO_INSIGHT_TTL.
Rate limits. A secondary limit that resets within five seconds is waited out
and retried once. A primary limit resets in minutes, so it is raised immediately
as a RateLimited error naming the token variable, rather than hanging the agent
on a call that cannot succeed.
Truncation is explicit. read_file caps at 40 KB by default and returns
truncated: true with the real byte count. list_tree returns matched next to
returned, so an agent can tell "there are 12 Python files" from "there are 400
and you are looking at 300 of them". Silently returning a partial answer that
looks complete is how agents reach confident wrong conclusions.
Vendored code is skipped. node_modules and vendor directories are
excluded from the dependency walk. Other people's dependencies are not this
repository's dependencies.
Errors are typed. RepoNotFound, RateLimited and GitHubError are
distinct, and tool-facing failures are raised as ToolError so the client gets
a usable message instead of a traceback.
Tests
pytest51 tests, no network. HTTP is mocked with respx, so the suite covers the paths
that are awkward to reach against the live API: a 404, an exhausted primary rate
limit, a secondary limit that retries and then succeeds, a cache hit, a cache
expiry, invalid UTF-8 in a file, a directory passed where a file was expected,
and a malformed manifest sitting next to a valid one.
The server tests call tools through mcp.call_tool, the same path an MCP client
takes, so the registered schemas are exercised rather than just the Python
functions underneath them.
Licence
MIT
Available Tools
6 toolsfile_historyB
List recent commits, optionally for one path. Use it to see whether code is actively maintained or has sat untouched for years.
Inputs: repo (required), path, limit. Returns: object
list_dependenciesA
Find and parse every dependency manifest in the repository, returning one normalised list across pypi, npm, maven, go and rubygems.
Inputs: repo (required), ref. Returns: object
list_treeB
List files in a repository with their sizes. Filter by directory prefix or extension to find the parts of a codebase worth reading.
Inputs: repo (required), ref, limit, extension, +1 more. Returns: object
read_fileB
Read one text file. Truncates at max_bytes and says so, rather than returning a file too large to be useful.
Inputs: path (required), repo (required), ref, max_bytes. Returns: object
repo_profileA
Summarise a repository: description, default branch, size, languages, last push and open issue count. Start here before any other tool.
Inputs: repo (required). Returns: object
search_codeB
Search code inside one repository. GitHub's code search requires authentication, so this needs GITHUB_TOKEN set.
Inputs: repo (required), query (required), limit, extension. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action and resource: repo summary, file listing, single-file read, dependency parsing, commit history, and code search. None of these overlap in a way that would cause misselection; the only close pair is list_tree and search_code, but one lists paths and the other searches contents.
Most names follow a clear verb_noun pattern (list_tree, read_file, list_dependencies, search_code), but repo_profile and file_history are noun-style names. The deviation is minor and each name remains self-explanatory, so consistency is good but not perfect.
Six tools is a tightly scoped set for repository inspection. Each tool has a clear job, and there are no redundant or filler tools.
The surface covers the core repository-insight workflow: orient, explore files, read contents, inspect dependencies, check history, and search code. Minor gaps remain, such as reading a file at a specific commit or retrieving diffs, but these are workaroundable and not central to the stated purpose.
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Codebase memory for AI coding agents: files, lines, callers and tests for any public GitHub repo.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10ISC
- AlicenseAqualityDmaintenanceConnects LLMs and AI agents directly to GitHub repositories, enabling repository inspection, file and tree exploration, code search, commit history, issues, pull requests, and releases for both public and private repos.13MIT
- AlicenseAqualityBmaintenanceProvides coding agents with repository-aware tools to understand code structure, find existing patterns, and review plans, architecture, and diffs, enabling a consistent engineering workflow across Cursor, Codex, and Claude Code.7MIT
- AlicenseAqualityCmaintenanceEnables AI agents to ask read-only questions about a repository's history through GitHub APIs, including blame, path history, merge base, PR association, diffs, and file contents, with aggressive caching and no clone required.101MIT