Git Archaeologist MCP Server
An open-source Model Context Protocol (MCP) server for deep git repository analysis by AI agents.
Git Archaeologist is a published NPM package that acts as a Model Context Protocol (MCP) Server. It empowers AI Assistants (like Anthropic's Claude) with the ability to natively search, query, and analyze local Git repositories without requiring the user to copy-paste code.
AI assistants are highly capable at coding, but they lack context about the history and structure of a codebase. Before MCP, developers had to manually feed diffs and file structures into the prompt, eating up token limits and causing AI confusion.
AI assistants are highly capable at coding, but they lack context about the history and structure of a codebase. Before MCP, developers had to manually feed diffs and file structures into the prompt, eating up token limits and causing AI confusion.
- Build a robust interface adhering to the new MCP specification.
- Expose git history, git blame, and repository structure as callable tools for AI models.
- Publish securely to NPM for public use.
The server is built in TypeScript and runs as an independent Node.js process. It communicates with the host AI client (e.g., Claude Desktop) via JSON-RPC over standard input/output (stdio). It executes local git commands safely and returns structured JSON context to the model.
The server is built in TypeScript and runs as an independent Node.js process. It communicates with the host AI client (e.g., Claude Desktop) via JSON-RPC over standard input/output (stdio). It executes local git commands safely and returns structured JSON context to the model.
| Layer | Technology |
|---|---|
| Language | TypeScript, Node.js |
| Protocol | Model Context Protocol (MCP), JSON-RPC |
| Cache DB | SQLite |
| Integrations | Git CLI, GitHub API |
| Distribution | NPM Registry |
To respect GitHub API rate limits and optimize latency, the MCP server utilizes a local SQLite cache to permanently store resolved commit-to-PR and PR-to-Issue mappings.
- Challenge: Implementing secure, read-only access to prevent the AI from executing arbitrary bash commands via the MCP server.
- Solution: Hardcoded specific Git commands using the Node
child_processmodule with strict argument parsing, explicitly blocking any modifying flags or piped commands.
- Challenge: Implementing secure, read-only access to prevent the AI from executing arbitrary bash commands via the MCP server.
- Solution: Hardcoded specific Git commands using the Node
child_processmodule with strict argument parsing, explicitly blocking any modifying flags or piped commands.
- "Can you explain the architecture of a Model Context Protocol server? How does it communicate with Claude?"
- "What security precautions did you take when allowing an AI model to execute local git commands on a user's machine?"

