Codebase Archaeology MCP
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., "@Codebase Archaeology MCPWhy is line 42 in src/utils/retry.py here?"
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.
Codebase Archaeology MCP
An MCP server that answers "why is this line here?" for a local git repo by tracing a line back to the commit that actually introduced it, then to the PR and review discussion behind that commit.
The problem
git blame attributes a line to whoever last touched it. In real repos
that is usually a formatter run, an import reorder, or a rename. The naive
pipeline — blame → commit → PR — returns "Bob, prettier migration, 2024"
and tells you nothing about intent.
This server defeats that:
blame runs with
-w -C -C(whitespace ignored, moved/copied code followed) and honours.git-blame-ignore-revs.line history follows a range backwards through edits and renames (
git log -L), detects cosmetic commits (git show -wproduces no output → the change was whitespace-only), and compensates for-Lrange drift, solikely_originis the commit that genuinely introduced the content — not the formatter, and not the neighboring lines' history.PR lookup uses GitHub's
commits/{sha}/pullsendpoint, which works for squash and rebase merges where commit-message parsing silently fails.When the trace bottoms out at the commit that created the file, the answer says so —
git log -Lcannot see across a file split, and pretending otherwise would be lying.
Related MCP server: review-dojo-mcp
Tools
Tool | Question it answers |
| Start here. The whole story: last touch, true origin, evolution, origin PR + review discussion, and an interpretation when blame's answer is misleading. |
| Who last touched these lines (formatters already discounted)? |
| Every commit that changed this range, with |
| "There used to be a retry here — where did it go?" Pickaxe ( |
| Full message, author, files, stat for one commit. |
| The PR that introduced a commit, with inline review comments and discussion. |
repo may be any path inside the work tree; file paths are resolved against
the repo root and anything escaping it is rejected.
Setup
Python 3.11+ and git on PATH.
pip install -r requirements.txtRun over stdio:
python server.pyor explore interactively:
fastmcp dev server.pyClient configuration (stdio)
{
"mcpServers": {
"codebase-archaeology": {
"command": "python",
"args": ["C:/path/to/code-arch/server.py"],
"env": {
"ARCHAEOLOGY_REPOS": "C:/Users/you/src/repo-a;C:/Users/you/src/repo-b",
"GITHUB_TOKEN": "ghp_...",
"ARCHAEOLOGY_CACHE": "C:/Users/you/.cache/archaeology.sqlite"
}
}
}
}Environment variables
Variable | Meaning |
| Allowlist of repositories the server may read, separated by the platform path separator ( |
| GitHub token for PR lookups. Optional, but unauthenticated calls are capped at 60 req/hr; one |
| Path of the SQLite HTTP cache (default |
Honest limits
git log -Lcannot trace across a file split (content extracted into a new file). The origin will be the splitting commit, flagged withorigin_is_file_creation: trueand an interpretation pointing atfind_removalto dig further.Cosmetic detection is whitespace-based (
git show -w). A formatter that changes quote characters is not "cosmetic" by this test, but the lineage trace still walks through it to the real origin.git log -Lon a huge file with deep history is genuinely slow; that is whylimitdefaults to 15 and git calls time out at 30s.
Tests
python -m pytestThe suite builds a throwaway repo reproducing the failure mode (real origin → whitespace-only reformat → reword) and asserts, among other things, that naive blame credits the formatter while every tool here names the true origin. GitHub tests run against a fake transport — no network needed.
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Related MCP Servers
- AlicenseAqualityCmaintenanceSemantic git queries via MCP. Beyond git log — answer who/what/why about any line, file, or branch with blame, co-change, PR linkage.65 npm2MIT
- FlicenseNot gradedqualityDmaintenanceEnables searching and retrieving knowledge extracted from GitHub PR reviews to help developers avoid repeating mistakes.-
- AlicenseNot gradedqualityDmaintenanceIndexes commit history to create a queryable expert, providing insights into code evolution, developer intent, and hidden patterns beyond static code analysis.MIT
- AlicenseAqualityBmaintenanceAnalyzes Git commit history and code diffs to auto-remember development context, providing commit timelines, work sessions, unfinished task detection, and daily/weekly reports.97 npmMIT