Logo vun Git Commit Generator

Git Commit Generator

Communautéit
theoklitosBam7

Generate conventional commit messages from your staged git changes using Model Context Protocol (MCP)

EditeurtheoklitosBam7
Repositorymcp-git-commit-generator
SproochPython
Forks
3
Stären
8
Disponibel Tools
2
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Git Commit Generator stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 2 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    8 Stären an 3 Forks aus dem verlinkte Repository.

MCP Git Commit Generator

PyPI GitHub Release Publish Python 🐍 package to PyPI Create and Publish Docker 🐳 image License

Generate conventional commit messages from your staged git changes using Model Context Protocol (MCP).

✨ Features

  • 🤖 Automatic commit message generation based on staged git diffs
  • 📝 Conventional Commits support with auto-detection of type and scope
  • 🔄 Multiple transport options - stdio (default) and SSE for different use cases
  • 🔍 Inspector UI for interactive testing and debugging
  • 🐳 Docker support with pre-built images for easy deployment
  • ⚡ Cross-platform - works on macOS, Linux, and Windows

📦 Requirements

  • For Docker usage: Docker (for running the server in a container)
  • For PyPI/uvx usage: Python >= 3.13.5 and uv (recommended) or pip
  • Git (for version control)
  • An MCP-compatible client (VS Code with MCP extension, Claude Desktop, Cursor, Windsurf, etc.)

🚀 Installation

You can install and use the MCP Git Commit Generator in multiple ways:

Option 1: Using uvx (Recommended)

The easiest way to use the package is with uvx, which automatically manages the virtual environment:

sh
uvx mcp-git-commit-generator

Option 2: Install from PyPI

sh
pip install mcp-git-commit-generator

Or with uv:

sh
uv pip install mcp-git-commit-generator

Option 3: Using Docker

Use the pre-built Docker image from GitHub Container Registry (no installation required):

sh
docker run -i --rm --mount type=bind,src=${HOME},dst=${HOME} ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest

🛠️ Available Tools

This MCP server provides the following tools to help you generate conventional commit messages:

generate_commit_message

Generates a conventional commit message based on your staged git changes.

Parameters:

  • repo_path (string, optional): Path to the git repository. If omitted, uses the current directory.
  • commit_type (string, optional): Conventional commit type (e.g., feat, fix, docs, style, refactor, perf, build, ci, test, chore, revert). If omitted, the type will be auto-detected.
  • scope (string, optional): Scope of the change (e.g., file or module name). If omitted, the scope will be auto-detected based on changed files.

Usage:

  1. Stage your changes: git add <files>
  2. Use the tool through your MCP client to generate a commit message
  3. The tool will analyze your staged changes and generate an appropriate conventional commit message

check_git_status

Checks the current git repository status, including staged, unstaged, and untracked files.

Parameters:

  • repo_path (string, optional): Path to the git repository. If omitted, uses the current directory.

Usage:

Use this tool to get an overview of your current git repository state before generating commit messages.

🧩 MCP Client Configuration

Configure the MCP Git Commit Generator in your favorite MCP client. You have multiple options:

  1. Using uvx (recommended - automatically manages dependencies)
  2. Using Docker (no local Python installation required)
  3. Using local Python installation (for development)

VS Code

Add one of the following configurations to your VS Code mcp.json file (usually located at .vscode/mcp.json in your workspace):

Using uvx (Recommended)

jsonc
{
  "servers": {
    "mcp-git-commit-generator": {
      "command": "uvx",
      "args": ["mcp-git-commit-generator"]
    }
  }
}

Using Docker

jsonc
{
  "servers": {
    "mcp-git-commit-generator": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=${userHome},dst=${userHome}",
        "ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest"
      ]
    }
  }
}

If you want to put the configuration in your user settings.json file, you can do so by adding:

jsonc
{
  "mcp": {
    "servers": {
      "mcp-git-commit-generator": {
        "command": "uvx",
        "args": ["mcp-git-commit-generator"]
      }
    }
  }
}

Cursor

Add one of the following to your Cursor MCP configuration file (usually located at ~/.cursor/mcp.json):

Cursor with uvx (Recommended)

jsonc
{
  "mcpServers": {
    "mcp-git-commit-generator": {
      "command": "uvx",
      "args": ["mcp-git-commit-generator"]
    }
  }
}

