ai-commit-helper-mcp
Reads staged Git changes from the current repository and provides tools to generate and validate commit messages according to repository-specific commit rules and length limits.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
AI Commit Helper
A small Codex plugin that reads your staged changes and suggests three commit messages using your project's preferred format.
I built this to practise TypeScript and learn how MCP servers and Codex skills work together.
$ai-commit-helper:commit-msgIt supports messages like feat: add password reset and #234 Add password reset. Each suggestion is checked against your repository's format and length limit before you see it.
Installation
You'll need Git, Node.js, npm, and Codex CLI with plugin support. I used Node.js 26.6.0 and npm 11.18.0 during development.
Clone this repository and run these commands from its root:
npm ci
npm run build
npm link
codex plugin marketplace add .
codex plugin add ai-commit-helper@commit-helper-devTo check the installation:
codex plugin list --marketplace commit-helper-devThis installs from your local checkout. Keep that folder around, since npm link points to the built server inside it.
On macOS or Linux, if you get a permission error when starting the server, run:
chmod u+x build/mcp.jsRelated MCP server: mcp-dev-tools
Using it
Stage the changes you want to describe, then open Codex in that repository:
git add README.md
codexIn Codex, run:
$ai-commit-helper:commit-msgOn first use, it asks whether you want to save your commit rules or use the defaults. Once you've saved them, it reuses them on later runs.
For ticket messages, provide the ticket number in your request or answer when asked:
$ai-commit-helper:commit-msg Use ticket 234.For example, a staged password-reset feature might get these suggestions:
1. #234 Add password reset flow
2. #234 Support resetting forgotten passwords
3. #234 Implement password recoveryPick a message and commit it yourself. The plugin doesn't stage files, make commits, or push. If nothing is staged, it tells you and stops.
Commit rules
Rules live in .commit-helper.json at the root of the repository you're working on. You can set them up through Codex:
$ai-commit-helper:setup-commit-helperSetup asks for the format and maximum length, then creates the file. You can run it even when nothing is staged. It won't overwrite an existing configuration; edit the file yourself if you want to change it later.
You can also create the file manually:
{
"format": "ticket",
"maxSubjectLength": 100
}There are two formats for now:
Format | Example |
|
|
|
|
Messages must fit on one line. The length limit includes the prefix and spaces. Typed messages use a lowercase type with an optional scope; the validator currently doesn't support the breaking-change ! marker.
Without a configuration file, the defaults are typed and 72. If you choose defaults without saving them, you'll be asked again on a later run. Save them through setup to skip that question.
Both fields are required in a configuration file. Invalid JSON, unsupported formats, extra fields, and non-positive or non-integer length limits return an error. You can commit this file to share the same rules with your team.
How it works
The MCP server handles Git commands, configuration, and validation. The skills tell Codex when to call those tools and how to produce the suggestions. Codex generates the text, so there's no separate AI API key to configure for this server.
The server exposes three tools:
Tool | What it does |
| Returns the staged diff, effective rules, and whether those rules came from a file or the defaults. |
| Checks a message and returns any validation errors. |
| Creates |
The staged diff is sent to Codex as tool output. Unstaged changes aren't included. Validation checks format and length, so you should still review whether a suggestion accurately describes your changes.
Development
Build the TypeScript and run the validation tests:
npm run build
node --test tests/validate.test.mjsThe tests use Node's built-in test runner and import from build, so rebuild after changing TypeScript.
To try the MCP tools directly:
npx @modelcontextprotocol/inspector ai-commit-helper-mcpUse an absolute repository path in Inspector. Paths to subdirectories work too; the server finds the repository root. Try configuration creation in a test repository so you can check both creating a file and refusing to overwrite it.
If you change the plugin's skills or configuration, reinstall it from the updated checkout and open a fresh Codex session:
codex plugin remove ai-commit-helper@commit-helper-dev
codex plugin add ai-commit-helper@commit-helper-devA couple of things that caught me during development:
The server starts but prints nothing: that's expected when launched on its own. It communicates over stdio and needs an MCP client such as Codex or Inspector.
Suggestions describe old edits: check
git diff --staged. Saving a file doesn't update its staged version, and asking for suggestions doesn't clear the staging area.Codex can't find the server: run
npm linkagain and check thatai-commit-helper-mcpis on the PATH available to Codex.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
Your coding agent asks the business logic of your repository and checks commits before they land
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Related MCP Servers
- AlicenseBqualityBmaintenanceAutomatically generates conventional commit messages from staged git changes and checks repository status. Analyzes git diffs to create properly formatted commit messages following conventional commit standards.220 PyPI9MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI coding assistants with tools to run git status, recent commits, tests, and linter on a real repository.7 npmMIT
- FlicenseBqualityBmaintenanceEnables Codex to delegate coding tasks to a locally hosted Qwen model through an MCP tool, which can read, write, patch, test, and inspect git diffs inside an allowed workspace.11-
- AlicenseNot gradedqualityAmaintenanceEnables Codex users to review workspace and staged files, preview diffs, stage or unstage changes, generate AI-written Chinese Conventional Commit messages from staged diffs, and switch, merge, update, and push branches from a local panel. All Git operations run through a locally registered MCP service without a cloud deployment.MIT