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 "Install 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 Serverlist 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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.Last updated45115,8751MIT
- AlicenseCqualityAmaintenanceA 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.Last updated246Apache 2.0
- Flicense-qualityDmaintenanceAn 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.Last updated2
- Alicense-qualityDmaintenanceAn 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.Last updated171ISC
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ray0907/git-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server