Skip to main content
Glama
README.md
# mcp-git-insights

[![CI](https://github.com/aranshayan/mcp-git-insights/actions/workflows/ci.yml/badge.svg)](https://github.com/aranshayan/mcp-git-insights/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/@aranshayan/mcp-git-insights)](https://www.npmjs.com/package/@aranshayan/mcp-git-insights)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**Read-only Git history and code archaeology for [MCP](https://modelcontextprotocol.io) clients.** Ask "who changed this and why?", "what shipped since v1.4?", "summarise this branch" — without giving the model a shell.

- **Cannot modify anything.** Only read commands are ever run, with `--no-ext-diff --no-textconv`, no pager, no prompts, no system config.
- **Sandboxed to folders you choose.** `--root` (repeatable). Symlinks are resolved, so a link pointing outside the root is refused.
- **Injection-proof arguments.** Refs and dates cannot start with `-`; paths go after `--` and must stay inside the repo; free-text filters use the attached `--author=…` form.
- **Credentials redacted** from remote URLs.
- Uses your installed `git`. No native dependencies. Node.js 22+.

## Quick start

```json
{
  "mcpServers": {
    "git": { "command": "npx", "args": ["-y", "@aranshayan/mcp-git-insights", "--root", "/path/to/your/projects"] }
  }
}
```

Claude Code: `claude mcp add git -- npx -y @aranshayan/mcp-git-insights --root "$PWD"`

## Tools

| Tool | Description |
| --- | --- |
| `repo_summary` | Branch, HEAD, tracking, dirty file count, remotes, recent commits, top contributors. |
| `git_log` | Commits filtered by ref/range, path (with `follow`), author, dates, message text. |
| `git_show` | One commit with stats and patch (size-capped). |
| `git_diff` | Between two revisions or working tree; `stat_only` for overview. |
| `git_blame` | Per-line author/date/commit for up to 200 lines. |
| `changelog` | Release notes grouped by Conventional Commit type, breaking changes first. |

All tools are annotated `readOnlyHint`. Commit messages and file contents are untrusted input for the model.

## Tests

`npm test` builds throw-away repositories and checks every tool, option-injection attempts (`--output=…`), path traversal, symlink escape, non-repos, and the built CLI over stdio.

## License

[MIT](LICENSE)

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation4/5

Each tool maps to a distinct git inspection verb (diff, blame, log, show, changelog, repo overview), so an agent can pick correctly most of the time. Mild overlap exists: repo_summary includes recent commits and top contributors that git_log also surfaces, and changelog derives from commits that git_log can list, but descriptions make the intended split reasonably clear.

Naming Consistency4/5

Four tools follow a clean git_<operation> prefix (git_diff, git_blame, git_log, git_show), while changelog and repo_summary drop the prefix. The deviation is minor and all names remain snake_case, lowercase, and descriptive of their action.

Tool Count5/5

Six tools is tightly scoped for a read-only git insights server; each tool covers a distinct inspection need (changes, authorship, history, single commit, release notes, repo state) with no filler.

Completeness4/5

Core read-only workflows (diff, log, blame, show, changelog, repo overview) are covered and interconnected. Gaps remain around ref/file exploration: no branch or tag listing, no file tree/listing, and no staged (--cached) diff option, though agents can partially work around these via git_log and git_diff.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues