Provides a secure, scalable Git MCP server delivering version control capabilities to AI agents and local/workspace environments via STDIO and streamable HTTP.
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.
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.
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@latestIf you prefer Bun, you can run the server with bunx without installing additional dependencies.
bunx @cyanheads/git-mcp-server@latestInitialize a new repository in the configured working directory.
Clone a repository from a remote URL into the working directory.
Show the status of the working tree, including staged, unstaged, and untracked files.
Remove untracked files and directories to clean the working tree.
Add file changes to the staging area in preparation for a commit.
Create a new commit from staged changes with a message.
Show differences between commits, branches, or the working tree.
Display the commit history for the repository.
Show details about a specific object, such as a commit.
Trace changes to the origin of each line in a file.
Show the reflog, recording updates to references.
Analyze the git context to prepare structured changelog guidance for LLM-driven workflows.
List, create, or delete branches.
Switch between branches or restore working tree files.
Merge changes from one branch into another.
Reapply commits on top of another base tip to streamline history.
Apply the changes introduced by some existing commits.
Manage remote repositories and URLs.
Download objects and refs from a remote repository.
Fetch and integrate changes from a remote repository.
Update remote refs along with associated objects.
Create, list, or delete tags for releases.
Stash changes in a dirty working directory.
Reset current HEAD to a specific state, with optional hard/soft options.
Manage multiple working trees for a repository.
Set the session working directory for the current MCP session.
Clear or reset the session working directory.
Provide end-of-session guidance and documentation for the git workflow.