Git History

io.github.tonyweckstrom1987Published by GitHub account tonyweckstrom1987v1.1.1Updated Oct 24, 2026

Give AI agents Git history tools: commit search, file history, blame, contributors, ref diffs.

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Local MCP server that lets an AI assistant read and search a Git repository's history: commits, file history, blame, contributors and diffs.

What you can do
  • Search and list commits by message keyword or recency
  • Inspect a single commit's full diff
  • Trace a file's change history and line-by-line blame
  • Summarize contributors and their commit counts
  • Compare two commits, branches or tags, optionally limited to one file
When to use it
Useful when you want an assistant to explain why a file changed, who last touched a line, or what differs between two branches or tags, instead of only seeing the current state of the code.
Requirements
Runs locally via npx with Node.js 18/20/22/24. Needs a path to a Git repository, passed as a command-line argument or via the GIT_REPO_PATH environment variable; if omitted, the server's startup directory is used. No API keys or accounts.
Before you install
Read-only: it only uses read-only Git commands and never modifies the repository. It reads whatever repository path you point it at, so avoid targeting repositories whose history you do not want exposed to the assistant. No API keys, no costs.

Installation

In SourceWeft

  1. Open Git History in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

mcp-server-git-history

[npm version] [CI] [License: MIT]

Uusin julkaistu versio: 1.1.2 — https://www.npmjs.com/package/mcp-server-git-history

MCP-palvelin (Model Context Protocol) joka antaa tekoälyagenteille (Claude Desktop, Cursor, Windsurf) työkalut Git-repositorion historian lukemiseen ja hakemiseen.

Ratkaisee ongelman jossa tekoäly näkee koodin nykytilan, mutta ei tiedä miksi jokin muuttui tai kuka teki muutoksen viimeksi.

Teknologiat: Node.js 18/20/22/24, Model Context Protocol (stdio), simple-git, zod. Lisenssi: LICENSE.

Sisältö: Quick start · Työkalut · Esimerkkivastaus · Asennus Claude Desktopiin · Asennus Cursoriin · Kehitys ja testaus · Rakenne

Quick start

An MCP server that gives AI agents (Claude Desktop, Cursor, Windsurf) tools to read and search Git history — commit search, file history, blame, contributors, and diffs between refs.

Run it directly with npx (no install needed):

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

Add it to Claude Desktop's config (claude_desktop_config.json):

json
{  "mcpServers": {    "git-history": {      "command": "npx",      "args": ["-y", "mcp-server-git-history", "/path/to/your/repo"]    }  }}

Restart Claude Desktop, then ask something like "When was src/index.js last changed, and why?"

Työkalut

  • search_commits(query, limit?) — etsii commiteja hakusanalla commit-viestistä
  • get_recent_commits(limit?) — hakee uusimmat commitit (yleiskuva viimeaikaisista muutoksista)
  • get_commit_diff(commitHash) — hakee yhden commitin koko diffin
  • get_file_history(filePath, limit?) — hakee tiedoston muutoshistorian (kuka, milloin, miksi)
  • blame_file(filePath, startLine?, endLine?) — rivikohtainen git blame: kuka ja missä commitissa kirjoitti kunkin rivin
  • get_contributors(limit?) — yhteenveto committaajista ja heidän commit-määristään (git shortlog -sn)
  • get_diff_between_refs(fromRef, toRef, filePath?) — diffi kahden commitin/branchin/tagin välillä, valinnaisesti yhteen tiedostoon rajattuna

Esimerkkikutsut

json
{ "name": "search_commits", "arguments": { "query": "login-bugi", "limit": 10 } }
json
{ "name": "get_recent_commits", "arguments": { "limit": 5 } }
json
{ "name": "get_commit_diff", "arguments": { "commitHash": "a1b2c3d" } }
json
{ "name": "get_file_history", "arguments": { "filePath": "src/index.js", "limit": 10 } }
json
{ "name": "blame_file", "arguments": { "filePath": "src/index.js", "startLine": 10, "endLine": 25 } }
json
{ "name": "get_contributors", "arguments": { "limit": 10 } }
json
{ "name": "get_diff_between_refs", "arguments": { "fromRef": "main", "toRef": "HEAD", "filePath": "src/index.js" } }

Vain luku: kaikki työkalut käyttävät ainoastaan lukevia Git-komentoja (log, show, blame, shortlog, diff). Palvelin ei koskaan muuta repositoriota.

Esimerkkivastaus

get_recent_commits palauttaa JSON-listan (todellinen tulos npm test:stä):

json
[  {    "hash": "bc3338e",    "date": "2026-10-05T14:29:43+03:00",    "author": "tonyweckstrom1987",    "message": "Upgrade GitHub Actions to latest versions"  }]

Asennus Claude Desktopiin

Lisää claude_desktop_config.json-tiedostoon:

json
{  "mcpServers": {    "git-history": {      "command": "npx",      "args": ["-y", "mcp-server-git-history", "/polku/repositorioosi"]    }  }}

Repositorion polku voidaan antaa myös GIT_REPO_PATH-ympäristömuuttujalla, tai jättää pois jolloin käytetään palvelimen käynnistyshakemistoa.

Käynnistä Claude Desktop uudelleen, ja kysy esimerkiksi: "Milloin tiedostoa src/index.js on viimeksi muokattu ja miksi?"

Asennus Cursoriin

Lisää projektin .cursor/mcp.json-tiedostoon (tai globaaliin ~/.cursor/mcp.json-tiedostoon):

json
{  "mcpServers": {    "git-history": {      "command": "npx",      "args": ["-y", "mcp-server-git-history", "/polku/repositorioosi"]    }  }}

Avaa Cursorin asetuksista MCP-välilehti ja varmista, että git-history-palvelin on käynnissä (vihreä piste). Sama GIT_REPO_PATH-ympäristömuuttuja ja komentoriviargumentti toimivat kuin Claude Desktopissa.

Kehitys ja testaus paikallisesti

bash
git clone <repo>cd mcp-server-git-historynpm installnpm test                                        # testaa tätä samaa repoanode test/manual-test.js /polku/johonkin/git-repoon   # tai jotain muuta repoa

Testiskripti käynnistää palvelimen alaprosessina ja kutsuu kaikkia työkaluja oikeaa MCP-protokollaa käyttäen (@modelcontextprotocol/sdk:n Client + StdioClientTransport), ei vain suoraan funktioita — samalla tavalla kuin Claude Desktop oikeasti kutsuisi palvelinta.

Miksi tämä on ilmainen ylläpitää

Palvelin itse ei tee tekoälykutsuja — se vain lukee Git-dataa ja palauttaa sen. Tekoäly (esim. Claude Desktop) kutsuu palvelinta, ei toisinpäin. Ei API-avaimia, ei kustannuksia.

Rakenne

  • bin/server.js — MCP-palvelin, työkalujen rekisteröinti (McpServer + StdioServerTransport)
  • lib/git-tools.js — Git-logiikka (simple-git)
  • test/manual-test.js — päästä-päähän-testi oikealla MCP-clientillä

Source: README.md at commit 0a4d78a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.1.1LatestSep 26, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts