Skip to main content
Glama

mcp-git - Git MCP Server

NPM Version Bun Version License

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.

MCP Server Usage

This package is designed to be used as an MCP server with clients like Claude Desktop. Here's how to configure it:

Basic Configuration

Add this to your MCP client configuration:

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": ["-y", "mcp-git"]
    }
  }
}

Advanced Configuration

For custom settings:

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": ["-y", "mcp-git"]
    }
  }
}

Related MCP server: Git Workflow MCP Server

Installation Options

From Source

  1. Clone this repository

  2. Install dependencies:

    bun install
  3. Build:

    bun run build
  4. Run:

    bun run start

Available Git Tools

The server provides these MCP-accessible Git operations:

Repository Operations

  • git_status - Show working tree status

  • git_init - Initialize new repository

  • git_log - View commit history (with max_count parameter)

Change Management

  • git_diff_unstaged - View unstaged changes

  • git_diff_staged - View staged changes

  • git_diff - Compare with branch/commit

  • git_add - Stage files

  • git_reset - Unstage changes

  • git_commit - Create commit

Branch Operations

  • git_create_branch - Create new branch

  • git_checkout - Switch branches

Content Inspection

  • git_show - View commit contents

Development

Prerequisites

  • Bun v1.2.8 or later

  • Git installed system-wide

Building

bun run build

Testing

bun test

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss proposed changes.

License

MIT

Available Tools

15 tools
git_addA

Adds file contents to the staging area

Inputs: repo_path (required), files (required).

git_checkoutC

Switches branches

Inputs: repo_path (required), branch_name (required).

git_commitC

Records changes to the repository

Inputs: repo_path (required), message (required).

git_create_branchC

Creates a new branch

Inputs: repo_path (required), branch_name (required), start_point.

git_diffC

Shows differences between branches or commits

Inputs: repo_path (required), target (required).

git_diff_stagedA

Shows changes that are staged for commit

Inputs: repo_path (required).

git_diff_unstagedA

Shows changes in working directory not yet staged

Inputs: repo_path (required).

git_initB

Initializes a Git repository

Inputs: repo_path (required).

git_logC

Shows the commit logs

Inputs: repo_path (required), max_count.

git_resetC

Unstages all staged changes

Inputs: repo_path (required).

git_showC

Shows the contents of a commit

Inputs: repo_path (required), revision (required).

git_stashB

Stashes changes in working directory

Inputs: repo_path (required).

git_stash_applyA

Applies a single stashed state without removing it

Inputs: repo_path (required).

git_stash_popB

Applies and removes a single stashed state

Inputs: repo_path (required).

git_statusB

Shows the working tree status

Inputs: repo_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 15 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose and targets a different Git operation. There is no ambiguity between tools like git_diff, git_diff_staged, and git_diff_unstaged, or between git_stash, git_stash_apply, and git_stash_pop.

    Naming Consistency5/5

    All tools follow the consistent 'git_<verb>' pattern with snake_case. The naming is uniform and predictable, making it easy for an agent to infer tool behavior from its name.

    Tool Count5/5

    With 15 tools, the server is well-scoped for a Git client. It covers essential operations without being overwhelming or too sparse. Each tool serves a clear purpose in the standard Git workflow.

    Completeness4/5

    The tool set covers core local Git operations such as staging, committing, branching, diffing, stashing, and log viewing. However, it lacks tools for remote operations like push, pull, fetch, and merge, which are important for typical Git usage and might require agents to work around.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to fetch, search, and retrieve markdown content from remote Git repositories. Supports both public and private repositories with authentication, allowing AI assistants to access documentation and notes stored in Git.
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.
      10
      145 npm
      ISC