Skip to main content
Glama
Commit Helper MCP

Commit Helper MCP

by jolfr

Commit Helper MCP

A Model Context Protocol (MCP) server that provides Commitizen functionality through MCP tools and resources, enabling AI assistants to generate, validate, and work with conventional commit messages.

Features

Core Functionality

  • Generate Commit Messages: Create conventional commit messages with validation

  • Validate Messages: Check existing commit messages against Commitizen rules

  • Interactive Questions: Get commit questions for guided message creation

  • Commit Types: Access available commit types and their descriptions

  • Configuration Access: View current Commitizen configuration and schema

  • Plugin Support: Works with any Commitizen plugin (conventional commits, custom plugins)

  • Health Monitoring: Built-in health checks and configuration refresh

🚀 Enhanced Git Integration with GitPython

Commit Helper MCP now supports GitPython for enhanced git operations:

  • Repository Health Analysis: Comprehensive repository metrics and scoring

  • Smart Commit Suggestions: AI-powered commit message suggestions based on file patterns

  • Detailed Diff Analysis: Line-by-line change analysis with statistics

  • Branch Management: Comprehensive branch and remote analysis

  • Performance Improvements: 2x faster operations, thread-safe execution

  • Advanced Git Operations: Enhanced commit previews, repository analytics, and batch operations

📦 GitPython Installation

# GitPython is automatically installed
uv sync

# Or install manually
uv add "GitPython>=3.1.40"

🔄 Automatic Fallback

The system automatically selects the best available implementation:

  • GitPython (preferred): Enhanced features and performance

  • commitizen.git (fallback): Basic functionality, full compatibility

📊 Feature Comparison

Feature

Basic

Enhanced (GitPython)

Repository status

✅

✅ Rich metadata

Commit preview

✅

✅ Diff analysis

Smart suggestions

❌

✅ AI-powered

Repository health

❌

✅ Comprehensive

Performance

Standard

2x faster

See GitPython Integration Guide for complete documentation.

Related MCP server: MCP Toolkit

Installation

Prerequisites

  • Python 3.13 or higher

  • uv package manager

  • Git repository (for Commitizen configuration detection)

Install from Source

  1. Clone the repository:

git clone <repository-url>
cd commit-helper-mcp
  1. Install dependencies:

uv sync
  1. Install the package:

uv pip install -e .

Usage

MCP Inspector (Development & Testing)

Use the MCP Inspector to test and explore the server's capabilities:

uv run mcp dev main.py

This will start an interactive session where you can:

  • Test all available tools

  • Explore resources

  • Debug server functionality

  • View tool schemas and documentation

Claude Desktop Integration

To use with Claude Desktop, install the server:

uv run mcp install main.py

This will add the server to your Claude Desktop configuration, making the tools available in your conversations.

Manual Configuration

Add to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "commit-helper-mcp": {
      "command": "uv",
      "args": ["run", "python", "/path/to/commit-helper-mcp/main.py"],
      "cwd": "/path/to/commit-helper-mcp"
    }
  }
}

Available Tools

generate_commit_message

Generate a commit message with validation using provided parameters.

Parameters:

  • type (required): Commit type (e.g., 'feat', 'fix', 'docs')

  • subject (required): Commit subject/description

  • body (optional): Detailed description

  • scope (optional): Scope of the change

  • breaking (optional): Whether this is a breaking change

  • footer (optional): Footer (e.g., issue references)

Example:

generate_commit_message(
    type="feat",
    subject="add user authentication",
    scope="auth",
    body="Implement JWT-based authentication system with login and logout functionality"
)

create_commit_message

Generate a commit message from a complete answers dictionary.

Parameters:

  • answers_dict: Dictionary containing all answers to commit questions

Example:

create_commit_message({
    "type": "fix",
    "subject": "resolve memory leak in data processing",
    "body": "Fixed memory leak caused by unclosed file handles",
    "scope": "core"
})

validate_commit_message

Validate an existing commit message against current plugin rules.

Parameters:

  • message: The commit message to validate

Example:

