git-commit-aider MCP Server
This server automates Git commits with AI attribution by:
Committing staged changes in a Git repository with a specific message
Automatically appending "(aider)" to the committer's name to track AI contributions
Optionally specifying a working directory for the git command
Using environment variables for committer name and email, or falling back to git config
Enabling tracking of AI contribution using
aider --statsor custom scripts
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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@git-commit-aider MCP Servercommit these changes with message 'fix login validation bug'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.nameandgit 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.
Related MCP server: Git Polite
Installation
To use this server, add its configuration to your MCP settings file.
{
"mcpServers": {
"git-commit-aider": {
"command": "npx",
"args": ["mcp-git-commit-aider"]
}
}
}The committer information is retrieved from:
Environment variables
GIT_COMMITTER_NAMEandGIT_COMMITTER_EMAIL, which follows git's convention.Output of
git config user.nameandgit config user.emailcommands.
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:
git commit --amend --author="$(git config user.name) (aider) <$(git config user.email)>"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:
git config --global alias.aimend '!git commit --amend --author="$(git config user.name) (aider) <$(git config user.email)>"'Once set up, you can use the alias by running:
git aimendCalculating 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).
#!/bin/bash
# Script to calculate line changes (added, deleted, total) by AI and human authors
# between two commits.
# Output is in JSON format.
#
# This logic is extracted and altered from git-quick-stats.sh, MIT license.
# --- Configuration ---
# You may change the config to match your repository's convention.
# String to identify AI-generated commits in author names
AI_MATCHER="(aider)"
# Define patterns for files/paths to be excluded from the calculation.
# These will be converted to git pathspecs like ":(exclude)*package-lock.json"
IGNORE_PATTERNS=(
"*package-lock.json"
"*.lock"
)
# --- Helper Functions ---
function print_usage() {
echo "Usage: $0 <REVISION_RANGE>"
echo " <REVISION_RANGE>: The revision range to analyze (e.g., HEAD~5..HEAD, my-branch, commit_sha)."
echo " Refer to 'git help log' or 'git help revisions' for more range options."
echo "Example: $0 HEAD~5..HEAD"
echo "Example: $0 origin..HEAD"
echo "Example: $0 my-feature-branch"
echo "Example: $0 abcdef1..fedcba2"
}
# --- Argument Parsing ---
if [ "$#" -ne 1 ]; then
echo "Error: Incorrect number of arguments. Please provide a single revision range."
print_usage
exit 1
fi
REVISION_RANGE="$1"
# --- Main Logic ---
# Construct pathspec arguments for git log
pathspec_args=()
for pattern in "${IGNORE_PATTERNS[@]}"; do
pathspec_args+=(":(exclude)$pattern")
done
git_log_output=$(git log "$REVISION_RANGE" --numstat --pretty="format:AuthorName:%an" -- "${pathspec_args[@]}")
# DEBUG: Uncomment to check the calculation for each commit.
# echo "$git_log_output"
# Process the log output with awk
result_json=$(echo "$git_log_output" | awk -v ai_matcher="$AI_MATCHER" '
BEGIN {
ai_added = 0
ai_deleted = 0
human_added = 0
human_deleted = 0
current_author = ""
is_ai_author = 0
}
/^AuthorName:/ {
# Extract author name
current_author = substr($0, length("AuthorName:") + 1)
if (index(current_author, ai_matcher) > 0) {
is_ai_author = 1
} else {
is_ai_author = 0
}
next
}
# Skip empty lines between commit blocks or lines that are not numstat
NF == 0 || !($1 ~ /^[0-9]+$/ && $2 ~ /^[0-9]+$/) {
next
}
# Process numstat line: <added> <deleted> <file>
{
added_lines = $1
deleted_lines = $2
# Skip binary files where numstat shows "-" for lines
if (added_lines == "-" || deleted_lines == "-") {
next
}
# Aggregate stats per author and file for details array
file_name = $3
# Robust key using File Separator character \034
key = current_author "\034" file_name
file_author_added[key] += added_lines
file_author_deleted[key] += deleted_lines
if (is_ai_author) {
ai_added += added_lines
ai_deleted += deleted_lines
} else {
human_added += added_lines
human_deleted += deleted_lines
}
}
END {
ai_total_changed = ai_added + ai_deleted
human_total_changed = human_added + human_deleted
overall_total_changed = ai_total_changed + human_total_changed
ai_percentage = 0.00
if (overall_total_changed > 0) {
ai_percentage = (ai_total_changed / overall_total_changed) * 100
}
printf "{\n"
printf " \"ai_percentage\": %.2f,\n", ai_percentage
printf " \"ai_changes\": {\"added\": %d, \"deleted\": %d, \"total\": %d},\n", ai_added, ai_deleted, ai_total_changed
printf " \"human_changes\": {\"added\": %d, \"deleted\": %d, \"total\": %d},\n", human_added, human_deleted, human_total_changed
# Details array
printf " \"details\": [\n"
first_detail = 1
# Iterate over one of the arrays, keys should be consistent
for (key in file_author_added) {
if (!first_detail) {
printf ",\n"
}
first_detail = 0
# Split key "author\034fileName" into key_parts array
# key_parts[1] will be author, key_parts[2] will be fileName
split(key, key_parts, "\034")
author = key_parts[1]
fileName = key_parts[2]
# Escape double quotes for JSON compatibility
gsub(/"/, "\\\"", author)
gsub(/"/, "\\\"", fileName)
detail_added = file_author_added[key] + 0 # Ensure numeric
detail_deleted = file_author_deleted[key] + 0 # Ensure numeric
detail_total = detail_added + detail_deleted
printf " {\n"
printf " \"fileName\": \"%s\",\n", fileName
printf " \"author\": \"%s\", \"isAI\": %s,\n", author, (index(author, ai_matcher) > 0 ? "true" : "false")
printf " \"added\": %d, \"deleted\": %d, \"total\": %d\n", detail_added, detail_deleted, detail_total
printf " }"
}
printf "\n ]\n"
printf "}\n"
}
')
# --- Output ---
echo "$result_json"Usage example:
# Assume the script is saved as `calculate_ai_contribution.sh` and is executable (chmod +x calculate_ai_contribution.sh)
# Example 1: Analyze the last 5 commits
./calculate_ai_contribution.sh HEAD~5..HEAD
# Example 2: Analyze commits between a specific commit and HEAD
./calculate_ai_contribution.sh 90a5fcd4..HEAD
# Example 3: Analyze all commits on a feature branch not yet in main
./calculate_ai_contribution.sh main..my-feature-branch
# Example 4: Analyze commits between two tags
./calculate_ai_contribution.sh v1.0..v1.1
# Example output (will vary based on your repository and range):
# {
# "ai_percentage": 48.53,
# "ai_changes": { "added": 100, "deleted": 32, "total": 132 },
# "human_changes": { "added": 103, "deleted": 37, "total": 140 },
# "details": [
# {
# "fileName": "src/featureA.js",
# "author": "Developer One (aider)", "isAI": true,
# "added": 60, "deleted": 10, "total": 70
# },
# {
# "fileName": "src/featureB.js",
# "author": "Developer One (aider)", "isAI": true,
# "added": 40, "deleted": 22, "total": 62
# },
# {
# "fileName": "src/utils.js",
# "author": "Developer Two", "isAI": false,
# "added": 80, "deleted": 15, "total": 95
# },
# {
# "fileName": "README.md",
# "author": "Developer Two", "isAI": false,
# "added": 23, "deleted": 22, "total": 45
# }
# ]
# }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 specificauthorto a particularfileName, including linesadded,deleted, and thetotalchanges for that file by that author.
Available Tools
1 toolcommit_stagedA
Commit staged changes with a specific message, appending "(aider)" to the committer name.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The commit message. | |
| cwd | No | Optional: The working directory for the git command (defaults to the workspace root). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that the committer name is modified, which is a behavioral side effect. However, without annotations, the description carries the full burden. It could be more explicit about the exact impact (e.g., 'the commit author will be altered'), but the provided detail is adequate for a simple operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that is front-loaded and contains no wasted words. Every word earns its place, efficiently conveying the core behavior.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple git commit tool with no output schema, the description covers the main action and a notable side effect. However, it omits details like success confirmation or error behavior. Given low complexity, it is nearly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the description does not add meaning beyond the schema. Both parameters (message and cwd) are already described in the schema, so the description adds no extra context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool commits staged changes with a message, and specifies a unique behavioral tweak (appending '(aider)' to committer name). The verb and resource are explicit, and with no sibling tools, differentiation is not needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives, such as other git commands. Since there are no siblings, the guidance is less critical, but still absent; no prerequisites or limitations are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
commit_staged
TDQS
With only one tool, there is no ambiguity. The tool 'commit_staged' has a clear and distinct purpose.
The single tool follows a consistent verb_noun pattern ('commit_staged'), so naming is trivially consistent.
The server has only one tool, which feels thin for a git commit aider. A typical scope would include staging, status, and other related operations.
The tool surface is severely incomplete. It only offers commit_staged, missing essential operations like staging, status, branching, or commit management, which will likely cause agent failures.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Edit your Overleaf LaTeX projects from Claude and ChatGPT; every change is a real Git commit.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Pre-commit code quality guardian. Detects semantic drift in AI-generated code.
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.-
- AlicenseAqualityCmaintenanceEnables AI agents to intelligently organize Git changes into clean, focused commits with autopilot mode or surgical line-by-line staging precision. Supports partial staging of untracked files and handles large diffs with smart truncation.51MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to create conventional Git commits, update changelogs, and optionally push changes to remote repositories.22MIT
- FlicenseBqualityDmaintenanceEnables AI-powered code editing and development tasks through natural language conversations with Claude, using Aider's capabilities for improving code, adding features, fixing bugs, refactoring, and checking status.51-
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MrOrz/mcp-git-commit-aider'
If you have feedback or need assistance with the MCP directory API, please join our Discord server