Git Commit MCP Server
A small MCP (Model Context Protocol) server that automates conventional Git commits, changelog updates, and optional pushes. Use this repository when you want an AI assistant to create well-formed Conventional Commit messages and manage the CHANGELOG automatically.
See detailed documentation in the docs/ folder:
docs/architecture.md— high-level architecture, components, and data flows.docs/usage.md— setup, configuration, and common workflows (PowerShell examples included).
Quick Start
Prerequisites
- Python 3.10+
- Git installed and configured
uvpackage manager (for development)pipx(for global installation)
Installation
Option 1: Global Installation with pipx (Recommended)
Install globally so the server is available from any directory:
# Install pipx if you don't have it
uv tool install pipx
# Install from PyPI (production)
pipx install git-commit-mcp-server
# Or install from TestPyPI (testing)
pipx install git-commit-mcp-server --index-url https://test.pypi.org/simple/ --pip-args="--extra-index-url https://pypi.org/simple/"
Option 2: Run with uvx (No Installation)
Run directly without installing:
uvx git-commit-mcp-server
Option 3: Development Mode
For local development:
# Clone the repository
git clone https://github.com/surajfale/git-mcp-server.git
cd git-mcp-server
# Install with development dependencies
uv pip install -e ".[dev]"
# Run the server
python -m git_commit_mcp.__main__
Configuration
MCP Client Setup
The server works with various MCP-compatible clients including:
- Kiro IDE —
.kiro/settings/mcp.jsonor~/.kiro/settings/mcp.json - Cursor IDE — See Cursor Configuration below
- Claude Desktop —
claude_desktop_config.json - WARP — MCP configuration file
- VSCode — With MCP extension
Example configuration (Kiro IDE):
{
"mcpServers": {
"git-commit": {
"command": "git-commit-mcp",
"args": [],
"disabled": false,
"env": {
"OPENAI_API_KEY": "sk-your-key-here",
"ENABLE_AI": "true",
"AI_MODEL": "gpt-4o-mini",
"FORCE_SSH_ONLY": "true"
},
"autoApprove": []
}
}
}
Environment Variables
Key environment variables:
OPENAI_API_KEY— Required whenENABLE_AI=truefor AI-powered commit messagesENABLE_AI— Set totrueto use AI generation (default:true)AI_MODEL— OpenAI model to use (default:gpt-4o-mini)FORCE_SSH_ONLY— Require SSH for Git operations (default:true)LOG_LEVEL— Logging level: DEBUG, INFO, WARNING, ERROR (default:INFO)
Set in PowerShell:
# Current session
$env:OPENAI_API_KEY = 'sk-your-key-here'
# Persistent (user-level)
setx OPENAI_API_KEY "sk-your-key-here"
Cursor IDE Configuration
Important: Cursor IDE has specific requirements. See the detailed Cursor setup guide in docs/usage.md.
Quick setup for Cursor:
-
Configuration file location (Windows):
%APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json -
Basic configuration:
{ "mcpServers": { "git-commit-mcp": { "command": "git-commit-mcp", "args": [], "env": { "OPENAI_API_KEY": "sk-your-key-here", "ENABLE_AI": "true" } } } }
-
For local development:
{ "mcpServers": { "git-commit-mcp": { "command": "python", "args": ["-m", "git_commit_mcp.__main__"], "cwd": "C:\\path\\to\\git_commit_message", "env": { "OPENAI_API_KEY": "sk-your-key-here" } } } }
Troubleshooting: If you encounter issues in Cursor, see the Cursor-specific troubleshooting section in docs/usage.md.
Usage
Once configured, use natural language with your AI assistant:
User: "Commit my changes"
AI: [Analyzes your git diff and generates a conventional commit message]
AI: "Created commit abc1234: feat(auth): Add user authentication module"
User: "Commit and push"
AI: [Commits and pushes to remote]
AI: "Successfully pushed to origin/main"
The server provides two main tools:
generate_commit_message— Generate a commit message without committinggit_commit_and_push— Full workflow: analyze, commit, and optionally push
Features
- AI-Powered Messages: Analyzes actual git diffs to generate accurate commit messages
- Conventional Commits: Follows the Conventional Commits specification
- Smart Type Detection: Automatically determines commit type (feat, fix, docs, etc.)
- Changelog Management: Maintains CHANGELOG.md with commit history
- Push Confirmation: Requires explicit approval before pushing
- Multi-Repository: Works with any Git repository, local or remote
Testing
Run the test suite:
# Run all tests
pytest
# Run with coverage
pytest --cov=git_commit_mcp
# Run specific tests
pytest tests/test_integration.py -v
Updating
Update to the latest version:
# Update global installation
pipx upgrade git-commit-mcp-server
# Or from TestPyPI
pipx upgrade git-commit-mcp-server --index-url https://test.pypi.org/simple/ --pip-args="--extra-index-url https://pypi.org/simple/"
Documentation
docs/usage.md— Detailed setup, configuration, troubleshooting, and best practicesdocs/architecture.md— System architecture, components, and design decisions
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
License
MIT License - see LICENSE file for details
Links
Metadata
Release files for git-commit-mcp-server 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| git_commit_mcp_server-0.1.3.tar.gz | 172.8 kB | Without provenance | Details for git_commit_mcp_server-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| git_commit_mcp_server-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for git_commit_mcp_server-0.1.3-py3-none-any.whl |
Total release size: 206.9 kB
Release files / git_commit_mcp_server-0.1.3.tar.gz
| Download URL | git_commit_mcp_server-0.1.3.tar.gz |
|---|---|
| Size | 172.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a8f0569027b62e3dfbd4ec74459261ac905f85633a6a2fc149ebe31c19ede60
|
|
BLAKE2b-256 checksum How to use checksums |
66c2b8fb8e2bbfb582f823c939a2de0a798b347629be40006e7887d6e29d2577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / git_commit_mcp_server-0.1.3-py3-none-any.whl
| Download URL | git_commit_mcp_server-0.1.3-py3-none-any.whl |
|---|---|
| Size | 34.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40275e6fac41e192e4e59e07e6e9af00b42b6fdad33a5f3c855c758bee1713c6
|
|
BLAKE2b-256 checksum How to use checksums |
28b8e989599c62d548523fef4d7d4d3ab0ac430c6ff772d3e35d3ae6b4c71635
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for git-commit-mcp-server 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.