git-insights-mcp
A local-only MCP server that exposes git repository history, diffs, and status as tools for LLM clients, working entirely against a local git repo on disk.
README
git-insights-mcp
A local-only MCP (Model Context Protocol) server that exposes git repository history, diffs, and status as tools an LLM client (e.g. Claude Desktop) can call in natural language.
It works entirely against a local git repo on disk ā it never talks to GitHub, GitLab, or any remote API. No auth, no tokens.
Tools exposed
| Tool | Description |
|---|---|
list_recent_commits |
Recent commits (author, date, message) on a branch |
search_commits |
Search commit messages by keyword |
get_commit_diff |
Full diff + stats for one commit |
get_diff_between_branches |
Diff/summary between two branches or refs |
get_branch_status |
Current branch, ahead/behind, uncommitted changes |
list_branches |
Local (or local + remote-tracking) branches |
get_file_history |
Commit history for a specific file |
blame_file |
Line-by-line author/commit attribution (git blame) |
Safety notes:
- The server is scoped to one repo path, given at startup. The model can never point it at an arbitrary path on your machine.
- File-path parameters (
get_file_history,blame_file) are checked to make sure they resolve inside the repo ā no../../traversal. - Only read-only git operations are implemented ā nothing here can commit, push, or modify your repo.
Setup
npm install
npm run build
This compiles TypeScript from src/ into dist/.
Running it standalone (sanity check)
node dist/index.js /path/to/some/git/repo
You should see:
git-insights-mcp running (stdio) against repo: /path/to/some/git/repo
It communicates over stdio using the MCP protocol, so it won't print anything else unless a client sends it requests. Press Ctrl+C to stop.
Inspecting it with MCP Inspector (recommended first step)
The MCP Inspector lets you call tools directly through a web UI, without needing Claude Desktop:
npx @modelcontextprotocol/inspector node dist/index.js /path/to/some/git/repo
This opens a browser UI where you can see all 8 tools, fill in their parameters, and inspect raw responses.
Connecting to Claude Desktop
-
Find your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add an entry under
mcpServers(use the absolute path to this project'sdist/index.js, and the absolute path to the repo you want to inspect):
{
"mcpServers": {
"git-insights": {
"command": "node",
"args": [
"/absolute/path/to/git-insights-mcp/dist/index.js",
"/absolute/path/to/your/target/repo"
]
}
}
}
-
Restart Claude Desktop. You should see a šØ tools icon indicating the server connected, and the 8 tools available for Claude to call.
-
Try prompts like:
- "Summarize the last 10 commits on this repo"
- "Show me the diff for commit
<hash>" - "Who's touched
src/index.tsthe most recently?" - "What files changed between
mainandfeature/foo?" - "Is my working directory clean right now?"
Project structure
git-insights-mcp/
āāā src/
ā āāā index.ts # server entrypoint, tool registration, transport setup
ā āāā git.ts # repo path resolution + safety helpers
ā āāā tools/
ā āāā commits.ts # list_recent_commits, search_commits
ā āāā diff.ts # get_commit_diff, get_diff_between_branches
ā āāā status.ts # get_branch_status, list_branches
ā āāā fileHistory.ts# get_file_history, blame_file
āāā package.json
āāā tsconfig.json
āāā README.md
Ideas for extending this
- Add a
promptsentry likeweekly_summarythat pre-packages "summarize commits from the last 7 days, grouped by author" - Expose
repo://statusas an MCP resource so it's always available as context without an explicit tool call - Add a
get_pr_style_summarytool that formats a diff as a draft PR description - Add a second set of tools wrapping the GitHub API (via
@octokit/rest) for PRs/issues ā a natural "part 2" once this local version is working
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.