Git MCP Server
Provides core repository management capabilities including reading file contents, exploring directory structures, creating branches, and pushing commits.
Enables comprehensive interaction with GitHub repositories, allowing for the management of issues, pull requests, and repository comments across both GitHub.com and Enterprise environments.
Allows for monitoring GitHub Actions workflow runs, including checking statuses and retrieving job log output.
Enables interaction with GitLab projects, supporting management of issues, merge requests, pipelines, and project comments for both SaaS and self-hosted instances.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Git MCP Server list the open pull requests in the frontend repository"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "@raytien/git-mcp-server"],
"env": {
"GIT_PROVIDER": "github",
"GIT_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxx"
}
}
}
}GitHub Enterprise
{
"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)
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "@raytien/git-mcp-server"],
"env": {
"GIT_PROVIDER": "gitlab",
"GIT_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Self-Hosted GitLab
{
"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
{
"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
Go to GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic)
Generate new token with scopes:
repo,read:org,workflowCopy the token (starts with
ghp_)
GitLab
Go to GitLab > Settings > Access Tokens
Create a new token with scopes:
api,read_api,read_repository,write_repositoryCopy the token (starts with
glpat-)
Related MCP server: GitHub PR Issue Analyser
Available Tools
Repository
Tool | Description |
| Read file content from repository |
| List directory structure |
| Push file changes in a single commit |
| Create a new branch |
| List repository branches |
| List commit history |
| Search for code in repository |
Issues
Tool | Description |
| Get a single issue |
| List issues |
| Create a new issue |
| Update an issue |
Pull/Merge Requests
Tool | Description |
| Get a merge request |
| List merge requests |
| Create a merge request |
| Get merge request changes |
| Merge a merge request |
CI/CD (Pipelines / Workflow Runs)
Tool | Description |
| Get pipeline/workflow run status |
| List pipelines/workflow runs |
| List pipeline jobs/workflow jobs |
| Get job log output |
Note: GitHub Actions workflow runs map to GitLab pipelines. The same tools work for both platforms.
Comments
Tool | Description |
| Add comment to issue/MR |
| List comments |
Users
Tool | Description |
| Get current authenticated user |
Configuration
Environment Variable | Required | Default | Description |
| No |
| Provider type: |
| Yes | - | Personal Access Token |
| No | Provider default | API URL (auto-detected from provider) |
| No |
| Auth type: |
| No |
| Disable write operations |
| No |
| Log level: |
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/ # UtilitiesDevelopment
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run locally
npm start
# Development mode (watch)
npm run devAdding a New Tool
Create file:
src/tools/{category}/{action}.ts
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, ...);
},
});Export from category index:
src/tools/{category}/index.tsAdd to allTools:
src/tools/index.ts
Inspired By
gitlab-mcp - GitLab MCP server
github-mcp-server - Official GitHub MCP server
License
MIT
Available Tools
23 toolscreate_branchA
Create a new branch in the repository. Use this before making code changes to work on a separate branch.
Inputs: repo (required), name (required), ref (required).
create_commentC
Add a comment to an issue or pull request
Inputs: repo (required), type (required), number (required), body (required).
create_issueC
Create a new issue in a project
Inputs: repo (required), title (required), description, labels, +1 more.
create_pull_requestC
Create a new pull request (merge request in GitLab)
Inputs: repo (required), source_branch (required), target_branch (required), title (required), +5 more.
get_file_contentsB
Get the contents of a file or directory from a repository
Inputs: repo (required), path (required), ref.
get_issueC
Get details of a specific issue in a project
Inputs: repo (required), issue_number (required).
get_job_logC
Get the log/trace output of a CI/CD job
Inputs: repo (required), job_id (required).
get_meB
Get information about the currently authenticated user.
Inputs: no named parameters.
get_pipelineC
Get details of a specific CI/CD pipeline (workflow run in GitHub)
Inputs: repo (required), pipeline_id (required).
get_pull_requestB
Get details of a pull request (merge request in GitLab)
Inputs: repo (required), pr_number (required).
get_pull_request_diffsC
Get the changes/diffs of a pull request to see what files were modified
Inputs: repo (required), pr_number (required).
get_repository_treeC
List files and directories in a repository. Use recursive=true to get full tree.
Inputs: repo (required), path, ref, recursive, +2 more.
list_branchesB
List branches in a repository. Optionally search for specific branches.
Inputs: repo (required), search, page, per_page.
list_commentsC
List all comments on an issue or pull request
Inputs: repo (required), type (required), number (required), sort, +2 more.
list_commitsC
List commits in a repository. Filter by branch, path, date range, or author.
Inputs: repo (required), ref, path, since, +5 more.
list_issuesC
List issues in a project with optional filters
Inputs: repo (required), state, labels, search, +6 more.
list_pipeline_jobsC
List all jobs in a CI/CD pipeline to see results
Inputs: repo (required), pipeline_id (required), status, page, +1 more.
list_pipelinesB
List CI/CD pipelines (workflow runs in GitHub) with optional filters
Inputs: repo (required), status, ref, sha, +3 more.
list_pull_requestsC
List pull requests (merge requests in GitLab) with optional filters
Inputs: repo (required), state, source_branch, target_branch, +6 more.
merge_pull_requestC
Merge a pull request (merge request in GitLab)
Inputs: repo (required), pr_number (required), commit_message, squash, +1 more.
push_filesA
Push multiple files to a repository in a single commit. Supports create, update, delete, and move actions.
Inputs: repo (required), branch (required), message (required), actions (required), +3 more.
search_codeB
Search for code in a repository. Returns matching files and lines.
Inputs: repo (required), query (required), ref, page, +1 more.
update_issueC
Update an existing issue in a project
Inputs: repo (required), issue_number (required), title, description, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes targeting specific resources and actions, but some potential overlap exists between get_file_contents and get_repository_tree for file/directory listing, and between create_comment and list_comments for comment-related operations. Descriptions help clarify boundaries, but an agent might occasionally need to choose between similar tools.
All tool names follow a consistent verb_noun pattern with clear, descriptive names. The naming convention is uniform throughout the set, using snake_case consistently and predictable verb choices like create, get, list, update, merge, push, and search.
With 23 tools, the count is on the higher side for a Git server, bordering on heavy. While the tools cover a broad range of Git and CI/CD operations, some might be considered specialized or redundant, making the surface feel slightly bloated compared to a more minimal set.
The tool set provides comprehensive coverage for Git operations, including repository management, branching, issues, pull requests, CI/CD pipelines, and file operations. It supports full CRUD/lifecycle workflows for key resources like issues and pull requests, with no obvious gaps that would hinder agent functionality.
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Create, deploy, and operate MCP servers directly from your GitHub repositories.
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.451MIT
- AlicenseAqualityBmaintenanceA MCP server that bridges LLMs with GitHub repository management, enabling automated analysis of pull requests, issue management, tag creation, and release management through natural language.446Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables Git repository operations and GitHub PR workflows, allowing users to manage repositories, create branches, commit changes, and create pull requests through natural language.2-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that wraps the GitHub CLI to provide comprehensive access to repository management, pull requests, issues, and workflows. It enables users to perform complex GitHub operations and interact with the GitHub API through a standardized interface.1ISC