home / mcp / git mcp server

Git MCP Server

Provides a secure, scalable Git MCP server delivering version control capabilities to AI agents and local/workspace environments via STDIO and streamable HTTP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cyanheads-git-mcp-server": {
      "command": "npx",
      "args": [
        "@cyanheads/git-mcp-server@latest"
      ],
      "env": {
        "LOGS_DIR": "~/Developer/logs/git-mcp-server/",
        "GIT_EMAIL": "[email protected]",
        "GIT_BASE_DIR": "~/Developer/",
        "GIT_USERNAME": "cyanheads",
        "MCP_LOG_LEVEL": "info",
        "GIT_SIGN_COMMITS": "false",
        "MCP_TRANSPORT_TYPE": "stdio"
      }
    }
  }
}

You can leverage this MCP server to provide secure, scalable Git operations to AI agents and local workflows, enabling powerful version control across local and edge environments with STDIO and streamable HTTP transports.

How to use

Start by choosing how you want to run the MCP server: locally via npx or bunx, or as a remote HTTP service. You will configure a client to connect to the MCP server and issue Git-related commands through structured prompts. When using the STDIO transport, your client launches the MCP server process and communicates through standard input and output. When using HTTP, you send requests to the configured HTTP endpoint and receive structured responses suitable for downstream processing.

How to install

Prerequisites: ensure Node.js v20.0.0+ is installed, or Bun v1.2.0+ as an alternative. Git must be installed and available in your system PATH.

Step-by-step setup using Node.js (npx): install nothing globally; run the MCP server directly with npx.

npx @cyanheads/git-mcp-server@latest

Additional setup for Bun (optional)

If you prefer Bun, you can run the server with bunx without installing additional dependencies.

bunx @cyanheads/git-mcp-server@latest

Available tools

git_init

Initialize a new repository in the configured working directory.

git_clone

Clone a repository from a remote URL into the working directory.

git_status

Show the status of the working tree, including staged, unstaged, and untracked files.

git_clean

Remove untracked files and directories to clean the working tree.

git_add

Add file changes to the staging area in preparation for a commit.

git_commit

Create a new commit from staged changes with a message.

git_diff

Show differences between commits, branches, or the working tree.

git_log

Display the commit history for the repository.

git_show

Show details about a specific object, such as a commit.

git_blame

Trace changes to the origin of each line in a file.

git_reflog

Show the reflog, recording updates to references.

git_changelog_analyze

Analyze the git context to prepare structured changelog guidance for LLM-driven workflows.

git_branch

List, create, or delete branches.

git_checkout

Switch between branches or restore working tree files.

git_merge

Merge changes from one branch into another.

git_rebase

Reapply commits on top of another base tip to streamline history.

git_cherry_pick

Apply the changes introduced by some existing commits.

git_remote

Manage remote repositories and URLs.

git_fetch

Download objects and refs from a remote repository.

git_pull

Fetch and integrate changes from a remote repository.

git_push

Update remote refs along with associated objects.

git_tag

Create, list, or delete tags for releases.

git_stash

Stash changes in a dirty working directory.

git_reset

Reset current HEAD to a specific state, with optional hard/soft options.

git_worktree

Manage multiple working trees for a repository.

git_set_working_dir

Set the session working directory for the current MCP session.

git_clear_working_dir

Clear or reset the session working directory.

git_wrapup_instructions

Provide end-of-session guidance and documentation for the git workflow.