Cursor with Docker

jsonc
{
  "mcpServers": {
    "mcp-git-commit-generator": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=${userHome},dst=${userHome}",
        "ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest"
      ]
    }
  }
}

Windsurf

Configure Windsurf with one of the following MCP server settings (usually located at ~/.codeium/windsurf/mcp_config.json):

Windsurf with uvx (Recommended)

jsonc
{
    "mcpServers": {
      "mcp-git-commit-generator": {
        "command": "uvx",
        "args": ["mcp-git-commit-generator"]
      }
    }
}

Windsurf with Docker

jsonc
{
    "mcpServers": {
      "mcp-git-commit-generator": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "--mount",
          "type=bind,src=${userHome},dst=${userHome}",
          "ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest"
        ]
      }
    }
}

Claude Desktop

Add one of the following to your Claude Desktop configuration file (usually located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

Claude Desktop with uvx (Recommended)

jsonc
{
  "mcpServers": {
    "mcp-git-commit-generator": {
      "command": "uvx",
      "args": ["mcp-git-commit-generator"]
    }
  }
}

Claude Desktop with Docker

jsonc
{
  "mcpServers": {
    "mcp-git-commit-generator": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=${userHome},dst=${userHome}",
        "ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest"
      ]
    }
  }
}

Note: The --mount option in Docker configurations allows the Docker container to access your home directory, enabling it to work with git repositories located anywhere in your file system. When using uvx or pip installations, this mounting is not needed as the tool runs directly on your system. Adjust the mount path if your repositories are located elsewhere when using Docker.

🚀 Quick Start Guide

  1. Install the package using one of the methods above:

    • Recommended: uvx mcp-git-commit-generator (or configure in your MCP client)
    • Alternative: pip install mcp-git-commit-generator
    • Docker: Use the configurations above with Docker
  2. Configure your MCP client using one of the configurations above

  3. Stage some changes in a git repository:

    sh
    git add <files>
  4. Use the tools through your MCP client:

    • Use check_git_status to see your current repository state
    • Use generate_commit_message to create a conventional commit message
  5. Commit your changes with the generated message


👨‍💻 Developer Guidelines

The following sections are intended for developers who want to contribute to or modify the MCP Git Commit Generator.

Local Development Setup 🛠️

If you prefer not to use Docker for development, you can run the server locally:

Requirements:

Note: The MCP CLI dependency is automatically installed via uv.lock when using uv sync.

Installation:

  1. Clone the repository:

    sh
    git clone https://github.com/theoklitosBam7/mcp-git-commit-generator.git
    cd mcp-git-commit-generator
  2. Prepare environment:

    There are two approaches to set up the environment for this project. You can choose either one based on your preference.

    Note: Reload VSCode or terminal to ensure the virtual environment python is used after creating the virtual environment.

    ApproachSteps
    Using uv (Recommended)1. Create virtual environment and install dependencies: uv sync --group dev 2. Run VSCode Command "Python: Select Interpreter" and select the python from .venv directory 3. The project is installed in editable mode automatically by uv sync.
    Using pip1. Create virtual environment: python -m venv .venv 2. Run VSCode Command "Python: Select Interpreter" and select the python from created virtual environment 3. Install dependencies: pip install -e .. 4. Install pip dev dependencies: pip install -r requirements-dev.txt.
  3. (Optional) Install Inspector dependencies:

    sh
    cd inspector
    npm install

📦 Publishing to PyPI

The project includes an automated PyPI publishing workflow (.github/workflows/pypi-publish.yml) that:

  • Triggers on: Tag pushes matching v*.*.* pattern, manual workflow dispatch, or pull requests to main
  • Builds: Python package distributions using the build package
  • Publishes: Automatically publishes to PyPI using trusted publishing (OIDC) when tags are pushed

To publish a new version:

  1. Update the version in pyproject.toml
  2. Create and push a git tag: git tag vX.Y.Z && git push origin vX.Y.Z
  3. The workflow will automatically build and publish to PyPI

🐳 Building and Running with Docker

You can build and run the MCP Git Commit Generator using Docker. The provided Dockerfile uses a multi-stage build with uv for dependency management and runs the server as a non-root user for security.

Build the Docker image

sh
docker build -t mcp-git-commit-generator .

Run the server in a container (default: stdio transport)

