Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyProgramming

Git MCP Server

Lets your AI agent run Git in local repos: clone, commit, diff, branch, merge, rebase, stash and worktrees.

245 stars on GitHubby cyanheadsLicense Apache-2.0Updated 2 months ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add git -- npx -y @cyanheads/git-mcp-server run start:stdio

What to fill in

NameWhat it isRequired
MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').No
GIT_BASE_DIROptional absolute path to restrict all git operations to a specific directory tree. Provides security sandboxing for multi-tenant or shared environments.No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Show me what changed since the last commit.
Create a new branch called fix-login and commit my changes.

What it is

This server gives AI agents 28 Git tools for local repositories, plus a resource for the current working directory and a wrap-up prompt. It works over stdio or streamable HTTP and runs on Node.js or Bun. Destructive actions need explicit confirmation flags.

What it can do

  • git_status, git_diff, git_log: check and review changes
  • git_add and git_commit: stage and commit
  • git_branch, git_checkout, git_merge, git_rebase: manage branches
  • git_push, git_pull, git_fetch: sync with remotes
  • git_stash, git_tag, git_worktree: stash, tag and manage worktrees
  • git_clean and git_reset: require confirmation

When to use

  • β€ΊWhen you want an AI to commit your changes with a clear message
  • β€ΊWhen you want a branch merged or rebased and conflicts explained
  • β€ΊWhen you want a changelog analysis from your history

What you need

Node.js 20+ (npx @cyanheads/git-mcp-server@latest) or Bun 1.2+. Git must be installed. Set your git identity in the config env.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

Yes, it is under an open license on GitHub.

Does it sign commits?

GPG or SSH signing is on by default and falls back to unsigned if it fails, with a warning in the response.

Is it safe?

Paths are checked, git runs without a shell, and git clean and git reset --hard need explicit confirmation flags.

Can I limit where it works?

Yes, GIT_BASE_DIR restricts operations to one directory tree.

Which transports work?

stdio by default, or Streamable HTTP on port 3015 when MCP_TRANSPORT_TYPE=http.

Can I set my git name?

Yes, with GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL, or fall back to your global git config.

If it does not work

  • β€ΊCheck that Node.js 20+ (or Bun 1.2+) and git are installed.
  • β€ΊSet GIT_USERNAME and GIT_EMAIL in the env or configure global git identity.
  • β€ΊIf a commit fails to sign, turn off GIT_SIGN_COMMITS or fix your GPG or SSH setup.

5 new skills a week. 1 minute to read.