What rafim-dev/mcp-smart-git MCP server does
rafim-dev/mcp-smart-git MCP server connects an MCP-compatible coding assistant to a local Git repository. Its tools focus on common workflow checks: turning diffs into Conventional Commit suggestions, examining changes for exposed credentials and other hazards, identifying merge conflict markers, preparing release notes, and returning concise branch information.
The project can also run as a standalone Node.js command-line program, so an MCP client is not required for its Git operations. It is intended for macOS, Linux, and Windows systems with Node.js 18 or newer.
How it works
The server runs through MCP standard stdio. An assistant invokes a tool with an optional parameter, and the program inspects the repository’s current state or commit history. git_smart_commit accepts staged_only to limit analysis to staged changes and produces a Conventional Commit category such as feat, fix, or refactor, along with rationale and possible breaking-change information.
git_review_diff also accepts staged_only. It checks diff lines for examples of exposed AWS credentials, OpenAI tokens, private keys, eval() usage, and leftover debug logs, then returns a security score from 0 to 100. git_resolve_conflicts searches for conflict markers such as <<<<<<< HEAD and provides recommendations for resolving the affected content. It can optionally target a file path.
For release preparation, git_release_changelog groups recent commits into Markdown sections for features, fixes, and chores. Its optional since_tag parameter sets the starting tag for the history scan. git_status reports repository branch and tracking metrics.
Setup and configuration
To build rafim-dev/mcp-smart-git MCP server, clone the repository, run npm install, and then run npm run build. The resulting entry point is dist/index.js. MCP clients can launch it with the node command and an absolute path to that file.
For Cursor, add a smart-git entry to .cursor/mcp.json. For Claude Desktop, add the equivalent entry to claude_desktop_config.json. Both configurations use command: "node" and pass the built JavaScript file in the args array. The README does not specify environment variables or additional service credentials.
The command-line mode supports commit analysis, diff review, conflict scanning, and changelog generation through the commit, review, conflicts, and changelog commands. Running npm link from the project directory can make the CLI command available globally. Tests run with npm test.
Tools and capabilities
- Generate structured Conventional Commit suggestions from current diffs.
- Detect selected secrets, private keys,
eval() hazards, and debug logs in diffs.
- Assign a 0–100 security score to a diff review.
- Locate conflict markers and synthesize merge recommendations.
- Produce Markdown release notes grouped by commit type.
- Return repository branch and tracking status.
Limitations and notes
The documented checks are diff-based and pattern-oriented; the material does not claim comprehensive secret detection or general static analysis. Conflict handling produces recommendations rather than stating that files are automatically rewritten or merged. The server also does not document remote Git hosting integrations, authentication settings, or environment variables. It operates against the repository available to the local process and requires a built Node.js entry point for MCP configuration.