atxtechbro / atxtechbro/dotfiles

git-mcp-server: git_commit creates new commit instead of respecting --amend flag

Open
#621 0 comments 0 reactions 0 assignees View on GitHub
bug mcp
Dominant language
Shell
Stars
27
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Bug Description
The `git_commit` MCP tool doesn't support the `--amend` flag, forcing users to fall back to bash commands for amending commits. This breaks the MCP-first workflow.

## Reproduction Steps

1. Make some changes to files
2. Stage the changes using `git_add`
3. Try to amend the previous commit using `git_commit` (no --amend parameter available)
4. Tool creates a new commit instead
5. User must use bash commands to reset and amend properly:
```bash
git reset --soft HEAD~1
git commit --amend --no-edit
```

## Expected Behavior
The `git_commit` tool should have an optional `amend` boolean parameter that allows amending the previous commit instead of creating a new one.

## Actual Behavior
The tool only supports creating new commits, requiring fallback to bash for common git workflows.

## Suggested Implementation
Add an optional `amend` parameter to the `git_commit` tool:
```python
def git_commit(repo_path: str, message: str, amend: bool = False):
if amend:
# Run git commit --amend -m "message"
else:
# Current behavior
```

## Impact
This limitation forces users to break out of the MCP workflow for a common git operation, reducing the effectiveness of the git-mcp-server.

## Context
Found while working on the in-house github-mcp-server implementation in `mcp/servers/github-mcp-server/`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in mcp/servers/github-mcp-server/ and locate the git_commit tool entry point and its existing tests or command execution path. Add the optional amend behavior while preserving normal commits, then verify the tool can amend a staged change without requiring a shell fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.