Skip to main content
Glama
rafim-dev

Smart Git MCP Server & CLI

โšก Smart Git MCP Server & CLI

License: MIT MCP Protocol Node.js Platform

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.


Related MCP server: Git Commit MCP Server

๐Ÿš€ Quick Setup (MCP Stdio)

1. Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "smart-git": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/mcp-smart-git/dist/index.js"]
    }
  }
}

2. Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "smart-git": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/mcp-smart-git/dist/index.js"]
    }
  }
}

๐Ÿ› ๏ธ 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:

# Clone & install dependencies
git clone https://github.com/rafim-dev/mcp-smart-git.git
cd mcp-smart-git
npm install
npm run build

# Generate conventional commit from current diff
node dist/index.js commit

# Run pre-PR secret audit & security score
node dist/index.js review

# Synthesize conflict resolution
node dist/index.js conflicts

# Generate release changelog
node dist/index.js changelog

(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):

npm test

๐Ÿ“ฆ Pro Distribution & Power Bundle


๐Ÿ“„ License

MIT License. Authored by rafim_dev.

Available Tools

5 tools
git_release_changelogA

Generate structured GitHub/GitLab release notes and changelog markdown categorized by features, fixes, and breaking changes.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoTarget repository directory path
toRefNoEnding git tag or commit hash (default: HEAD)
fromRefNoStarting git tag or commit hash
maxCommitsNoMaximum number of recent commits to analyze (default: 25)

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It states it 'generates' notes, implying a read-only operation, but does not explicitly clarify side effects (e.g., no modifications to the repo). This is adequate but not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, succinct sentence with no redundant words. It directly conveys the core purpose and output format without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of an output schema and annotations, the description provides sufficient context about what the tool produces (structured markdown categorized by type). It could mention dependencies on commit message conventions, but overall it is complete enough for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters have descriptions in the schema, including defaults for toRef and maxCommits. The descriptions are clear enough for usage, though they do not add extra context beyond what the names and default values imply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'generate' and clearly identifies the resource (release notes/changelog). It distinguishes the tool from siblings like git_status and git_review_diff, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives or mention any preconditions (e.g., requiring a git repository). It only describes the action without guidance on selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

git_resolve_conflictsA

Scan the repository for merge conflict markers (<<<<<<< HEAD) and provide synthesized resolution options.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoTarget repository directory path

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It says 'scan' and 'provide ... options', which suggests a non-mutating read operation, but it does not explicitly state that no files are modified, whether staging is affected, or what happens if no conflicts are found.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately communicates the purpose and outcome. There is no filler or repetitive content; every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the one parameter is well-covered by the schema, but with no output schema and no annotations, the description does not explain the form of the resolution options, behavior when no conflicts are found, or whether the tool changes the repository. It gives a general sense but not full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single 'cwd' parameter, which is already described as 'Target repository directory path'. The description itself adds no extra meaning, but with full schema coverage, a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action ('Scan the repository'), a specific target ('merge conflict markers') and what it produces ('synthesized resolution options'). It is readily distinguishable from sibling tools like git_status, git_smart_commit, git_review_diff, and git_release_changelog.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when merge conflict markers exist, but it does not explicitly state when to use it versus alternatives, nor does it mention any prerequisites or when not to use it. The context is adequate but purely implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

git_review_diffA

Perform an automated AI code review on git diff. Scans for security leaks, dangerous calls, code smells, and missing tests.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoTarget repository directory path
stagedOnlyNoAnalyze only staged changes.
targetBranchNoBase branch to compare against (e.g. 'main' or 'origin/main'). If omitted, reviews local uncommitted changes.

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description must carry the full burden of behavioral transparency. It describes the core action (review and scan) but does not disclose potential side effects such as whether it modifies files, requires network access, or creates any artifacts. The read-only nature is assumed but not stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of two sentences that efficiently convey the tool's purpose and scope. It avoids redundancy or unnecessary detail, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with three parameters and no output schema, the description provides sufficient context for an agent to understand what it does and when to use it. It could mention the format of the review output (e.g., a report or comments), but this is not essential given the lack of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides thorough descriptions for all three parameters (cwd, stagedOnly, targetBranch), covering their meanings and default behaviors. The tool description adds no additional parameter semantics beyond that, so it earns the baseline score for full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Perform an automated AI code review on git diff.' It identifies the specific resource (git diff) and the types of issues it scans for (security leaks, dangerous calls, code smells, missing tests). This distinguishes it from sibling tools like git_status or git_smart_commit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for reviewing changes, but it does not explicitly state when to use it versus alternatives. Since sibling tools have clearly different purposes (status, commit, resolve, changelog), the usage context is somewhat implied, but no direct guidance or exclusion is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

