Get the FREE Ultimate OpenClaw Setup Guide →

git -rust

MCP server from QiuZH001/git-mcp-server-rust

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio qiuzh001-git-mcp-server-rust ./git-mcp-server \
  --env GIT_EMAIL="you@example.com" \
  --env GIT_BASE_DIR="/path/to/your/project/base" \
  --env GIT_USERNAME="Your Name" \
  --env MCP_AUTH_MODE="none" \
  --env MCP_HTTP_HOST="127.0.0.1" \
  --env MCP_HTTP_PORT="3015" \
  --env MCP_LOG_LEVEL="info" \
  --env OAUTH_AUDIENCE="" \
  --env GIT_SIGN_COMMITS="false" \
  --env MCP_SESSION_MODE="auto" \
  --env OAUTH_ISSUER_URL="" \
  --env MCP_TRANSPORT_TYPE="stdio" \
  --env MCP_ALLOWED_ORIGINS="" \
  --env MCP_AUTH_SECRET_KEY="" \
  --env MCP_RESPONSE_FORMAT="json" \
  --env OAUTH_PUBLIC_KEY_PEM="" \
  --env MCP_HTTP_ENDPOINT_PATH="/mcp" \
  --env MCP_RESPONSE_VERBOSITY="standard" \
  --env GIT_WRAPUP_INSTRUCTIONS_PATH="/path/to/wrapup.md"

How to use

This MCP server implements a high-performance Rust-based Git MCP canvas that exposes a suite of Git-oriented tools via the MCP protocol. It supports STDIO and HTTP transmission modes and provides a session-scoped working directory so you can operate on a specific project without leaving the session. Tools include Git repository management (git_init, git_clone, git_status, git_clean), staging and commits (git_add, git_commit, git_diff), history queries (git_log, git_show, git_blame, git_reflog), branch and remote operations (git_branch, git_checkout, git_merge, git_rebase, git_cherry_pick, git_remote, git_fetch, git_pull, git_push), and advanced actions like changelog analysis (git_changelog_analyze) and wrap-up instruction generation (git_wrapup_instructions). You can query the MCP endpoint for tools/list and tools/call, and retrieve resources or prompts as needed. To use it, configure a client (e.g., Claude, Cursor, Windsurf, OpenCode) with the Git MCP server reference, then issue MCP method calls such as initialize, tools/list to discover capabilities, and tools/call to execute specific Git commands with appropriate parameters. The server will enforce base directory restrictions and can switch among a session-specific working directory per interaction.

How to install

Prerequisites:

  • Rust 1.70+ (for building from source)
  • Git 2.0+ (for repository operations during setup)
  • Supported OS: macOS, Linux, Windows

Option A: Build from source

  1. Clone the repository git clone https://github.com/QiuZH001/git-mcp-server-rust.git cd git-mcp-server-rust

  2. Build in release mode cargo build --release

  3. The binary will be at ./target/release/git-mcp-server

Option B: Download prebuilt binary

  1. Obtain the prebuilt binary (if available) and place it in a suitable location, e.g. /usr/local/bin/git-mcp-server
  2. Ensure it is executable: chmod +x /usr/local/bin/git-mcp-server

Running the server

  1. Run the binary directly (stdio transport by default): ./target/release/git-mcp-server or /usr/local/bin/git-mcp-server
  2. If you prefer HTTP transport, set MCP_TRANSPORT_TYPE to http and configure MCP_HTTP_HOST/PORT/ENDPOINT accordingly in the environment before starting the server.

Additional notes

Tips and caveats:

  • Environment variables control base directory, user identity, and logging. Ensure GIT_BASE_DIR is a secure path and that your process has permissions to read/write there.
  • For safety, enable session mode (MCP_SESSION_MODE) as needed to manage per-interaction working directories.
  • If using HTTP transport, ensure MCP_HTTP_ENDPOINT_PATH is accessible and that MCP_AUTH_MODE is configured to your security requirements.
  • When a path outside GIT_BASE_DIR is requested, the server will reject the operation; adjust GIT_BASE_DIR carefully.
  • For debugging, set MCP_LOG_LEVEL to debug and consult logs to trace command execution and parameter validation.

Related MCP Servers

Sponsor this space

Reach thousands of developers