validate_commit_message("feat(auth): add user login functionality")

get_commit_types

Get list of available commit types from the current plugin.

Returns: List of commit types with descriptions

get_commit_questions

Get interactive questions for commit message generation.

Returns: List of questions that can be used to build commit messages

health_check

Check the health and status of the Commitizen service.

Returns: Service health information and configuration details

refresh_configuration

Refresh the Commitizen configuration and reinitialize the service.

Returns: Status of configuration refresh

Available Resources

commitizen://config

Current Commitizen configuration including:

  • Active plugin information

  • Configuration settings

  • Available capabilities

  • Message pattern

commitizen://schema

Commit message schema showing:

  • Required fields

  • Field types and constraints

  • Validation rules

commitizen://example

Example commit message demonstrating the expected format for the current plugin configuration.

Configuration

The server automatically detects and uses your project's Commitizen configuration from:

  • pyproject.toml (recommended)

  • .cz.toml

  • .cz.json

  • setup.cfg

Example Configuration

Add to your pyproject.toml:

[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version_provider = "pep621"
update_changelog_on_bump = true

Supported Commitizen Plugins

The server works with any Commitizen plugin, including:

  • cz_conventional_commits (default): Standard conventional commits

  • cz_jira: Jira integration

  • cz_customize: Custom commit formats

  • Third-party plugins: Any plugin following Commitizen's plugin interface

Troubleshooting

Server Won't Start

  1. Check Python version: Ensure Python 3.13+ is installed

  2. Verify dependencies: Run uv sync to install dependencies

  3. Check Commitizen config: Ensure valid Commitizen configuration exists

  4. View logs: Check console output for specific error messages

Invalid Commit Messages

  1. Check plugin: Verify correct Commitizen plugin is configured

  2. Validate config: Use health_check tool to verify configuration

  3. Refresh config: Use refresh_configuration tool after config changes

  4. Check pattern: View commitizen://config resource for expected pattern

MCP Connection Issues

  1. Verify installation: Ensure server is properly installed

  2. Check paths: Verify file paths in Claude Desktop configuration

  3. Test with inspector: Use uv run mcp dev main.py to test locally

  4. Restart Claude: Restart Claude Desktop after configuration changes

Common Error Messages

  • "No Commitizen configuration found": Add Commitizen config to your project

  • "Plugin not found": Install the specified Commitizen plugin

  • "Invalid message format": Check message against plugin's expected pattern

  • "Service initialization failed": Check Python environment and dependencies

Development

Running Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/commit_helper_mcp

# Run specific test file
uv run pytest tests/test_integration.py

Code Formatting

# Format code
uv run black src/ tests/

# Check formatting
uv run black --check src/ tests/

# Lint code
uv run ruff check src/ tests/

Local Development Server

# Run server directly
python main.py

# Run with MCP inspector
uv run mcp dev main.py

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests for new functionality

  5. Ensure all tests pass

  6. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

  1. Check the troubleshooting section above

  2. Search existing issues in the repository

  3. Create a new issue with detailed information about your problem

Changelog

See CHANGELOG.md for version history and changes.

Available Tools

21 tools
analyze_repository_healthC

Comprehensive repository health analysis using GitPython features.

Provides detailed analysis including:

  • Repository statistics and metrics

  • Commit frequency analysis

  • Branch and tag information

  • File change patterns

  • Author contribution analysis

Args: repo_path: Path to git repository

Returns: Dict containing comprehensive repository analysis

Inputs: repo_path (required). Returns: result

batch_commit_analysisC

Analyze multiple file groups for batch commit operations.

Helps organize staged changes into logical commit groups with appropriate commit messages for each group.

Args: repo_path: Path to git repository file_groups: List of file groups with metadata generate_messages: Whether to generate commit messages for each group

Returns: Dict containing batch commit analysis and suggestions

Inputs: repo_path (required), file_groups (required), generate_messages. Returns: result

commit_workflow_stepC

Multi-step commit workflow with state management.

Args: workflow_data: Workflow state data step: Current step ("generate" | "preview" | "approve" | "execute")

Returns: Dict with workflow state and next step information

Inputs: workflow_data (required), step. Returns: result

create_commit_messageC

Generate a commit message from a complete answers dictionary.

Args: answers_dict: Dictionary containing all answers to commit questions

Returns: Dict containing the generated message and validation status

Inputs: answers_dict (required). Returns: result

execute_git_commitA

Execute actual git commit with safety checks and user approval.

SAFETY: Requires force_execute=True to perform actual commit.

Args: message: Commit message to use repo_path: Path to git repository stage_all: Whether to stage all changes before commit (not implemented yet) sign_off: Whether to add sign-off to commit (default: True) force_execute: Must be True to execute actual commit (safety flag)

Returns: Dict containing: - success: Whether commit was successful - message: The commit message used - executed: Whether commit was actually executed - error: Error message (if failed) - dry_run: False if actually executed, True if preview only

Inputs: message (required), repo_path (required), stage_all, sign_off, +1 more. Returns: result

generate_and_commitA

Generate commit message and optionally execute commit in one step.

Combines message generation with git operations for streamlined workflow.

Args: type: Commit type (feat, fix, docs, etc.) subject: Commit subject/description repo_path: Path to git repository body: Optional detailed description scope: Optional scope of changes breaking: Whether this is a breaking change footer: Optional footer (e.g., issue references) stage_all: Whether to stage all changes (not implemented yet) sign_off: Whether to add sign-off to commit (default: True) preview_only: If True, only preview (default for safety)

Returns: Dict containing: - message: Generated commit message - is_valid: Whether message is valid - git_preview: Preview of git operation (if preview_only=True) - commit_result: Commit execution result (if preview_only=False)

Inputs: type (required), subject (required), repo_path (required), body, +6 more. Returns: result

generate_commit_messageB

Generate a commit message with validation using provided parameters.

Args: type: The commit type (e.g., 'feat', 'fix', 'docs') subject: The commit subject/description body: Optional commit body with detailed description scope: Optional scope of the change breaking: Whether this is a breaking change footer: Optional footer (e.g., issue references) include_git_preview: Whether to include git preview in response

Returns: Dict containing the generated message and validation status

Inputs: type (required), subject (required), body, scope, +3 more. Returns: result

get_branch_analysisB

Get comprehensive branch analysis using GitPython.

Provides information about:

  • All local and remote branches

  • Branch relationships and merging status

  • Commit counts per branch

  • Last activity per branch

Args: repo_path: Path to git repository

Returns: Dict containing branch analysis

Inputs: repo_path (required). Returns: result

get_commit_questionsC

Get interactive questions for commit message generation.

Returns: Dict containing the questions and metadata

Inputs: no named parameters. Returns: result

get_commit_typesB

Get list of available commit types from the current plugin.

Returns: Dict containing available commit types and their descriptions

Inputs: no named parameters. Returns: result

get_detailed_diff_analysisA

Get detailed diff analysis between working directory and specified commit.

Uses GitPython to provide:

  • File-by-file change analysis

  • Line-level insertion/deletion counts

  • Change type classification (added, modified, deleted, renamed)

  • Binary file detection

  • Optional diff content inclusion

Args: repo_path: Path to git repository compare_with: Commit/branch to compare with (default: HEAD) include_content: Whether to include actual diff content

Returns: Dict containing detailed diff analysis

Inputs: repo_path (required), compare_with, include_content. Returns: result

get_enhanced_git_statusB

Get enhanced git repository status with detailed information.

Uses GitPython features when available for richer information:

  • Detailed file status (staged, unstaged, untracked)

  • Recent commit history with statistics

  • Repository analytics (total commits, branches, tags)

  • Current branch and HEAD information

Args: repo_path: Path to git repository

Returns: Dict containing enhanced repository status

Inputs: repo_path (required). Returns: result

get_git_implementation_infoA

Get information about the current git implementation and available features.

Returns: Dict containing: - git_enabled: Whether git operations are available - implementation: Current git implementation ("GitPython") - enhanced_features: Whether enhanced features are available - features: Dict of available feature flags

Inputs: no named parameters. Returns: result

get_git_statusB

Get current git repository status and staged files.

Args: repo_path: Path to git repository

Returns: Dict containing: - git_enabled: Whether git operations are available - staged_files: List of staged file paths - staged_count: Number of staged files - repository_path: Path to git repository - repository_status: Additional status information

Inputs: repo_path (required). Returns: result

health_checkB

Check the health and status of the Commitizen service.

Returns: Dict containing service health information

Inputs: no named parameters. Returns: result

preview_git_commitA

Preview git commit operation without executing (dry-run mode).

Args: message: Commit message to preview repo_path: Path to git repository stage_all: Whether to stage all changes before commit (not implemented yet) sign_off: Whether to add sign-off to commit (default: True)

Returns: Dict containing: - message: The commit message - is_valid: Whether message passes validation - files_to_commit: List of files that would be committed - dry_run: Always True for this tool - repository_status: Current repository state

Inputs: message (required), repo_path (required), stage_all, sign_off. Returns: result

refresh_configurationB

Refresh the Commitizen configuration and reinitialize the service.

Returns: Dict containing refresh status and new configuration info

Inputs: no named parameters. Returns: result

smart_commit_suggestionB

Intelligent commit message suggestions based on repository changes.

Uses GitPython to analyze staged changes and suggest:

  • Appropriate commit type based on file patterns

  • Scope based on affected directories/modules

  • Subject line based on change patterns

Args: repo_path: Path to git repository analyze_changes: Whether to analyze file changes for suggestions suggest_type: Whether to suggest commit type suggest_scope: Whether to suggest scope

Returns: Dict containing intelligent commit suggestions

Inputs: repo_path (required), analyze_changes, suggest_type, suggest_scope. Returns: result

stage_files_and_commitA

Stage specific files and commit with provided message.

Useful for selective commits of specific files.

Args: files: List of file paths to stage message: Commit message to use repo_path: Path to git repository sign_off: Whether to add sign-off to commit (default: True) dry_run: Preview only (default True for safety)

Returns: Dict containing staging and commit results

Inputs: files (required), message (required), repo_path (required), sign_off, +1 more. Returns: result

validate_commit_messageC

Validate an existing commit message against the current plugin's rules.

Args: message: The commit message to validate

Returns: Dict containing validation result and details

Inputs: message (required). Returns: result

validate_commit_readinessB

Comprehensive validation of repository readiness for commit.

Args: repo_path: Path to git repository

Returns: Dict containing: - ready_to_commit: Boolean overall readiness - checks: Dict of individual validation checks - recommendations: List of actions to take before commit

Inputs: repo_path (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 21 tools

    Disambiguation2/5

    Multiple tools have overlapping purposes that could cause confusion. For example, generate_commit_message and create_commit_message both generate commit messages with similar parameters, while get_git_status and get_enhanced_git_status provide overlapping repository status information. Tools like commit_workflow_step, generate_and_commit, and stage_files_and_commit all handle commit execution workflows with unclear boundaries between them.

    Naming Consistency4/5

    Most tools follow a consistent snake_case verb_noun pattern (e.g., analyze_repository_health, get_branch_analysis, validate_commit_message). There are minor deviations like commit_workflow_step (which mixes verb_noun_step) and health_check (which uses verb_noun without underscore), but overall the naming is predictable and readable.

    Tool Count2/5

    With 21 tools, this server feels overloaded for a commit helper domain. Many tools could be consolidated (e.g., the multiple commit message generators and status checkers). The high count creates cognitive overhead without clear justification for each tool's distinct existence in the workflow.

    Completeness5/5

    The tool surface provides comprehensive coverage of the commit workflow domain. It includes analysis tools (repository health, branch analysis, diff analysis), message generation and validation tools, status checking tools, configuration management, and multiple commit execution pathways. There are no obvious gaps - agents can analyze, prepare, validate, and execute commits through various workflows.

    Related MCP Connectors

    Related MCP Servers