git_smart_commitA

Analyze staged or current git diff to generate a standard Conventional Commit message with scope, rationale, and breaking change warnings.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoTarget repository directory path
stagedOnlyNoIf true, only analyze staged changes; otherwise analyzes all working directory diffs.

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description alone carries the behavioral burden. It discloses the core analysis-to-generation flow and the staged/current distinction via 'staged or current git diff.' However, given the tool is named 'commit,' it never explicitly states it does NOT create or mutate a commit โ€” an agent could wrongly expect repo writes. The verb 'generate' implies non-mutation but leaves the safety profile ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with zero filler, front-loaded with the action verb and resource, and the output details packed efficiently at the end. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must convey what is returned โ€” it does say a 'message' is generated, which covers that. But it leaves gaps: no clarity on whether the tool mutates the repo, no detail on the message's format/surface, and no statement of prerequisites (e.g., an existing commit history for generating scope). Adequate for a 2-param tool, but the mutation ambiguity is a real omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%: cwd is 'Target repository directory path' and stagedOnly is fully explained with conditional behavior. The description adds only marginal value by echoing 'staged or current,' which maps to stagedOnly. With the schema doing the heavy lifting, baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Analyze), resource (git diff), and concrete output (Conventional Commit message with scope, rationale, breaking change warnings). This clearly differentiates it from siblings: git_status reports state, git_review_diff reviews diffs, git_resolve_conflicts resolves conflicts, git_release_changelog produces changelogs. An agent can distinguish it without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use (generate a commit message from a diff) is implied strongly by the purpose statement, but there is no explicit guidance on when NOT to use it or which sibling to prefer. For instance, it never says 'use git_review_diff when you want analysis rather than a message.' The usage window is inferable, not stated โ€” acceptable but not excellent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

git_statusA

Get structured status of current repository including staged, unstaged, untracked files and active branch.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoTarget repository directory path (defaults to current working directory)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations (e.g., readOnlyHint or destructiveHint) to disclose behavior. The description is neutral and does not explicitly state that the operation is non-mutating or that it does not have side effects. While 'status' implies a read-only operation, the description alone does not fully disclose behavioral traits beyond what is obvious from the tool name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states what the tool does without any redundant phrasing or unrelated details. It is well-structured and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional parameter, no output schema), the description is sufficiently complete. It names the input (cwd) and the output characteristics (structured status including staged, unstaged, untracked files, and active branch). There is no missing context that would prevent an agent from using the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter, cwd, is clearly described as 'Target repository directory path' with a default behavior ('defaults to current working directory'). This fully explains its purpose and expected value, providing complete semantic meaning without ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Get) and the resource (status of current repository), and specifies the included details (staged, unstaged, untracked files and active branch). This makes the tool's purpose unambiguous and distinct from the sibling tools (e.g., git_smart_commit, git_review_diff), which have different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus alternatives. For example, it does not mention that this tool should be used for read-only status checks or that other tools are for commits or diffs. This lack of explicit usage context leaves the agent to infer the appropriate conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedgit_release_changelog
    • First observedgit_resolve_conflicts
    • First observedgit_review_diff
    • First observedgit_smart_commit
    • First observedgit_status

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: status, commit generation, review, conflict resolution, and changelog generation. No overlapping functionality or ambiguity between tool names.

Naming Consistency4/5

All tools share the git_ prefix, but naming patterns mix noun-style (git_status) and verb-style (git_smart_commit, git_review_diff). Consistent enough, with minor variation in the second component.

Tool Count5/5

Five tools is a well-scoped set for a Git-focused MCP server, covering distinct high-value operations without redundancy or bloat.

Completeness4/5

The toolset covers core Git workflow needsโ€”status, commit, review, conflict resolution, and changelog generation. It lacks explicit staging/diffing commands, but the focus on AI-assisted Git operations makes the coverage appropriate.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to perform full Git operations including branching, committing, pushing, stashing, rebasing, and more, with safety features and support for advanced workflows like Git Flow and LFS.
    115
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rafim-dev/mcp-smart-git'

If you have feedback or need assistance with the MCP directory API, please join our Discord server