provenance-mcp
Click on "Install 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., "@provenance-mcpwhy was the email validator added to zod?"
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.
provenance-mcp
Answers "why does this code exist" for a file:line or a natural-language question in colinhacks/zod, by tracing code → git blame → commit → PR → linked issue. Every answer is either quoted from real history with a citation, or explicitly marked NOT RECOVERABLE -- never a plausible-sounding guess.
v1 is hardcoded to a single demo repo (colinhacks/zod). No multi-repo support, no config system.
Architecture
packages/core-- shared TypeScript retrieval logic: local git blame/history (including pickaxe search and full non-line-scoped file history), GitHub REST enrichment (PR/issue linkage, review comments, discussion threads, repo-scoped issue/PR search), reading current file content (README/docs/changelogs), hunk-based diff chunking, commit-importance scoring, Upstash Vector indexing/search, and Report/citation assembly. All tracing logic lives here exactly once.packages/mcp-server-- a thin MCP server (@modelcontextprotocol/sdk) exposing four tools:trace_line,ask_why,search_history,investigate. Calls intocoreonly.packages/demo-- a small live web app comparing provenance-mcp's answers against rawgit log --grep, a web-search-equipped Claude call, and provenance-mcp's own multi-hop mode, side by side. See Demo below.packages/skill--SKILL.md, a Claude Code Skill that drives the MCP tools and renders the fixedWHY / EVIDENCE / STILL LIVE? / VERDICT / CONFIDENCEverdict block.scripts/index-repo.ts-- one-off script that clones zod locally, walks its full commit history, and upserts commit documents into Upstash Vector.
trace_line/ask_why/search_history never call an LLM -- core returns structured, cited JSON, and the calling agent (Claude, via the Skill's procedure) is the one that renders prose. investigate is the one exception: it runs a bounded, LLM-orchestrated multi-hop loop (see below), but the model only ever chooses where to look next -- the actual cited text is still deterministically re-extracted from real fetched sources by the same evidence.ts logic the other tools use. There's no code path where model-authored prose becomes a citation.
The investigate tool (multi-hop mode)
trace_line/ask_why take a single deterministic pass: blame or vector-search to one anchor commit, follow its linked PR/issue, done. That's fast and cheap, but it can miss things a single pass can't reach -- a rationale stated in a review comment rather than the PR body, a fix that requires retrying the search with different words, or a design decision documented in current prose (a changelog, a migration guide) rather than any single commit.
investigate runs an autonomous loop (default: up to 40 turns / 60 tool calls / 4 minutes, Opus-tier model) with 11 read-only navigation tools -- blame_line, get_commit, get_commit_diff, pickaxe_search, file_history, vector_search, get_issue_or_pr, get_pr_review_comments, get_discussion_comments, search_issues, read_doc -- plus two terminal tools, submit_finding and give_up. Every navigation tool result carries a harness-minted sourceId tied to real fetched text; the model can only ever point at IDs it has actually seen. When it calls submit_finding, that's a pointer, not an answer -- the harness re-reads that exact source's real text through the same findRationale/buildReason logic the deterministic tools use, and if the model's chosen source doesn't actually state a reason, the report honestly comes back partial/not_recoverable regardless of what the model claimed.
Requires ANTHROPIC_API_KEY. Prefer trace_line/ask_why first; only reach for investigate when they come back partial or not_recoverable.
Related MCP server: Git Insight MCP
Setup
npm install
cp .env.example .env
# fill in GITHUB_TOKEN, UPSTASH_VECTOR_REST_URL, UPSTASH_VECTOR_REST_TOKEN
# ANTHROPIC_API_KEY is optional -- only needed for `investigate` and the demo's
# Exhibits B/D. trace_line/ask_why/search_history work without it.Create the Upstash Vector index with a built-in embedding model (e.g. mxbai-embed-large-v1) so text can be upserted/queried directly without a separate embeddings step.
Build all workspaces:
npm run buildIndex the demo repo (one-off; clones colinhacks/zod into ./.cache/zod, ~2,900 commits):
npm run index-repoRun the MCP server (stdio transport):
npm run mcp-serverPoint an MCP client (Claude Code, the MCP inspector, etc.) at packages/mcp-server/dist/index.js, and install packages/skill/SKILL.md as a Claude Code Skill to get the cited verdict format end to end.
Tools
Tool | Input | Output |
|
|
|
|
|
|
|
| ranked |
|
|
|
See packages/core/src/types.ts for the full Report/Citation schema.
Demo
npm run demoServes a live page at http://localhost:5173 comparing four ways of answering the same question about colinhacks/zod:
Exhibit A -- raw
git log --grep, no synthesis: what a developer gets from blind keyword search.Exhibit B -- a live Claude call with the real
web_searchtool, but no access to this repo's own git history / provenance-mcp index. The fair steelman: general web search vs. specialized primary-source tracing.Exhibit C -- provenance-mcp's
ask_why(the single-shot deterministic tool).Exhibit D -- provenance-mcp's
investigate(multi-hop), auto-escalated to whenever C doesn't come back fullyrecovered.
The pre-loaded example questions are verified, not cherry-picked: one case where the fast tier alone beats web search outright, one where web search states something false with full confidence and only multi-hop corrects it, and one pulled from a real (at the time, unanswered) open GitHub issue. See the comments in packages/demo/src/examples.ts for exactly what was verified about each.
Testing
npm testRuns Node's built-in test runner (node:test, no extra dependency) over packages/core's pure logic -- rationale extraction, confidence scoring, citation builders, commit-importance heuristics, diff chunking, and investigate's caching/ordering helpers. Two of the test cases are direct regression tests for real bugs found and fixed during development (a keyword-relevance threshold bug in findRationale, and a cache-upgrade bug in investigate's commit caching) -- see the comments in packages/core/src/investigate.test.ts for what they'd have caught.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenancegit blame tells you who wrote a line. This tells you why.5162MIT
- AlicenseAqualityCmaintenanceSemantic git queries via MCP. Beyond git log — answer who/what/why about any line, file, or branch with blame, co-change, PR linkage.6242MIT
- Alicense-qualityDmaintenanceEnables querying git commit history to analyze when and why code changes happened, providing authorship context and diffs for specific modules.Creative Commons Zero v1.0 Universal
- Alicense-qualityBmaintenanceIndexes commit history to create a queryable expert, providing insights into code evolution, developer intent, and hidden patterns beyond static code analysis.MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Repo intel for AI coding agents: overview, PRs, contributors, hot files, CI, deps. Remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/claudechen95/provenance-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server