https://github.com/davidweb3-ctrl/mcp-git-enhanced
Enhanced Git MCP Server - Code review, commit analysis, and branch management
https://github.com/davidweb3-ctrl/mcp-git-enhanced
Last synced: 22 days ago
JSON representation
Enhanced Git MCP Server - Code review, commit analysis, and branch management
- Host: GitHub
- URL: https://github.com/davidweb3-ctrl/mcp-git-enhanced
- Owner: davidweb3-ctrl
- License: mit
- Created: 2026-04-19T01:55:42.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-19T03:24:28.000Z (2 months ago)
- Last Synced: 2026-04-19T03:34:49.193Z (2 months ago)
- Language: TypeScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# MCP Git Enhanced
[](https://github.com/davidweb3-ctrl/mcp-git-enhanced/actions/workflows/ci.yml)
[](LICENSE)
[](https://modelcontextprotocol.io/)
MCP Git Enhanced is a Model Context Protocol server that helps AI coding assistants inspect repository state for day-to-day open-source maintenance.
It gives maintainers structured Git context for code review, commit analysis, branch comparison, and release preparation without asking the assistant to run broad shell commands.
## Why Maintainers Use It
Open-source maintainers spend a lot of time answering the same repository questions before they can review or merge work:
- What changed in this branch?
- Which commits matter for the release notes?
- Is this branch behind the base branch?
- What is staged, unstaged, or untracked?
- Which merged or stale branches need cleanup?
This server exposes those workflows as focused MCP tools so assistants can help with PR review, issue triage, release management, and repository hygiene.
## Available Tools
| Tool | Purpose |
| --- | --- |
| `git_diff` | Analyze working tree, staged, branch, commit, or path-specific diffs. |
| `git_log` | Review commit history with filters for author, date range, branch, path, and stats. |
| `git_branch` | List branches, compare a branch to its base, or suggest cleanup candidates. |
| `git_status` | Summarize staged, unstaged, and untracked repository state. |
| `git_commit_analyze` | Inspect one commit with metadata, changed files, statistics, and diff output. |
## Installation
### From Source
```bash
git clone https://github.com/davidweb3-ctrl/mcp-git-enhanced.git
cd mcp-git-enhanced
npm install
npm run build
```
### Claude Code Configuration
Use the built server from this repository:
```json
{
"mcpServers": {
"git-enhanced": {
"command": "node",
"args": ["/absolute/path/to/mcp-git-enhanced/dist/index.js"]
}
}
}
```
### Future npm Install
The package is published as `@davidweb3-ctrl/mcp-git-enhanced`:
```bash
npm install -g @davidweb3-ctrl/mcp-git-enhanced
```
After publication, clients can use:
```json
{
"mcpServers": {
"git-enhanced": {
"command": "npx",
"args": ["@davidweb3-ctrl/mcp-git-enhanced"]
}
}
}
```
## Example Workflows
### PR Review
```text
Use git_diff to compare this branch with master and summarize the risky files.
Use git_log to list commits since the last release.
Use git_commit_analyze on the largest commit before I review it.
```
### Issue Triage
```text
Use git_log to find recent commits touching src/tools.ts.
Use git_status to check whether the local reproduction has uncommitted changes.
```
### Release Management
```text
Use git_branch compare against master to prepare release notes.
Use git_log with --stat style output to identify user-visible changes.
Use git_branch suggest_cleanup after the release branch is merged.
```
## Tool Examples
### `git_diff`
```json
{
"repoPath": "/absolute/path/to/repo",
"target": "HEAD~5",
"source": "HEAD~10",
"filePath": "src/",
"staged": false
}
```
### `git_log`
```json
{
"repoPath": "/absolute/path/to/repo",
"maxCount": 20,
"author": "Maintainer Name",
"since": "1 week ago",
"stat": true
}
```
### `git_branch`
```json
{
"repoPath": "/absolute/path/to/repo",
"action": "list",
"includeRemote": true
}
```
```json
{
"repoPath": "/absolute/path/to/repo",
"action": "compare",
"branchName": "feature/pr-review-summary",
"baseBranch": "master"
}
```
### `git_status`
```json
{
"repoPath": "/absolute/path/to/repo",
"short": false
}
```
### `git_commit_analyze`
```json
{
"repoPath": "/absolute/path/to/repo",
"commitHash": "abc123"
}
```
## Security Model
MCP Git Enhanced is designed as a read-oriented repository inspection server.
- It runs fixed `git` subcommands through `spawnSync` without shell interpolation.
- It does not expose destructive branch deletion, reset, checkout, rebase, push, or force-push tools.
- It validates that `repoPath` points to a Git repository before executing tool handlers.
- It is intended for local repositories controlled by the user or maintainer.
See [SECURITY.md](SECURITY.md) for reporting and supported-version details.
## Development
```bash
npm install
npm run build
npm test
npm run lint
npm run format:check
```
## Project Files
- [CONTRIBUTING.md](CONTRIBUTING.md): development setup and contribution process.
- [SECURITY.md](SECURITY.md): vulnerability reporting and trust boundaries.
- [ROADMAP.md](ROADMAP.md): planned maintainer workflows and release direction.
- [CHANGELOG.md](CHANGELOG.md): release notes.
- [docs/CODEX_FOR_OSS.md](docs/CODEX_FOR_OSS.md): Codex for Open Source maintenance plan.
## Requirements
- Node.js >= 18.0.0
- Git installed and available in `PATH`
## License
MIT