• Version Control
JavaScript
MIT
5,148
-
security - not tested
A
license - permissive license (MIT)
-
quality - not tested

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.

  1. Tools
  2. Prompts
  3. Resources
  4. Server Configuration
  5. README.md

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription

No tools

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

README.md

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_diff
    • Shows differences between branches or commits
    • Inputs:
      • repo_path (string): Path to Git repository
      • target (string): Target branch or commit to compare with
    • 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
  11. 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

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:

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

Usage with Zed

Add to your Zed settings.json:

<details> <summary>Using uvx</summary>
"context_servers": [ "mcp-server-git": { "command": { "path": "uvx", "args": ["mcp-server-git"] } } ],
</details> <details> <summary>Using pip installation</summary>
"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

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:
"git": { "command": "uv", "args": [ "--directory", "/<path to mcp-servers>/mcp-servers/src/git", "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.

GitHub Badge

Glama performs regular codebase and documentation scans to:

  • Confirm that the MCP server is working as expected.
  • Confirm that there are no obvious security issues with dependencies of the server.
  • Extract server characteristics such as tools, resources, prompts, and required parameters.

Our directory badge helps users to quickly asses that the MCP server is safe, server capabilities, and instructions for installing the server.

Copy the following code to your README.md file:

Alternative MCP servers

  • -
    security
    A
    license
    -
    quality
    Provides comprehensive tools for managing GitHub projects, milestones, tasks, and sprints. This server integrates deeply with GitHub Projects V2, offering features like automated kanban workflows, sprint planning, and custom field management.
    MIT
  • A
    security
    F
    license
    A
    quality
    Helps AI read GitHub repository structure and important files. Want to quickly understand what a repo is about? Prompt it with "read https://github.com/adhikasp/mcp-git-ingest and determine how the code technically works".
  • A
    security
    A
    license
    A
    quality
    Model Context Protocol (MCP) server for Atlassian Cloud products (Confluence and Jira). This integration is designed specifically for Atlassian Cloud instances and does not support Atlassian Server or Data Center deployments.
    MIT
  • A
    security
    A
    license
    A
    quality
    MCP Server for the GitLab API, enabling project management, file operations, and more.
    MIT