git-context
Local MCP server that extracts high-level Git repository context for AI coding agents
claude mcp add --transport stdio tamishaks-2-git-context-mcp python src/server.py
How to use
git-context-mcp runs entirely locally and exposes read-only Git-informed context to AI agents over MCP. It analyzes the repository by inspecting Git metadata and repository files to provide structured insights such as the repository state, entry points, recent activity, maintenance risk, and overall code structure. Tools are designed to be consumed by MCP-aware clients via STDIO, allowing agents to query the server for concrete context before making editing or review decisions. The included tools focus on high-signal information rather than raw code, helping AI assistants understand where to start, what changed recently, and which files carry higher risk.
To use the server, start the MCP process using the recommended Python path and run it in a local environment where the target Git repository exists. Once running, you can invoke the exposed tools (project_status, code_map, recent_activity, work_summary, risk_scan) to retrieve structured insights. Each tool is read-only and tailored to answer targeted questions like current repository state, entry points, recent churn, and debt indicators. This makes it easier for an AI agent to reason about changes, plan edits, and avoid risky areas without needing to access or distribute the codebase beyond the analysis results.
How to install
Prerequisites
- Python 3.10 or newer
- Git installed and available on PATH
- A local clone of the repository to analyze
Installation steps
-
Clone the repository and navigate into it git clone https://github.com/TamiShaks-2/git-context-mcp.git cd git-context-mcp
-
Create and activate a virtual environment python -m venv .venv
macOS / Linux
source .venv/bin/activate
Windows
.venv\Scripts\activate
-
Install the MCP package in editable mode pip install -e .
-
(Optional) Verify installation by listing available scripts or running a minimal test if provided in the repo pytest
-
Run the MCP server as described in the README to begin serving context via STDIO
Additional notes
Tips and common considerations:
- The server is read-only and does not modify the repository; it solely analyzes Git metadata and files.
- Ensure the Python environment has access to the target Git repository location.
- When using MCP Inspector or other clients, the server will respond to the tools in the following order: project_status, code_map, recent_activity, work_summary, risk_scan.
- If you encounter environment issues, ensure Python 3.10+ is active in your terminal and that you’ve activated the virtual environment before running the server.
- If the repository is large, consider working within a shallow clone or limiting history depth to speed up analysis.
- No external services or API keys are required; all data is read from the local Git repository.
Configuration options (beyond defaults):
- You can extend or customize the server by editing the src/tools modules (e.g., project_status.py, code_map.py) to adjust the scope of analysis or the formatting of returned context.
Related MCP Servers
python-utcp
Official python implementation of UTCP. UTCP is an open standard that lets AI agents call any API directly, without extra middleware.
Gitingest
mcp server for gitingest
augments
Comprehensive MCP server providing real-time framework documentation access for Claude Code with intelligent caching, multi-source integration, and context-aware assistance.
slither
MCP server for Slither static analysis of Solidity smart contracts
mcp-sys-bridge
An implementation of the Model Context Protocol (MCP), acting as a simple bridge to native OS functionalities like clipboard management and URL handling.
mini_claude
Give Claude Code persistent memory across sessions. Track habits, log mistakes, prevent death spirals. Runs locally with Ollama.