# Git MCP Server

> Git MCP Server is an open-source MCP server for developer tools. MCP server giving AI clients read and write access to GitHub and GitLab repositories. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, self-hosted
- **Repository:** https://github.com/ray0907/git-mcp-server
- **MCP Registry name:** io.github.Ray0907/git-mcp-server
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The README describes this as a modular MCP server that works with both GitHub and GitLab, so one configuration pattern covers either host. It exposes tools for repository files and branches, issues, pull or merge requests, CI pipelines and job logs, comments, and the current user.

Setup is a JSON entry for an MCP client such as Claude Desktop, launched through npx from the @raytien/git-mcp-server npm package. A personal access token is required. Self-hosted GitHub Enterprise and self-hosted GitLab are supported through a custom API URL, and a read-only switch disables write operations.

It suits developers who want an assistant to browse code, triage issues, open merge requests or check pipeline failures without leaving the chat. The README also notes that GitHub Actions runs map onto GitLab pipelines, so the same tool names work on both platforms.

## Features

- **Dual provider support:** Works with GitHub, GitLab.com and self-hosted instances of either through the GIT_PROVIDER and GIT_API_URL settings.
- **Repository and branch tools:** Reads files, lists directory trees and commits, searches code, pushes multi-file commits and creates branches.
- **Issue and merge request tools:** Lists, fetches, creates and updates issues, and creates, reviews diffs for and merges pull or merge requests.
- **CI pipeline inspection:** Lists pipelines and workflow runs, their jobs, and fetches job log output.
- **Read-only mode:** A GIT_READ_ONLY setting disables all write operations for safer exploration.
- **Comment management:** Lists and adds comments on issues and merge requests.

## Good for

- Asking an AI assistant to summarise open issues and suggest priorities
- Drafting and opening a merge request from a set of local file changes
- Diagnosing a failed CI pipeline by reading its job logs
- Searching a codebase for a function or pattern across a repository
- Auditing repository activity in read-only mode

## Install

### Claude Code (Terminal)

```sh
claude mcp add git-mcp-server --env GIT_TOKEN='<GIT_TOKEN>' -- npx -y @raytien/git-mcp-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "git-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@raytien/git-mcp-server"
      ],
      "env": {
        "GIT_TOKEN": "<GIT_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "git-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@raytien/git-mcp-server"
      ],
      "env": {
        "GIT_TOKEN": "<GIT_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "git-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@raytien/git-mcp-server"
      ],
      "env": {
        "GIT_TOKEN": "<GIT_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "git-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@raytien/git-mcp-server"
      ],
      "env": {
        "GIT_TOKEN": "<GIT_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "git-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@raytien/git-mcp-server"
      ],
      "env": {
        "GIT_TOKEN": "<GIT_TOKEN>"
      }
    }
  }
}
```

## Tools

- `get_file_contents`: Read file content from repository
- `get_repository_tree`: List directory structure
- `push_files`: Push file changes in a single commit
- `create_branch`: Create a new branch
- `list_branches`: List repository branches
- `list_commits`: List commit history
- `search_code`: Search for code in repository
- `get_issue`: Get a single issue
- `list_issues`: List issues
- `create_issue`: Create a new issue
- `update_issue`: Update an issue
- `get_pull_request`: Get a merge request
- `list_pull_requests`: List merge requests
- `create_pull_request`: Create a merge request
- `get_pull_request_diffs`: Get merge request changes
- `merge_pull_request`: Merge a merge request
- `get_pipeline`: Get pipeline/workflow run status
- `list_pipelines`: List pipelines/workflow runs
- `list_pipeline_jobs`: List pipeline jobs/workflow jobs
- `get_job_log`: Get job log output
- `create_comment`: Add comment to issue/MR
- `list_comments`: List comments
- `get_me`: Get current authenticated user

## FAQ

### Which platforms does it support?

The README says it supports GitHub and GitLab, including GitHub Enterprise and self-hosted GitLab through a custom API URL.

### Do I need an access token?

Yes. GIT_TOKEN is required, and the README gives setup steps for creating a GitHub classic token or a GitLab access token with specific scopes.

### Can it run without write access?

Yes. Setting GIT_READ_ONLY to true disables write operations.

### How is it installed?

The README configures it in Claude Desktop with npx running the @raytien/git-mcp-server package.

### Is Git MCP Server free?

Yes. Git MCP Server is open source, so you can use and self-host it for free.

### How do I add Git MCP Server to Claude Code?

Run this command in your terminal: claude mcp add git-mcp-server --env GIT_TOKEN='<GIT_TOKEN>' -- npx -y @raytien/git-mcp-server

### What are the best alternatives to Git MCP Server?

The closest alternatives to Git MCP Server are Git MCP, GitHub, GitEasy MCP, Advanced GitLab MCP server and GitLab MCP Server.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Git MCP](https://ai-powered.com/mcp/git-mcp): Git MCP is an open-source MCP server for developer tools.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [GitEasy MCP](https://ai-powered.com/mcp/giteasy-mcp): GitEasy MCP is a freemium MCP server for developer tools.
- [Advanced GitLab MCP server](https://ai-powered.com/mcp/advanced-gitlab-mcp-server): Advanced GitLab MCP server is an open-source MCP server for developer tools.
- [GitLab MCP Server](https://ai-powered.com/mcp/gitlab-mcp-server-4): GitLab MCP Server is an open-source MCP server for developer tools.
- [GitHub to MCP Converter](https://ai-powered.com/mcp/github-to-mcp-converter): GitHub to MCP Converter is an open-source MCP server for developer tools.
- [Git Diff Mcp](https://ai-powered.com/mcp/git-diff-mcp): Git Diff Mcp is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/git-mcp-server
