mcp-server-git


Namemcp-server-git JSON
Version 0.6.1 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs
upload_time2024-11-29 18:08:00
maintainerNone
docs_urlNone
authorAnthropic, PBC.
requires_python>=3.10
licenseMIT
keywords automation git llm mcp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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`](https://docs.astral.sh/uv/) no specific installation is needed. We will
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) 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`:

<details>
<summary>Using uvx</summary>

```json
"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
```
</details>

<details>
<summary>Using pip installation</summary>

```json
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
  }
}
```
</details>

### Usage with [Zed](https://github.com/zed-industries/zed)

Add to your Zed settings.json:

<details>
<summary>Using uvx</summary>

```json
"context_servers": [
  "mcp-server-git": {
    "command": {
      "path": "uvx",
      "args": ["mcp-server-git"]
    }
  }
],
```
</details>

<details>
<summary>Using pip installation</summary>

```json
"context_servers": {
  "mcp-server-git": {
    "command": {
      "path": "python",
      "args": ["-m", "mcp_server_git"]
    }
  }
},
```
</details>

## 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-server-git",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "David Soria Parra <davidsp@anthropic.com>",
    "keywords": "automation, git, llm, mcp",
    "author": "Anthropic, PBC.",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/19/a1/0b6b87df08fd1336be4bd647c313a32f9e217e21b339ebb4adcc77f62c74/mcp_server_git-0.6.1.tar.gz",
    "platform": null,
    "description": "# mcp-server-git: A git MCP server\n\n## Overview\n\nA 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.\n\nPlease 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.\n\n### Tools\n\n1. `git_status`\n   - Shows the working tree status\n   - Input:\n     - `repo_path` (string): Path to Git repository\n   - Returns: Current status of working directory as text output\n\n2. `git_diff_unstaged`\n   - Shows changes in working directory not yet staged\n   - Input:\n     - `repo_path` (string): Path to Git repository\n   - Returns: Diff output of unstaged changes\n\n3. `git_diff_staged`\n   - Shows changes that are staged for commit\n   - Input:\n     - `repo_path` (string): Path to Git repository\n   - Returns: Diff output of staged changes\n\n4. `git_commit`\n   - Records changes to the repository\n   - Inputs:\n     - `repo_path` (string): Path to Git repository\n     - `message` (string): Commit message\n   - Returns: Confirmation with new commit hash\n\n5. `git_add`\n   - Adds file contents to the staging area\n   - Inputs:\n     - `repo_path` (string): Path to Git repository\n     - `files` (string[]): Array of file paths to stage\n   - Returns: Confirmation of staged files\n\n6. `git_reset`\n   - Unstages all staged changes\n   - Input:\n     - `repo_path` (string): Path to Git repository\n   - Returns: Confirmation of reset operation\n\n7. `git_log`\n   - Shows the commit logs\n   - Inputs:\n     - `repo_path` (string): Path to Git repository\n     - `max_count` (number, optional): Maximum number of commits to show (default: 10)\n   - Returns: Array of commit entries with hash, author, date, and message\n\n\n## Installation\n\n### Using uv (recommended)\n\nWhen using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will\nuse [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*.\n\n### Using PIP\n\nAlternatively you can install `mcp-server-git` via pip:\n\n```\npip install mcp-server-git\n```\n\nAfter installation, you can run it as a script using:\n\n```\npython -m mcp_server_git\n```\n\n## Configuration\n\n### Usage with Claude Desktop\n\nAdd this to your `claude_desktop_config.json`:\n\n<details>\n<summary>Using uvx</summary>\n\n```json\n\"mcpServers\": {\n  \"git\": {\n    \"command\": \"uvx\",\n    \"args\": [\"mcp-server-git\", \"--repository\", \"path/to/git/repo\"]\n  }\n}\n```\n</details>\n\n<details>\n<summary>Using pip installation</summary>\n\n```json\n\"mcpServers\": {\n  \"git\": {\n    \"command\": \"python\",\n    \"args\": [\"-m\", \"mcp_server_git\", \"--repository\", \"path/to/git/repo\"]\n  }\n}\n```\n</details>\n\n### Usage with [Zed](https://github.com/zed-industries/zed)\n\nAdd to your Zed settings.json:\n\n<details>\n<summary>Using uvx</summary>\n\n```json\n\"context_servers\": [\n  \"mcp-server-git\": {\n    \"command\": {\n      \"path\": \"uvx\",\n      \"args\": [\"mcp-server-git\"]\n    }\n  }\n],\n```\n</details>\n\n<details>\n<summary>Using pip installation</summary>\n\n```json\n\"context_servers\": {\n  \"mcp-server-git\": {\n    \"command\": {\n      \"path\": \"python\",\n      \"args\": [\"-m\", \"mcp_server_git\"]\n    }\n  }\n},\n```\n</details>\n\n## Debugging\n\nYou can use the MCP inspector to debug the server. For uvx installations:\n\n```\nnpx @modelcontextprotocol/inspector uvx mcp-server-git\n```\n\nOr if you've installed the package in a specific directory or are developing on it:\n\n```\ncd path/to/servers/src/git\nnpx @modelcontextprotocol/inspector uv run mcp-server-git\n```\n\n## License\n\nThis 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.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs",
    "version": "0.6.1",
    "project_urls": null,
    "split_keywords": [
        "automation",
        " git",
        " llm",
        " mcp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e852157f9aea51839573f4af140f3adf659dfe82670266ce8403ea04cd808a7d",
                "md5": "09e9d6f0b179698f1389952551949184",
                "sha256": "60daf2cff1a2786f1c6d0fdc63ee41ec822f7ec858f72e616786ead653708fae"
            },
            "downloads": -1,
            "filename": "mcp_server_git-0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09e9d6f0b179698f1389952551949184",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6156,
            "upload_time": "2024-11-29T18:02:04",
            "upload_time_iso_8601": "2024-11-29T18:02:04.021208Z",
            "url": "https://files.pythonhosted.org/packages/e8/52/157f9aea51839573f4af140f3adf659dfe82670266ce8403ea04cd808a7d/mcp_server_git-0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19a10b6b87df08fd1336be4bd647c313a32f9e217e21b339ebb4adcc77f62c74",
                "md5": "bd2b5152eb9183cafbdc3144766b6203",
                "sha256": "23e0a7d4f4d84fece4cf1a6c46be225b3fd1d7f3b46ff67b3d71bd4f225f1684"
            },
            "downloads": -1,
            "filename": "mcp_server_git-0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bd2b5152eb9183cafbdc3144766b6203",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 18706,
            "upload_time": "2024-11-29T18:08:00",
            "upload_time_iso_8601": "2024-11-29T18:08:00.575733Z",
            "url": "https://files.pythonhosted.org/packages/19/a1/0b6b87df08fd1336be4bd647c313a32f9e217e21b339ebb4adcc77f62c74/mcp_server_git-0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-29 18:08:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mcp-server-git"
}
        
Elapsed time: 3.87672s