You can run the published image directly from GitHub Container Registry.

sh
docker run -d \
  --name mcp-git-commit-generator \
  ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest

By default, the container runs:

sh
mcp-git-commit-generator --transport stdio

If you want to use SSE transport (for Inspector UI or remote access), override the entrypoint or run manually:

sh
docker run -d \
  --name mcp-git-commit-generator \
  -p 3001:3001 \
  --entrypoint mcp-git-commit-generator \
  ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest --transport sse --host 0.0.0.0 --port 3001

The server will be available at http://localhost:3001 when using SSE.

🖥️ Running the Server Locally

To run locally (without Docker):

  1. Set up your uv or Python environment as described in the Local Development Setup section.
  2. From the project root, run:
sh
# Run with uv (uses uv.lock for consistent dependencies)
uv run mcp-git-commit-generator

# Or with SSE transport
uv run mcp-git-commit-generator --transport sse
sh
uv run -m mcp_git_commit_generator --transport sse
sh
# Default stdio transport
mcp-git-commit-generator

# With SSE transport
mcp-git-commit-generator --transport sse
sh
python -m mcp_git_commit_generator --transport sse

You can specify other options, for example:

sh
python -m mcp_git_commit_generator --transport sse --host 0.0.0.0 --port 3001 -v

The server listens on 0.0.0.0:3001 by default when using SSE, or as specified by the options above.

Note:

  • If you want to use the CLI entrypoint, ensure the package is installed and your environment is activated.
  • Do not use positional arguments (e.g., python -m mcp_git_commit_generator sse); always use options like --transport sse.
  • Available arguments with their values are:
    • --transport: Transport type (e.g., stdio (default), sse).
    • --host: Host to bind the server (default: 0.0.0.0).
    • --port: Port to bind the server (default: 3001).
    • -v, --verbose: Verbosity level (e.g., -v, -vv).

🔎 Start the Inspector UI

From the inspector directory:

sh
npm run dev:inspector

The Inspector UI will be available at http://localhost:5173.

🧪 Running Tests

The project includes comprehensive unit tests to ensure reliability:

sh
# Run all tests (recommended when using uv)
uv run pytest

# Or using pytest directly
pytest

# Run tests with verbose output
uv run pytest -v

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

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

Test Coverage:

  • ✅ Tool validation with invalid repository paths
  • ✅ Staged and unstaged change detection
  • ✅ Git status reporting
  • ✅ Commit message generation workflows
  • ✅ Error handling for git command failures

🗂️ Project Structure

sh
.
├── .github/                # GitHub workflows and issue templates
├── .gitignore
├── .markdownlint.jsonc
├── .python-version
├── .vscode/                # VSCode configuration
├── LICENSE
├── README.md
├── pyproject.toml          # Python project configuration
├── requirements-dev.txt    # Development dependencies (for pip users)
├── uv.lock                 # Dependency lock file for reproducible builds (used by uv sync)
├── Dockerfile              # Docker build file
├── build/                  # Build artifacts
├── src/                    # Python source code
│   └── mcp_git_commit_generator/
│       ├── __init__.py     # Main entry point
│       ├── __main__.py     # CLI entry point
│       └── server.py       # Main server implementation
└── inspector/              # Inspector related files
    ├── package.json        # Node.js dependencies
    └── package-lock.json

⚙️ Advanced MCP Server Configuration for Development

The .vscode/mcp.json file configures how VS Code and related tools connect to your MCP Git Commit Generator server. This file defines available server transports and their connection details, making it easy to switch between different modes (stdio is default, SSE is optional) for development and debugging.

Example Development mcp.json

jsonc
{
  "servers": {
    "mcp-git-commit-generator": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=${userHome},dst=${userHome}",
        "ghcr.io/theoklitosbam7/mcp-git-commit-generator:latest"
      ]
    },
    "sse-mcp-git-commit-generator": {
      "type": "sse",
      "url": "http://localhost:3001/sse"
    },
    "stdio-mcp-git-commit-generator": {
      "type": "stdio",
      "command": "${command:python.interpreterPath}",
      "args": ["-m", "mcp_git_commit_generator", "--transport", "stdio"]
    },
    "uvx-mcp-git-commit-generator": {
      "command": "uvx",
      "args": ["mcp-git-commit-generator"]
    }
  }
}
  • mcp-git-commit-generator: Runs the server in a Docker container (default: stdio transport), using the published image.
  • sse-mcp-git-commit-generator: Connects to the MCP server using Server-Sent Events (SSE) at http://localhost:3001/sse. Only useful if you run the server with --transport sse.
  • stdio-mcp-git-commit-generator: Connects using standard input/output (stdio), running the server as a subprocess. This is the default and recommended for local development and debugging.
  • uvx-mcp-git-commit-generator: Uses uvx to automatically install and run the package from PyPI.

