Skip to main content

A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs

Project description

mcp-server-git: A git MCP server

Overview

A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.

Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.

Tools

  1. git_status

    • Shows the working tree status
    • Input:
      • repo_path (string): Path to Git repository
    • Returns: Current status of working directory as text output
  2. git_diff_unstaged

    • Shows changes in working directory not yet staged
    • Input:
      • repo_path (string): Path to Git repository
    • Returns: Diff output of unstaged changes
  3. git_diff_staged

    • Shows changes that are staged for commit
    • Input:
      • repo_path (string): Path to Git repository
    • Returns: Diff output of staged changes
  4. git_commit

    • Records changes to the repository
    • Inputs:
      • repo_path (string): Path to Git repository
      • message (string): Commit message
    • Returns: Confirmation with new commit hash
  5. git_add

    • Adds file contents to the staging area
    • Inputs:
      • repo_path (string): Path to Git repository
      • files (string[]): Array of file paths to stage
    • Returns: Confirmation of staged files
  6. git_reset

    • Unstages all staged changes
    • Input:
      • repo_path (string): Path to Git repository
    • Returns: Confirmation of reset operation
  7. git_log

    • Shows the commit logs
    • Inputs:
      • repo_path (string): Path to Git repository
      • max_count (number, optional): Maximum number of commits to show (default: 10)
    • Returns: Array of commit entries with hash, author, date, and message

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run mcp-server-git.

Using PIP

Alternatively you can install mcp-server-git via pip:

pip install mcp-server-git

After installation, you can run it as a script using:

python -m mcp_server_git

Configuration

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Using uvx
"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
Using pip installation
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
  }
}

Usage with Zed

Add to your Zed settings.json:

Using uvx
"context_servers": [
  "mcp-server-git": {
    "command": {
      "path": "uvx",
      "args": ["mcp-server-git"]
    }
  }
],
Using pip installation
"context_servers": {
  "mcp-server-git": {
    "command": {
      "path": "python",
      "args": ["-m", "mcp_server_git"]
    }
  }
},

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx mcp-server-git

Or if you've installed the package in a specific directory or are developing on it:

cd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-git

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_git-0.6.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_git-0.6.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_git-0.6.1.tar.gz.

File metadata

  • Download URL: mcp_server_git-0.6.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mcp_server_git-0.6.1.tar.gz
Algorithm Hash digest
SHA256 23e0a7d4f4d84fece4cf1a6c46be225b3fd1d7f3b46ff67b3d71bd4f225f1684
MD5 bd2b5152eb9183cafbdc3144766b6203
BLAKE2b-256 19a10b6b87df08fd1336be4bd647c313a32f9e217e21b339ebb4adcc77f62c74

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_git-0.6.1.tar.gz:

Publisher: python.yml on modelcontextprotocol/servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_server_git-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_server_git-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mcp_server_git-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60daf2cff1a2786f1c6d0fdc63ee41ec822f7ec858f72e616786ead653708fae
MD5 09e9d6f0b179698f1389952551949184
BLAKE2b-256 e852157f9aea51839573f4af140f3adf659dfe82670266ce8403ea04cd808a7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_git-0.6.1-py3-none-any.whl:

Publisher: python.yml on modelcontextprotocol/servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page