Git Context MCP logo

Git Context MCP

by muhannad-hash

Traces code lines and commits to GitHub pull requests, linked issues, history, and contributors through MCP.

Install Git Context MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "muhannad-hash-git-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "git-context-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

The muhannad-hash/git-context-mcp MCP server connects local Git repositories with GitHub metadata to explain why code exists. It uses Git history and the GitHub CLI to associate lines and commits with pull requests and linked issues, then returns structured context through five MCP tools. Use it when reviewing unfamiliar code, investigating regressions, or reconstructing the rationale behind changes. GitHub pull request and issue context is optional and is skipped when the GitHub CLI is unavailable.

Use cases

  • Trace a line to its commit, pull request, and linked issue
  • Investigate the rationale behind a historical commit
  • Review the latest changes made to a file
  • Search commit history for a feature or bug keyword
  • Identify the main contributors to a file

Key features

  • Line-range blame with pull request and issue context
  • Commit narratives with messages and diff statistics
  • Annotated file history
  • Keyword-based commit search
  • Ranked file contributor data

Tools5

What Git Context MCP lets your agent do. Expand a tool for its parameters.

Self-reported~89 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

21/22 checks healthy over the last 91d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · git-context-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads36Package downloads in the last 30 days.
Last commit7mo agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Git Context MCP works

What muhannad-hash/git-context-mcp does

The muhannad-hash/git-context-mcp MCP server helps an agent move from code ownership or history to the reasoning behind a change. It accepts repository-oriented questions through MCP and combines local Git data with related GitHub pull requests and issues.

The main entry point for line-level investigation is blame_context. Given a file and line range, it identifies the commit responsible for those lines, retrieves the commit message and diff statistics, finds the associated pull request, and includes linked issue information when available. This is useful when a line is difficult to understand from the current file alone.

Other tools cover commit narratives, file history, keyword-based commit discovery, and contributor information. Results are returned as structured Markdown for the connected client to interpret.

How it works

For blame_context, the server runs git blame -p against the requested lines to obtain one or more commit hashes. It then uses git show to collect each commit's full message and diff statistics. To add collaboration context, it calls the GitHub API through gh, checks for the pull request associated with the commit, and parses references such as #NNN or /issues/NNN from the pull request body. Referenced issues are fetched individually.

The server does not store tokens. According to the project documentation, data is sent only to GitHub's API through the GitHub CLI when GitHub lookups are requested. Local Git operations continue to work without GitHub metadata.

Setup and configuration

The muhannad-hash/git-context-mcp MCP server can run through npx without a global installation:

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

Alternatively, install the package globally with npm install -g git-context-mcp, then register git-context-mcp as the MCP command. Manual Claude configuration can define an MCP server named git-context with npx as the command and git-context-mcp as its argument. Restart the client after changing the configuration.

The documented requirements are Claude Code or another MCP-compatible client, Git available on PATH, and the gh CLI for pull request and issue lookups. Run gh auth login to authenticate GitHub access. The server still works without gh, but omits pull request and issue context.

Tools and capabilities

  • blame_context: maps a file and line range to its commit, pull request description, and linked issues.
  • commit_story: builds a narrative for a commit hash using its message, diff statistics, pull request, and issues.
  • file_history: lists the last requested number of commits for a file and annotates them with pull requests and issues.
  • search_commits: finds commits matching a keyword and includes available pull request or issue context.
  • file_contributors: produces a ranked author table for a file, including commit counts, lines owned, and active dates.

These tools support questions such as why a line exists, what motivated a commit, when a change was introduced, and which authors have contributed most to a file.

Limitations and notes

GitHub enrichment depends on the gh CLI and its authentication. Without it, local commit and file information remains available, but pull request and issue details are not returned. The server is intended to operate in a Git repository and uses the repository's Git history as its source for blame, commits, and file changes.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Git Context MCP

muhannad-hash/git-context-mcp is an MCP server that connects a local Git repository with GitHub metadata and exposes five tools: blame_context, commit_story, file_history, search_commits, and file_contributors. It links lines and commits to pull requests, linked issues, history, and contributor details.

Install it with `claude mcp add git-context -- npx git-context-mcp`. You can also install the package globally with npm and register `git-context-mcp` as the command, or add the equivalent command and argument to Claude's MCP configuration.

Yes, it works without `gh`, but it skips pull request and linked issue context. Git and an MCP-compatible client are still required, while installing and authenticating the GitHub CLI enables GitHub lookups.

It finds the pull request associated with a commit through the GitHub API using `gh`, parses issue references in the pull request body, and fetches each referenced issue. This enrichment is unavailable when `gh` is missing or unauthenticated.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGit Context MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/muhannad-hash-git-context-mcp?style=directory)](https://allmcps.com/mcp/muhannad-hash-git-context-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/muhannad-hash-git-context-mcp"><img src="https://allmcps.com/api/badge/muhannad-hash-git-context-mcp?style=directory" alt="Git Context MCP on AllMCPs" /></a>