Skip to main content
Glama

git-context-mcp

Ein MCP-Server, der die eine Frage beantwortet, die jeder Entwickler hat: „Warum existiert dieser Code?“

git blame sagt dir, wer eine Zeile geschrieben hat. Dies sagt dir, warum.

Gegeben eine Datei und einen Zeilenbereich, verfolgt git-context-mcp den Commit zurück, findet den Pull Request, der ihn eingefügt hat, liest die PR-Beschreibung und zeigt alle verknüpften GitHub-Issues an – alles auf einmal, direkt in 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..."

Kein Suchen mehr im git log, kein Durchforsten von GitHub und kein Abgleichen von Issue-Trackern. Claude erledigt das in einem Schritt.


Related MCP server: Selvedge

Tools

Tool

Was es tut

blame_context

Datei + Zeilenbereich → Commit + PR-Beschreibung + verknüpfte Issues

commit_story

Commit-Hash → vollständige Historie (Nachricht, Diff-Statistik, PR, Issues)

file_history

Datei → letzte N Commits, jeweils annotiert mit PR und Issues

search_commits

Schlüsselwort → passende Commits mit PR/Issue-Kontext

file_contributors

Datei → Rangliste der Autoren (Commits, Zeilenanteil, aktive Daten)


Installation

Option 1 — npx (keine Installation)

claude mcp add git-context -- npx git-context-mcp

Option 2 — globale Installation

npm install -g git-context-mcp
claude mcp add git-context -- git-context-mcp

Option 3 — manuelle Konfiguration

Hinzufügen zu ~/.claude/claude_mcp_config.json:

{
  "mcpServers": {
    "git-context": {
      "command": "npx",
      "args": ["git-context-mcp"]
    }
  }
}

Starten Sie danach Claude Code neu.


Anforderungen

  • Claude Code (oder ein beliebiger MCP-kompatibler Client)

  • git im PATH

  • gh CLI (Installation) + gh auth login für GitHub PR/Issue-Abfragen

    • Funktioniert auch ohne gh – überspringt dann einfach den PR/Issue-Kontext


Anwendungsbeispiele

Sobald installiert, sprechen Sie in einem beliebigen Git-Repository ganz natürlich mit Claude:

"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"

Funktionsweise

  1. blame_context führt git blame -p auf Ihren Zeilen aus, um den/die Commit-Hash(es) zu finden.

  2. Für jeden Commit ruft es git show für die vollständige Nachricht und die Diff-Statistik auf.

  3. Es fragt die GitHub-API ab (gh api /repos/:owner/:repo/commits/:hash/pulls), um den PR zu finden.

  4. Es parst #NNN und /issues/NNN Referenzen aus dem PR-Text und ruft jedes Issue ab.

  5. Alles wird als strukturiertes Markdown zurückgegeben, damit Claude es analysieren kann.

Keine Token gespeichert. Keine Daten werden irgendwohin gesendet, außer an die GitHub-eigene API (genau wie bei der gh CLI).


Mitwirken

PRs sind willkommen. Der gesamte Server befindet sich in src/index.ts.

git clone https://github.com/muhannad-hash/git-context-mcp
cd git-context-mcp
npm install
npm run dev   # watch mode

Lizenz

MIT

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    A
    quality
    A
    maintenance
    Change 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.
    8
    19
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Indexes commit history to create a queryable expert, providing insights into code evolution, developer intent, and hidden patterns beyond static code analysis.
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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