git-context-mcp
git-context-mcp
Un servidor MCP que responde a la pregunta que todo desarrollador se hace: "¿por qué existe este código?"
git blame te dice quién escribió una línea. Esto te dice por qué.
Dada una línea o rango de líneas de un archivo, git-context-mcp rastrea el commit, encuentra la solicitud de extracción (pull request) que lo introdujo, lee la descripción del PR y muestra todos los issues de GitHub vinculados, todo de una vez, directamente dentro de Claude.
Demo
You: Why does line 87 of src/auth/session.ts exist?
Claude (using blame_context):
Commit `a3f9c12` by Sarah Chen on 2024-08-14
Message: "fix: rotate session tokens on privilege escalation"
PR #441 — "Security: fix session fixation vulnerability"
Merged: 2024-08-15 | Labels: security, critical
PR Description:
> After the pen test in sprint 22, we found that session tokens
> weren't being rotated when a user's role changed. This allows
> a stolen low-priv token to be used after the account is promoted.
Linked Issue #389 — "Session token not rotated on role change" (closed)
> Reported by @contractor-red: "I was able to reuse a captured
> token after my account was upgraded to admin..."Se acabó el buscar en el registro de git, investigar en GitHub y cruzar referencias en los gestores de incidencias. Claude lo hace en un solo paso.
Related MCP server: Selvedge
Herramientas
Herramienta | Qué hace |
| Archivo + rango de líneas → commit + descripción del PR + issues vinculados |
| Hash del commit → narrativa completa (mensaje, estadísticas de diff, PR, issues) |
| Archivo → últimos N commits, cada uno anotado con PR e issues |
| Palabra clave → commits coincidentes con contexto de PR/issue |
| Archivo → tabla de autores clasificados (commits, líneas propias, fechas de actividad) |
Instalación
Opción 1 — npx (sin instalación)
claude mcp add git-context -- npx git-context-mcpOpción 2 — instalación global
npm install -g git-context-mcp
claude mcp add git-context -- git-context-mcpOpción 3 — configuración manual
Añadir a ~/.claude/claude_mcp_config.json:
{
"mcpServers": {
"git-context": {
"command": "npx",
"args": ["git-context-mcp"]
}
}
}Luego reinicia Claude Code.
Requisitos
Claude Code (o cualquier cliente compatible con MCP)
giten el PATHCLI de
gh(instalar) +gh auth loginpara búsquedas de PR/issues en GitHubFunciona sin
gh, simplemente omite el contexto de PR/issue
Ejemplos de uso
Una vez instalado, habla con Claude de forma natural en cualquier repositorio git:
"Why does line 42 of src/db/connection.ts exist?"
"What's the story behind commit d4a8f91?"
"Who owns the most of src/payments/stripe.ts?"
"When was the rate limiting added? Search commits for 'rate limit'"
"Show me the last 5 changes to src/api/auth.ts and why each was made"Cómo funciona
blame_contextejecutagit blame -pen tus líneas para encontrar el/los hash(es) del commitPara cada commit, llama a
git showpara obtener el mensaje completo y las estadísticas del diffConsulta la API de GitHub (
gh api /repos/:owner/:repo/commits/:hash/pulls) para encontrar el PRAnaliza las referencias
#NNNy/issues/NNNdel cuerpo del PR y obtiene cada issueTodo se devuelve como markdown estructurado para que Claude pueda razonar sobre ello
No se almacenan tokens. No se envían datos a ningún lugar excepto a la propia API de GitHub (igual que la CLI de gh).
Contribuciones
Las PR son bienvenidas. Todo el servidor reside en src/index.ts.
git clone https://github.com/muhannad-hash/git-context-mcp
cd git-context-mcp
npm install
npm run dev # watch modeLicencia
MIT
Maintenance
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
- Alicense-qualityDmaintenanceThe shared AI context engine for git — save, search, and share the reasoning behind code changes. Captures the why behind every commit and slide on PRs for coding agents.46MIT
- AlicenseAqualityAmaintenanceChange tracking for AI-era codebases. AI agents call it to log structured change events (entity + diff + reasoning) before the session ends, then query history with diff, blame, history, changeset, and search. Captures the intent that would otherwise evaporate.819MIT
- 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-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
Memory for coding agents: the decisions, the dead ends, and where the last session stopped.
Individual-analyst context layer: recall, remember, and reconcile your data and engineering context.
Independent static verification for exact immutable public GitHub commits.
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/muhannad-hash/git-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server