Allows committing staged changes to a Git repository with AI attribution by automatically appending '(aider)' to the committer's name, enabling tracking of AI contributions in codebases.
git-commit-aider MCP Server
Make git commits on behalf of AI, so that you can track AI contribution in your codebase.
This is a TypeScript-based MCP server that provides a tool to commit staged changes in a Git repository while appending "(aider)" to the committer's name.
Features
This MCP server provides only one tool:
commit_staged
- Commit staged changes with a specific message.
- Takes
message
(string, required) as the commit message. - Takes
cwd
(string, optional) to specify the working directory for the git command. - Appends "(aider)" to the committer name automatically.
- Reads committer name and email from environment variables (
GIT_COMMITTER_NAME
,GIT_COMMITTER_EMAIL
) if set, otherwise falls back togit config user.name
andgit config user.email
.
With this tool installed in your code editor, you can prompt the AI by something like:
Commit the changes for me
This usually happens after the AI has made some changes to your codebase, so often times AI is able to provide a good commit message from the context.
Installation
To use this server, add its configuration to your MCP settings file.
The committer information is retrieved from:
- Environment variables
GIT_COMMITTER_NAME
andGIT_COMMITTER_EMAIL
, which follows git's convention. - Output of
git config user.name
andgit config user.email
commands.
Alternative: amend author after commit
If you don't want to use this MCP server, you can also use the git
command directly in your terminal.
You can proceed with normal commit first, and then use the following git command to change the author of the last commit:
This will change the author of the last commit to your name with "(aider)" appended.
To simplify the process, you can set up a Git alias. Run the following command in your terminal:
Once set up, you can use the alias by running:
Calculating AI contribution
Commits with "(aider)" can be picked up by aider --stats
command, which will show you the contribution of AI in your codebase.
Alternatively, you can use the following script to calculate the contribution of AI in your codebase, measured in lines of code (added, deleted, and total changes).
Usage example:
Output Fields Description
The JSON output contains the following fields:
ai_percentage
: (Number) The percentage of total lines changed (sum of added and deleted lines) that were contributed by AI authors (identified byAI_MATCHER
).ai_changes
: (Object) An object detailing the aggregated line changes (linesadded
,deleted
, and theirtotal
) made by AI authors.human_changes
: (Object) An object detailing the aggregated line changes (linesadded
,deleted
, and theirtotal
) made by human authors.details
: (Array of Objects) Provides a detailed breakdown of changes. Each object in the array represents the contribution of a specificauthor
to a particularfileName
, including linesadded
,deleted
, and thetotal
changes for that file by that author.
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Makes git commits on behalf of AI by appending "(aider)" to the committer's name, allowing tracking of AI contributions in your codebase.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityThe Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.Last updated -21554TypeScript
- AsecurityAlicenseAqualityEnables AI assistants to interact with GitHub through the PyGithub library, providing tools for managing issues, repositories, pull requests, and other GitHub operations with intelligent parameter handling and error management.Last updated -19PythonMIT License
- AsecurityFlicenseAqualityAn MCP server that enables AI assistants to manage GitHub Actions workflows by providing tools for listing, viewing, triggering, canceling, and rerunning workflows through the GitHub API.Last updated -928TypeScript
- AsecurityAlicenseAqualityEnables AI models to access GitHub repository contents as context, with features to fetch entire repositories, specific file contents, and repository structures for use in AI interactions.Last updated -32JavaScriptMIT License