MCP server for git operations over stdio
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Simon Cornet e243c938ee
All checks were successful
ci/woodpecker/push/lint-test-release Pipeline was successful
ci(woodpecker): install git in the testing step
The push tests shell out to git, which the go-build image lacks.
2026-10-24 12:20:59 +02:00
.woodpecker ci(woodpecker): install git in the testing step 2026-10-24 12:20:59 +02:00
.gitignore chore: add gitignore for binary 2026-06-01 17:29:24 +02:00
.goreleaser.yaml refactor: safe type assertions, configurable TRUSTED_BASE_DIR, array git_add, askpass clone, strip goreleaser 2026-06-03 09:15:38 +02:00
.markdownlint-cli2.jsonc docs: add readme and markdownlint config 2026-06-01 17:00:36 +02:00
git.go feat(push): push any branch, refuse protected ones 2026-10-21 09:42:34 +02:00
go.mod chore(package): update module github.com/mark3labs/mcp-go to v1.3.0 2026-10-15 16:36:55 +00:00
go.sum chore(package): update module github.com/mark3labs/mcp-go to v1.3.0 2026-10-15 16:36:55 +00:00
main.go feat: add http support 2026-08-06 17:21:02 +02:00
push_test.go feat(push): push any branch, refuse protected ones 2026-10-21 09:42:34 +02:00
readme.md feat(push): push any branch, refuse protected ones 2026-10-21 09:42:34 +02:00
renovate.json ci: add renovate config 2026-06-01 16:32:50 +02:00
tools.go feat(push): push any branch, refuse protected ones 2026-10-21 09:42:34 +02:00

mcp-git

MCP server for git operations over stdio, scoped to current working directory.

Tools

Tool Description
git_clone Clone a repo using token auth
git_status Show working tree status
git_add Stage files for commit
git_commit Create a conventional commit
git_push Push a branch to origin (default: the checked-out branch)
git_pull Pull from origin/main
git_log Show recent commit history
git_diff Show working tree or staged diff
git_branch List or create branches
git_checkout Switch branches

Build

go build -o mcp-git .

Usage

Add to your MCP client config:

{
  "mcpServers": {
    "mcp-git": {
      "command": "/path/to/mcp-git"
    }
  }
}

The server communicates over stdio using the MCP protocol. All repo paths are resolved relative to the current working directory, or as absolute paths.

Protected branches

git_push refuses branches listed in the repo's git config, e.g. a main that only takes PRs:

git config --add mcp-git.protected main

Pushes always use an explicit refspec (refs/heads/<branch>:refs/heads/<branch>), so push.default never pushes other branches along.