# git-mcp-server [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/Ray0907/git-mcp-server  
**GitHub Stars:** 0  
**npm Downloads (last month):** 228  
**Views:** 13  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/git-mcp-server

## Description
MCP server for GitLab and GitHub

## Tools
Capabilities this server exposes over MCP:

- **get_file_contents** — Get the contents of a file or directory from a repository
- **get_repository_tree** — List files and directories in a repository. Use recursive=true to get full tree.
- **push_files** — Push multiple files to a repository in a single commit. Supports create, update, delete, and move actions.
- **create_branch** — Create a new branch in the repository. Use this before making code changes to work on a separate branch.
- **list_branches** — List branches in a repository. Optionally search for specific branches.
- **list_commits** — List commits in a repository. Filter by branch, path, date range, or author.
- **search_code** — Search for code in a repository. Returns matching files and lines.
- **get_issue** — Get details of a specific issue in a project
- **list_issues** — List issues in a project with optional filters
- **create_issue** — Create a new issue in a project
- **update_issue** — Update an existing issue in a project
- **get_pull_request** — Get details of a pull request (merge request in GitLab)
- **get_pull_request_diffs** — Get the changes/diffs of a pull request to see what files were modified
- **list_pull_requests** — List pull requests (merge requests in GitLab) with optional filters
- **create_pull_request** — Create a new pull request (merge request in GitLab)
- **merge_pull_request** — Merge a pull request (merge request in GitLab)
- **get_pipeline** — Get details of a specific CI/CD pipeline (workflow run in GitHub)
- **list_pipelines** — List CI/CD pipelines (workflow runs in GitHub) with optional filters
- **list_pipeline_jobs** — List all jobs in a CI/CD pipeline to see results
- **get_job_log** — Get the log/trace output of a CI/CD job
- **create_comment** — Add a comment to an issue or pull request
- **list_comments** — List all comments on an issue or pull request
- **get_me** — Get information about the currently authenticated user.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

**Requires environment variables:** `GIT_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the git-mcp-server MCP server does

The git-mcp-server MCP server exposes a provider-neutral set of GitHub and GitLab operations through MCP. It can read file contents, list repository trees, search code, inspect branches and commits, create branches, and push multiple file changes in one commit.

Repository collaboration is covered through issue and pull or merge request tools. Agents can retrieve, list, create, and update issues; retrieve and list pull or merge requests; inspect request diffs; create requests; and merge them. Comment tools add and list comments on issues or merge requests.

The server also provides CI/CD access. Agents can retrieve or list pipeline and workflow runs, list jobs, and read job logs. GitHub Actions workflow runs are represented through the same pipeline-oriented tools used for GitLab pipelines. The `get_me` tool returns the currently authenticated user.

## How it works

The server selects GitLab or GitHub from configuration and uses a provider abstraction so the MCP tools expose the same general operations for either platform. Provider-specific clients handle the corresponding API calls, while shared tool definitions and platform-agnostic types keep the interface consistent.

Authentication uses a personal access token. GitHub and GitLab require different token scopes, and the API endpoint can be changed for GitHub Enterprise or self-hosted GitLab. The `GIT_AUTH_TYPE` setting supports bearer or private-token authentication.

## Setup and configuration

Run the package with `npx -y @raytien/git-mcp-server` from an MCP client configuration. The README provides a Claude Desktop configuration using the `command` and `args` fields. Set `GIT_PROVIDER` to `github` or `gitlab`; it defaults to `gitlab`. Set `GIT_TOKEN` to a suitable personal access token.

Use `GIT_API_URL` when connecting to GitHub Enterprise or a self-hosted GitLab instance. Set `GIT_READ_ONLY` to `true` to disable write operations. `LOG_LEVEL` accepts `debug`, `info`, `warn`, or `error`, and defaults to `info`.

For GitHub, the documented token scopes are `repo`, `read:org`, and `workflow`. For GitLab, the documented scopes are `api`, `read_api`, `read_repository`, and `write_repository`.

## Tools and capabilities

The tool groups cover:

- Repository files, trees, branches, commits, and code search
- Issues and issue updates
- Pull or merge request creation, review data, diffs, and merging
- Pipelines, workflow runs, jobs, and job logs
- Issue or merge request comments
- Authenticated-user details

The git-mcp-server MCP server supports both read operations and changes, so use read-only mode when the agent should not modify repositories or collaboration records.

## Limitations and notes

Provider behavior depends on the token permissions and the selected API endpoint. Write tools remain available in the interface unless `GIT_READ_ONLY` is enabled, and insufficient token permissions can prevent those operations from succeeding.

It also does not describe fine-grained permission handling beyond token scopes and the global read-only setting.

_Full upstream README: https://allmcps.com/mcp/git-mcp-server/readme_

