Pekno/mcp-commit-helper
If you are the rightful owner of mcp-commit-helper and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MCP Commit Helper is a server that assists in writing better Git commit messages using LLMs like Claude.
MCP Commit Helper
An MCP server that helps you write better Git commit messages by leveraging LLMs like Claude. It analyzes your Git diff and suggests appropriate, conventional commit messages.
MCP Integration
To use with an MCP client configuration, add this to your config:
{
"mcpServers": {
"commit-helper": {
"command": "npx",
"args": ["-y", "@pekno/mcp-commit-helper"]
}
}
}
You can also set environment variables directly in your MCP configuration:
{
"mcpServers": {
"commit-helper": {
"command": "npx",
"args": ["-y", "mcp-commit-helper"],
"env": {
"MCP_COMMIT_PROMPT": "Write a conventional commit message for these changes:\\n\\n{diff}"
}
}
}
}
Available Tools
This MCP server exposes the following tools:
initialize-project
: Initialize a Git repository pathget-git-diff
: Show the current Git diffgenerate-commit-message
: Generate a commit message based on the Git diffcreate-commit
: Create a Git commit with the provided message
Example Workflow
When talking to an LLM like Claude with MCP support, you can use commands like:
-
Initialize the project:
initialize-project at C:/path/to/your/repo
-
Generate a commit message:
generate-commit-message
-
Create the commit with the suggested message:
create-commit with message "feat: implement new feature" and addAll: true
Customization
Environment Variables (Optional)
The MCP Commit Helper works perfectly out of the box, but you can optionally customize the commit message prompt by setting environment variable:
-
MCP_COMMIT_PROMPT
(optional): Customize the conventional commit promptDefault:
Based on the following git diff, please write a commit message following the Conventional Commits format (type(scope): description). Types include: feat, fix, docs, style, refactor, test, chore, etc. Focus on being concise but descriptive, using imperative mood. Include a brief description of the changes after the header if helpful. Here's the git diff: {diff}
When customizing prompts, use these template variables:
{diff}
: Will be replaced with the actual Git diff{scope}
: Will be replaced with scope info if provided
You might want to customize these prompts to:
- Follow your team or organization's commit message conventions
- Focus on specific aspects of the code changes
- Add reminders about commit policies or standards
- Change the language or tone of the commit message
License
MIT