Git History logo

Git History

Read-only Git history tools for commit search, file history, blame, contributors, and ref-to-ref diffs.

Install Git History

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": {
    "git-history": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-git-history"
      ],
      "env": {
        "GIT_REPO_PATH": "YOUR_VALUE_HERE"
      }
    }
  }
}

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

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 7 tools correctly ().

Overview

The git-history MCP server gives AI clients read-only access to a Git repository's commit and file history. It runs over MCP stdio and accepts the repository path as a command-line argument, through GIT_REPO_PATH, or from the current working directory. Available operations cover commit search, recent commits, commit diffs, file history, line blame, contributor counts, and diffs between refs. Reach for it when an agent needs to explain when, why, or by whom code changed rather than inspecting only the current checkout.

Use cases

  • Search commit messages for a bug or feature
  • Trace when and why a file changed
  • Identify the author of specific lines
  • Compare branches, tags, or commits
  • Summarize repository contributors

Key features

  • Commit message search
  • Recent commit listing
  • Commit and ref-to-ref diffs
  • File history and line blame
  • Contributor summaries
  • Read-only Git access

Tools7

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

Verified live~895 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

Recent health check succeeded.

16/16 checks healthy over the last 63d

What it can do

From the 7 tools this server returned when we ran it.

Read-only tools · 7
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age80 days
Maintainers1

Observed 2026-11-17 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · mcp-server-git-history (npm)

Adoption & maintenance

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

npm downloads249Package downloads in the last 30 days.
Last commit11d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed7Callable tools this server registers over MCP.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How Git History works

What the git-history MCP server does

The git-history MCP server exposes Git history to MCP-compatible AI clients without allowing repository changes. It is designed for questions about code evolution, such as when a file was last modified, which commit introduced a change, or who authored particular lines.

The server works with a repository supplied at startup. It reads commit and author data through Git commands and returns structured results to the calling client. Because the service only reads repository data, it does not create commits, edit files, switch branches, or otherwise mutate the checkout.

How it works

The process uses the Model Context Protocol over a stdio transport. Internally, Git operations are handled with the simple-git package, while tool inputs are validated with Zod. The documented runtime range is Node.js 18, 20, 22, or 24.

Start the package with npx, passing the repository path as an argument:

Terminal
npx -y mcp-server-git-history /path/to/your/repo

The path can instead be supplied with GIT_REPO_PATH. If neither is provided, the server uses its startup directory. No API key is required: the server reads Git data locally and does not make AI requests itself.

Setup and configuration

For Claude Desktop, add an MCP entry that runs npx -y mcp-server-git-history and passes the repository path in args, then restart the client. Cursor uses the same command and argument pattern in .cursor/mcp.json or the global Cursor MCP configuration. The README also names Windsurf as a supported client.

For local development, clone the repository, run npm install, and use npm test. The included manual test can start the server against another Git repository and exercise it through an MCP client and stdio transport.

Tools and capabilities

The git-history MCP server provides these read-only tools:

  • search_commits(query, limit?) searches commit messages for a term.
  • get_recent_commits(limit?) returns the newest commits for a recent-change overview.
  • get_commit_diff(commitHash) returns the complete diff for one commit.
  • get_file_history(filePath, limit?) shows a file's change history, including author, date, and commit information.
  • blame_file(filePath, startLine?, endLine?) identifies the commit and author associated with each selected line.
  • get_contributors(limit?) summarizes contributors and their commit counts.
  • get_diff_between_refs(fromRef, toRef, filePath?) compares two commits, branches, or tags, optionally for one file only.

Together, these operations support repository archaeology, targeted debugging, review of changes between refs, and attribution of existing code. Limits can reduce the number of returned commits or contributors, while line ranges and file paths narrow file-oriented queries.

Limitations and notes

This is a history-reading service, not a general Git administration tool. Its documented operations use read-only commands such as log, show, blame, shortlog, and diff; there are no tools for writing to the repository. Results depend on the Git repository and refs available at the configured path. The client must be able to launch an MCP server over stdio, and the repository path must resolve to the intended checkout.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

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

Frequently Asked Questions about Git History

git-history is an MCP server that connects AI clients to a local Git repository through stdio and exposes tools for searching commits, viewing recent commits and commit diffs, inspecting file history, blaming lines, listing contributors, and comparing two refs. It performs read-only Git operations.

Run it directly with npx, so a separate package installation is not required: `npx -y mcp-server-git-history /path/to/your/repo`. You can also clone the repository and run `npm install` for local development and testing.

Add an `mcpServers` entry that runs `npx` with `-y`, `mcp-server-git-history`, and the repository path as arguments, then restart Claude Desktop. Set `GIT_REPO_PATH` instead of passing the path if preferred.

Yes, git-history works with Cursor through its MCP configuration. Add the same npx command and repository path to `.cursor/mcp.json` or the global Cursor MCP file, then verify the server in Cursor's MCP settings.

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 History AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/git-history?style=directory)](https://allmcps.com/mcp/git-history)
HTML Embed
<a href="https://allmcps.com/mcp/git-history"><img src="https://allmcps.com/api/badge/git-history?style=directory" alt="Git History on AllMCPs" /></a>