⚡ Smart Git MCP Server & CLI
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> **Next-generation Model Context Protocol (MCP) server & CLI for Git workflows.**
> Semantic Conventional Commits, Pre-PR Secret Audits, Conflict Resolution, and Automated Release Notes for **Claude Desktop**, **Cursor**, **Command Code**, and **Cline**.
---
🌟 Why mcp-smart-git?
AI coding assistants are brilliant at writing code, but they have zero hesitation about:
1. **Accidentally staging API keys, .env tokens, or database credentials** in unified diffs.
2. **Writing lazy, chaotic commit messages** ("update stuff", "fix").
3. **Creating catastrophic merge conflicts** during branch merges.
mcp-smart-git gives your AI assistant a senior DevOps partner that analyzes git diffs safely and semantically.
---
🚀 Quick Setup (MCP Stdio)
1. Cursor (.cursor/mcp.json)
2. Claude Desktop (claude_desktop_config.json)
---
🛠️ MCP Tools Exposed
| Tool | Parameters | Description |
| :--- | :--- | :--- |
| git_smart_commit | staged_only?: boolean | Parses diffs to generate structured **Conventional Commits** (feat:, fix:, refactor:) with semantic rationale and breaking-change detection. |
| git_review_diff | staged_only?: boolean | Runs static analysis on diff lines for **secret leaks** (AWS keys, OpenAI tokens, private keys), eval() hazards, and forgotten debug logs. Generates a 0–100 security score. |
| git_resolve_conflicts | file_path?: string | Scans repository for <<<<<<< HEAD conflict markers and synthesizes clean merge recommendations. |
| git_release_changelog | since_tag?: string | Categorizes recent commit history into clean markdown release notes grouped by features, fixes, and chores. |
| git_status | - | Returns clean, token-efficient repository branch and tracking metrics. |
---
💻 Standalone Terminal CLI Usage
No MCP client required! You can also execute it directly from your terminal:
*(Tip: Run npm link inside the directory to make the mcp-smart-git command globally available anywhere in your shell).*
---
🧪 Testing & Verification
Includes a complete automated test suite (100% passing):
---
📦 Pro Distribution & Power Bundle