Git Mcp Server

io.github.Ray0907Published by GitHub account Ray0907v0.2.3Updated Oct 24, 2026

MCP server for GitLab and GitHub

VerifiedSTDIODesktop onlyCloud & InfrastructureDeveloper Tools

Overview

AI-generated overview

Local MCP server that lets an assistant read and modify GitHub or GitLab repositories, issues, merge requests, CI pipelines and comments.

What you can do
  • Read and search repository content: file contents, directory trees, branches, commit history and code search
  • Write to repositories: push file changes in one commit and create branches
  • Read, list, create and update issues
  • Read, list, create, diff and merge pull/merge requests
  • Inspect CI/CD pipelines and workflow runs, list jobs and fetch job logs
  • Add and list comments on issues and merge requests, and look up the authenticated user
When to use it
Useful when you want an assistant to work directly with a GitHub or GitLab project from the desktop client: reviewing code and merge requests, triaging issues, checking pipeline status or committing small file changes without leaving the chat.
Requirements
Runs locally via npx from the npm package, so Node.js is needed. Requires a personal access token in GIT_TOKEN (GitHub scopes repo, read:org, workflow; GitLab scopes api, read_api, read_repository, write_repository). GIT_PROVIDER selects github or gitlab (default gitlab); GIT_API_URL points at self-hosted or Enterprise instances. Network access to the provider API.
Before you install
The token grants broad repository access, including write scopes, and is stored in the client configuration file. Write tools can push commits, create branches, open or merge merge requests, create and update issues, and post comments. Set GIT_READ_ONLY to true to disable write operations if you only need reading. All requests go to the configured provider API endpoint.

Installation

In SourceWeft

  1. Open Git Mcp Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Git MCP Server

A clean, modular Git MCP server supporting both GitHub and GitLab.

Quick Start

Claude Desktop Configuration

Add to your claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

GitHub
json
{  "mcpServers": {    "git": {      "command": "npx",      "args": ["-y", "@raytien/git-mcp-server"],      "env": {        "GIT_PROVIDER": "github",        "GIT_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"      }    }  }}
GitHub Enterprise
json
{  "mcpServers": {    "git": {      "command": "npx",      "args": ["-y", "@raytien/git-mcp-server"],      "env": {        "GIT_PROVIDER": "github",        "GIT_API_URL": "https://github.your-company.com/api/v3",        "GIT_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"      }    }  }}
GitLab.com (SaaS)
json
{  "mcpServers": {    "git": {      "command": "npx",      "args": ["-y", "@raytien/git-mcp-server"],      "env": {        "GIT_PROVIDER": "gitlab",        "GIT_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"      }    }  }}
Self-Hosted GitLab
json
{  "mcpServers": {    "git": {      "command": "npx",      "args": ["-y", "@raytien/git-mcp-server"],      "env": {        "GIT_PROVIDER": "gitlab",        "GIT_API_URL": "https://gitlab.your-company.com/api/v4",        "GIT_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"      }    }  }}
Read-Only Mode
json
{  "mcpServers": {    "git": {      "command": "npx",      "args": ["-y", "@raytien/git-mcp-server"],      "env": {        "GIT_PROVIDER": "github",        "GIT_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx",        "GIT_READ_ONLY": "true"      }    }  }}

Get Your Token

GitHub
  1. Go to GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic)
  2. Generate new token with scopes: repo, read:org, workflow
  3. Copy the token (starts with ghp_)
GitLab
  1. Go to GitLab > Settings > Access Tokens
  2. Create a new token with scopes: api, read_api, read_repository, write_repository
  3. Copy the token (starts with glpat-)

Available Tools

Repository

ToolDescription
get_file_contentsRead file content from repository
get_repository_treeList directory structure
push_filesPush file changes in a single commit
create_branchCreate a new branch
list_branchesList repository branches
list_commitsList commit history
search_codeSearch for code in repository

Issues

ToolDescription
get_issueGet a single issue
list_issuesList issues
create_issueCreate a new issue
update_issueUpdate an issue

Pull/Merge Requests

ToolDescription
get_pull_requestGet a merge request
list_pull_requestsList merge requests
create_pull_requestCreate a merge request
get_pull_request_diffsGet merge request changes
merge_pull_requestMerge a merge request

CI/CD (Pipelines / Workflow Runs)

ToolDescription
get_pipelineGet pipeline/workflow run status
list_pipelinesList pipelines/workflow runs
list_pipeline_jobsList pipeline jobs/workflow jobs
get_job_logGet job log output

Note: GitHub Actions workflow runs map to GitLab pipelines. The same tools work for both platforms.

Comments

ToolDescription
create_commentAdd comment to issue/MR
list_commentsList comments

Users

ToolDescription
get_meGet current authenticated user

Configuration

Environment VariableRequiredDefaultDescription
GIT_PROVIDERNogitlabProvider type: gitlab or github
GIT_TOKENYes-Personal Access Token
GIT_API_URLNoProvider defaultAPI URL (auto-detected from provider)
GIT_AUTH_TYPENobearerAuth type: bearer or private-token
GIT_READ_ONLYNofalseDisable write operations
LOG_LEVELNoinfoLog level: debug, info, warn, error

Architecture

src/├── index.ts              # Entry point├── server.ts             # MCP server (provider-agnostic)├── config.ts             # Configuration (multi-provider)├── providers/            # Platform abstraction│   ├── interface.ts      # GitProvider interface│   ├── types.ts          # Platform-agnostic types│   ├── config.ts         # Provider configuration│   ├── factory.ts        # Provider Factory (creates GitLab/GitHub)│   ├── gitlab/           # GitLab implementation│   └── github/           # GitHub implementation├── tools/                # Tool definitions│   ├── define.ts         # defineTool helper│   ├── registry.ts       # Tool registry│   ├── repository/       # Repository tools│   ├── issues/           # Issue tools│   ├── merge-requests/   # PR/MR tools│   ├── pipelines/        # CI/CD tools│   ├── notes/            # Comment tools│   └── users/            # User tools├── gitlab/               # GitLab API client│   ├── client.ts         # HTTP client│   └── types.ts          # GitLab API types├── github/               # GitHub API client│   ├── client.ts         # HTTP client│   └── types.ts          # GitHub API types├── auth/                 # Authentication└── lib/                  # Utilities

Development

bash
# Install dependenciesnpm install
# Buildnpm run build
# Run testsnpm test
# Run locallynpm start
# Development mode (watch)npm run dev

Adding a New Tool

  1. Create file: src/tools/{category}/{action}.ts
typescript
import { z } from 'zod';import { defineTool, repoParam } from '../define.js';
const schema = z.object({    repo: repoParam,    // ... your params});
export const myTool = defineTool({    name: 'my_tool',    description: 'What this tool does',    schema,    category: 'my-category',    read_only: true,    handler: async (input, ctx) => {        return ctx.provider.repository.someMethod(input.repo, ...);    },});
  1. Export from category index: src/tools/{category}/index.ts
  2. Add to allTools: src/tools/index.ts

Inspired By

License

MIT

Source: README.md at commit 8c0ae3a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.3LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts