Get the FREE Ultimate OpenClaw Setup Guide →

mcp-git-tools

Git tool integration library for the Model Context Protocol (MCP).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lileeei-mcp-git-tools cargo run --release --bin mcp-git-server \
  --env RUST_LOG="info"

How to use

The MCP Git Tools server implements a suite of Git operations that can be invoked through the Model Context Protocol (MCP). It exposes tools such as git_status, git_branches, git_log, git_commit, git_pull, git_push, git_diff, git_add, git_reset, and various git_worktree commands. Each tool accepts a structured set of parameters (e.g., repo_path, branch, since, until, etc.) and returns JSON results describing the outcome of the operation. The server uses the RMCP SDK with stdio transport to communicate with MCP clients, so you send a ToolCall and receive a structured response containing fields like status, output, or details about the repository state. To interact with it, you typically run the server and connect a client (for example, via MCP Inspector) to issue tool calls and view results.

You can expect a schema-driven experience: parameters for each tool are defined with serializable types, enabling automatic JSON schema generation and type-safe parsing on the server side. This makes it straightforward to discover available tools and their required inputs via the server metadata and tool list endpoints, then call the tools with JSON payloads that match the expected shapes.

How to install

Prerequisites:

  • Rust and Cargo installed on your machine (Rustup recommended).
  • Git installed (for cloning and optional local tooling).

Installation steps:

  1. Clone the repository: git clone https://gitcode.com/lileeei/mcp-git-tools.git

  2. Navigate into the project directory: cd mcp-git-tools

  3. Build the project in release mode: cargo build --release

  4. Run the server (standalone): cargo run --release --bin mcp-git-server

  5. Optional: test build locally and run the server binary directly: cargo build --release ./target/release/mcp-git-server

  6. If you plan to test with MCP Inspector, ensure the server is running and connect the inspector to the server process via the stdio channel (as configured by the RMCP SDK).

Additional notes

Notes and tips:

  • The server uses RMCP's stdio transport, so clients typically connect by launching the server process and communicating over standard input/output.
  • Tool parameters are defined with derive macros to automatically generate JSON schemas, making it easier to discover required inputs.
  • If you run into permissions or path issues with Git worktrees, ensure the executing user has the appropriate filesystem permissions for the repository paths you query or modify.
  • The environment variable RUST_LOG can be used to adjust logging verbosity (e.g., info, debug).
  • Since the server is Rust-based, ensure you are using a compatible Rust toolchain (recommended to use the latest stable release for best compatibility).
  • If you want to deploy via a container, you could build a Docker image from the project or adapt the Cargo binary to a base image; however, this README describes local development and testing flows.

Related MCP Servers

Sponsor this space

Reach thousands of developers