🐞 Debugging the MCP Server

Notes:

  • MCP Inspector is a visual developer tool for testing and debugging MCP servers.
  • All debugging modes support breakpoints, so you can add breakpoints to the tool implementation code.
  • You can test tool arguments directly in the Inspector UI: When using the Inspector, select a tool and provide arguments in the input fields to simulate real usage and debug argument handling.
Debug ModeDescriptionSteps to debug
MCP InspectorDebug the MCP server using the MCP Inspector.1. Install Node.js 2. Set up Inspector: cd inspector && npm install 3. Open VS Code Debug panel. Select Debug in Inspector (Edge) or Debug in Inspector (Chrome). Press F5 to start debugging. 4. When MCP Inspector launches in the browser, click the Connect button to connect this MCP server. 5. Then you can List Tools, select a tool, input parameters (see arguments above), and Run Tool to debug your server code.

⚙️ Default Ports and Customizations

Debug ModePortsDefinitionsCustomizationsNote
MCP Inspector3001 (Server, SSE only); 5173 and 3000 (Inspector)tasks.jsonEdit launch.json, tasks.json, __init__.py, mcp.json to change above ports.N/A

💬 Feedback

If you have any feedback or suggestions, please open an issue on the MCP Git Commit Generator GitHub repository

📖 Troubleshooting

Common Issues

  • "Path is not a valid git repository": Ensure you're in a directory with a .git folder
  • "No staged changes found": Run git add <files> to stage your changes first
  • "Git is not installed": Install Git from git-scm.com
  • Docker permission issues: Ensure Docker can access your home directory
  • MCP connection fails: Verify your client configuration matches the examples above

Getting Help

  • Check the Issues page for solutions
  • Use the Inspector UI for interactive debugging
  • Run uv run pytest -v to verify your installation (recommended)
  • Or run pytest -v if using pip

📄 License

MIT License © 2025 Theoklitos Bampouris

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "mcp-git-commit-generator": {
      "command": "uvx",
      "args": [
        "mcp-git-commit-generator"
      ]
    }
  }
}

Disponibel Tools

  • generate_commit_message

    Prepare a structured analysis and instruction block for generating a Conventional Commit message from staged git changes only.

    Behavior: - Validates the repository path and operates on the provided repo or CWD. - Collects staged diff, porcelain status, and a name-status summary. - Incorporates optional user preferences for commit_type and scope. - Returns a single formatted string that includes context plus strict output instructions for an LLM to produce a Conventional Commit.

    Args: repo_path: Optional path to the target git repository. If not provided, uses the current working directory. commit_type: Optional commit type (feat, fix, docs, style, refactor, perf, build, ci, test, chore, revert) scope: Optional scope of the change

    Returns: A formatted prompt containing git change context and clear output rules for generating a Conventional Commit message

  • check_git_status

    Check the current git repository status.

    Args: repo_path: Optional path to the target git repository. If not provided, uses the current working directory.

    Returns: Current git status including staged, unstaged, and untracked files

Git Commit Generator MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Git Commit Generator verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Git Commit Generator als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Git Commit Generator an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "git-commit-generator": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-git-commit-generator"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Git Commit Generator. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Git Commit Generator.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Git Commit Generator?
Git Commit Generator
Jo. Ech hunn et gelies.
Dat hunn ech mat Git Commit Generator fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Git Commit Generator benotzt?

Git Commit Generator ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Git Commit Generator MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Git Commit Generator mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Git Commit Generator MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Git Commit Generator verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Git Commit Generator MCP mat TypingMind?

Git Commit Generator leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Git Commit Generator MCP an TypingMind zur Verfügung?

Git Commit Generator stellt 2 MCP-Tools zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Git Commit Generator MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Git Commit Generator eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