Skip to content

mcp-server-git: add git_merge tool #659

Closed

Description

@hesreallyhim

Is your feature request related to a problem? Please describe.
I've been using mcp-server-git for local development, it's freakin' awesome, great job everyone. But I don't see git_merge as a tool, I'm wondering if there is any good reason why it's not included at the moment? I can do checkout, status, commit, etc. so it seems like it would be a great thing for my local workflow.

Describe the solution you'd like
Add a git_merge tool that takes these inputs:

repo_path (string): Path to Git repository
source_branch (string): Name of branch to merge FROM. (git merge foo) if source_branch = foo
target_branch (string): Name of the branch to merge INTO (by default, the current working branch)
ff-only (boolean): Whether to require the merge to be ff-only (true by default)
squash (boolean): Whether the merge should be a squash (false by default)
Returns: Confirmation of git merge <source_branch> --ff-only command, or a message describing why the merge failed (merge conflict encountered, merge is not fast-forward when ff-only = true, source_branch does not exist), etc.

If any of these conditions are not met, or there are conflicts, the merge will be aborted with git merge --abort.

Describe alternatives you've considered
None (or just do it manually).

Additional context
For an initial implementation, due to the nuances of merging, the tool can be configured to ONLY allow ff-only from source_branch to target_branch, where target_branch is the current checked-out branch, and will fail if there are any conflicts, if the merge is not fast-forward, if target_branch is not the current branch (as revealed by git_status), etc. Basically, this will ONLY succeed if I have a local branch dev and I am on main and I can successfully run git merge dev --ff-only. I can imagine a lot of ways to enhance this tool, but this would still be a really useful addition, even in this primitive form.

Activity

  1. tspearconquest commented on Sep 19, 2026

    @tspearconquest

    This would be useful for allowing models to resolve merge conflicts. That's something Opus just thought it could do via git_commit, and ended up getting my feature branch working tree synced with main but left the branch still n number of commits behind main, forcing it to do a second commit that was a true merge commit so I could merge my PR. lol

  2. added
    server-gitReference implementation for the Git MCP server - src/git
    on Oct 19, 2026
  3. cliffhall commented on Oct 19, 2026

    @cliffhall
    Member

    Triage: Priority Low (total 4)

    • Severity 2: The git server still has no git_merge tool; a conservative fast-forward-only merge tool is a reasonable addition to the git reference server.
    • Urgency 2: wanted eventually
    • Bonuses: none

    Board: Servers V2 (#43), Status Incoming, awaiting maintainer review (no milestone yet). Part of the backlog triage in #4875.

  4. added this to the v2.3.0 milestone on Oct 25, 2026
  5. self-assigned this
    on Oct 28, 2026
  6. linked a pull request that will close this issuefeat(git): add git_merge tool #5363on Oct 28, 2026
  7. added a commit that references this issue on Nov 4, 2026
    98845dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestserver-gitReference implementation for the Git MCP server - src/gitv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions