Get the FREE Ultimate OpenClaw Setup Guide →

git

MCP server from LokiMCPUniverse/git-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lokimcpuniverse-git-mcp-server python /path/to/git-mcp-server/git_mcp.py

How to use

This MCP server exposes a set of Git-related tools as MCP endpoints, allowing an AI assistant to inspect and manipulate Git repositories through natural language prompts. The available tools include git_status to report repository state, git_log to view commit history, git_diff to show changes, git_commit to create commits, git_branch to list branches, and git_checkout to switch branches. You can use these tools in conjunction with GenAI APIs or Claude/OpenAI integrations to manage repositories without leaving the conversation.

To use the server, run it locally or in your environment, then configure your MCP client to target the git-mcp server. Once connected, you can ask your assistant to perform actions like checking what files changed, listing branches, or creating a commit with a descriptive message. The toolkit abstracts common Git operations into simple tool calls that the AI can invoke and receive structured results from.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Git installed if you want to operate on real repositories

Installation steps (standalone Python server):

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

  2. Create a virtual environment (optional but recommended): python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows

  3. Install dependencies: pip install -r requirements.txt

  4. Run the MCP server directly: python git_mcp.py

Alternative: install as a package (editable): pip install -e . python git_mcp.py

Prerequisites recap:

  • Ensure Python 3.10+ is available
  • Ensure Git is installed if you will operate on repositories locally
  • Ensure network access if you plan to expose the server to remote clients

Additional notes

Tips and common considerations:

  • The server expects a Git repository to operate on; provide absolute paths to repositories when using tools like git_status or git_log.
  • If integrating with Claude or another MCP client, update the client configuration to reference the git-mcp server (e.g., in Claude Desktop’s mcpServers section).
  • When expanding capabilities, you can map additional Git operations to new tools following the repository's tooling pattern.
  • If you encounter permission or path issues, verify that the Python process has access to the target repository paths and that the path provided in the tool arguments is correct.
  • For debugging, ensure you run the server in a stable environment (virtualenv or container) and check test coverage in the repository to understand expected inputs/outputs for each tool.

Related MCP Servers

Sponsor this space

Reach thousands of developers