Skip to main content

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

Project description

levalicious-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 levalicious-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
    • Inputs:
      • repo_path (string): Path to Git repository
      • context_lines (number, optional): Number of context lines to show (default: 3)
    • Returns: Diff output of unstaged changes
  3. git_diff_staged

    • Shows changes that are staged for commit
    • Inputs:
      • repo_path (string): Path to Git repository
      • context_lines (number, optional): Number of context lines to show (default: 3)
    • Returns: Diff output of staged changes
  4. git_diff

    • Shows differences between branches or commits
    • Inputs:
      • repo_path (string): Path to Git repository
      • target (string): Target branch or commit to compare with
      • context_lines (number, optional): Number of context lines to show (default: 3)
    • Returns: Diff output comparing current state with target
  5. 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
  6. 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
  7. git_reset

    • Unstages all staged changes
    • Input:
      • repo_path (string): Path to Git repository
    • Returns: Confirmation of reset operation
  8. 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
  9. git_create_branch

    • Creates a new branch
    • Inputs:
      • repo_path (string): Path to Git repository
      • branch_name (string): Name of the new branch
      • start_point (string, optional): Starting point for the new branch
    • Returns: Confirmation of branch creation
  10. git_checkout

  • Switches branches
  • Inputs:
    • repo_path (string): Path to Git repository
    • branch_name (string): Name of branch to checkout
  • Returns: Confirmation of branch switch
  1. git_show
  • Shows the contents of a commit
  • Inputs:
    • repo_path (string): Path to Git repository
    • revision (string): The revision (commit hash, branch name, tag) to show
  • Returns: Contents of the specified commit
  1. git_init
  • Initializes a Git repository
  • Inputs:
    • repo_path (string): Path to directory to initialize git repo
  • Returns: Confirmation of repository initialization
  1. git_branch
  • List Git branches
  • Inputs:
    • repo_path (string): Path to the Git repository.
    • branch_type (string): Whether to list local branches ('local'), remote branches ('remote') or all branches('all').
    • contains (string, optional): The commit sha that branch should contain. Do not pass anything to this param if no commit sha is specified
    • not_contains (string, optional): The commit sha that branch should NOT contain. Do not pass anything to this param if no commit sha is specified
  • Returns: List of branches

Installation

Using uv (recommended)

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

Using PIP

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

pip install levalicious-mcp-server-git

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

python -m levalicious_mcp_server_git

Configuration

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Using uvx
"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["levalicious-mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
Using docker
  • Note: replace '/Users/username' with the a path that you want to be accessible by this tool
"mcpServers": {
  "git": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
  }
}
Using pip installation
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "levalicious_mcp_server_git", "--repository", "path/to/git/repo"]
  }
}

Usage with VS Code

For quick installation, use one of the one-click install buttons below...

Install with UV in VS Code Install with UV in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

{
  "mcp": {
    "servers": {
      "git": {
        "command": "uvx",
        "args": ["levalicious-mcp-server-git"]
      }
    }
  }
}

For Docker installation:

{
  "mcp": {
    "servers": {
      "git": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
          "mcp/git"
        ]
      }
    }
  }
}

Usage with Zed

Add to your Zed settings.json:

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

Debugging

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

npx @modelcontextprotocol/inspector uvx levalicious-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 levalicious-mcp-server-git

Running tail -n 20 -f ~/Library/Logs/Claude/mcp*.log will show the logs from the server and may help you debug any issues.

Development

If you are doing local development, there are two ways to test your changes:

  1. Run the MCP inspector to test your changes. See Debugging for run instructions.

  2. Test using the Claude desktop app. Add the following to your claude_desktop_config.json:

Docker

{
  "mcpServers": {
    "git": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
        "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
        "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
        "mcp/git"
      ]
    }
  }
}

UVX

{
"mcpServers": {
  "git": {
    "command": "uv",
    "args": [
      "--directory",
      "/<path to mcp-servers>/mcp-servers/src/git",
      "run",
      "levalicious-mcp-server-git"
    ]
    }
  }
}

Build

Docker build:

cd src/git
docker build -t mcp/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

levalicious_mcp_server_git-0.0.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

levalicious_mcp_server_git-0.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file levalicious_mcp_server_git-0.0.1.tar.gz.

File metadata

File hashes

Hashes for levalicious_mcp_server_git-0.0.1.tar.gz
Algorithm Hash digest
SHA256 51314d964c5875412032baa285f63f7d2555caa391943b750d1d0694fc2ca366
MD5 784c81df62b98f12862278f786244cc7
BLAKE2b-256 11bcc75a3e407772ee8cbfc3e532347311b554cfd871fd155b46f64848d189bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for levalicious_mcp_server_git-0.0.1.tar.gz:

Publisher: python.yml on Levalicious/server-git

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

File details

Details for the file levalicious_mcp_server_git-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for levalicious_mcp_server_git-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc0e84f55ec35087542b14316f768c38526e1a6924a1560995deb2e20298dd42
MD5 7b0bff9213ed0fe00f77074a9ca23ca9
BLAKE2b-256 307b45b31969d46449d1eb10e367a9eccbb07a667b301663290d7b8c5b5cca62

See more details on using hashes here.

Provenance

The following attestation bundles were made for levalicious_mcp_server_git-0.0.1-py3-none-any.whl:

Publisher: python.yml on Levalicious/server-git

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