
A MCP server for GitLab with powerful, safe, policy-controlled access
概览
A production-ready MCP server for GitLab. It lets AI assistants read and manage GitLab projects, merge requests, issues, pipelines, wikis, releases, and more through a broad, policy-controlled tool registry. - — projects, merge requests (with code-context analysis), issues, pipelines, wikis, milestones, releases, labels, commits, branches, GraphQL, and file management - — stdio for local CLI usage, Streamable HTTP for remote deployments, optional SSE - — personal access tokens, OAuth 2.0 PKCE, external token scripts, token files, cookie-based auth, and per-request remote authorization - — readonly/modify/full modes, tool allowlist/denylist, feature toggles, and project-scoped restrictions - — HTTP/HTTPS proxy, custom CA certificates, Cloudflare bypass, multi-instance API rotation - — JSON, compact JSON, or YAML formatting with configurable response size limits Claude Desktop, Claude Code, VS Code, GitHub Copilot Chat (VS Code), Cursor, JetBrains AI Assistant, GitLab Duo, and any MCP...
README
以下为原文 README 节选,完整内容请查看原文。
gitlab-mcp
A production-ready MCP server for GitLab. It lets AI assistants read and manage GitLab projects, merge requests, issues, pipelines, wikis, releases, and more through a broad, policy-controlled tool registry.
Highlights
- Comprehensive GitLab coverage — projects, merge requests (with code-context analysis), issues, pipelines, wikis, milestones, releases, labels, commits, branches, GraphQL, and file management
- Multiple transports — stdio for local CLI usage, Streamable HTTP for remote deployments, optional SSE
- Flexible authentication — personal access tokens, OAuth 2.0 PKCE, external token scripts, token files, cookie-based auth, and per-request remote authorization
- Policy engine — readonly/modify/full modes, tool allowlist/denylist, feature toggles, and project-scoped restrictions
- Enterprise networking — HTTP/HTTPS proxy, custom CA certificates, Cloudflare bypass, multi-instance API rotation
- Output control — JSON, compact JSON, or YAML formatting with configurable response size limits
Usage
Supported clients
Claude Desktop, Claude Code, VS Code, GitHub Copilot Chat (VS Code), Cursor, JetBrains AI Assistant, GitLab Duo, and any MCP client that supports stdio or streamable HTTP.
Current client format references:
- MCP transports and protocol
- Claude Code MCP
- VS Code MCP servers
- Cursor MCP
- JetBrains AI Assistant MCP
Authentication methods
The server supports three auth patterns:
- Personal Access Token (PAT)
- OAuth 2.0 PKCE (recommended for local interactive use)
- Remote per-request auth (
REMOTE_AUTHORIZATION=true, HTTP mode)
OAuth2 setup (stdio, recommended for local interactive use)
- Create a GitLab OAuth application in
Settings -> Applications. - Set redirect URI to
http://127.0.0.1:8765/callback(or your custom callback). - Set scope to
api. - Copy the Application ID as
GITLAB_OAUTH_CLIENT_ID.
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "gitlab-mcp@latest"],
"env": {
"GITLAB_USE_OAUTH": "true",
"GITLAB_OAUTH_CLIENT_ID": "your_oauth_client_id",
"GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8765/callback",
"GITLAB_API_URL": "https://gitlab.com/api/v4",
"GITLAB_ALLOWED_PROJECT_IDS": "",
"GITLAB_PERMISSION_MODE": "full",
"USE_GITLAB_WIKI": "true",
安装
npx -y gitlab-mcp@latest配置
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "gitlab-mcp@latest"],
"env": {
"GITLAB_USE_OAUTH": "true",
"GITLAB_OAUTH_CLIENT_ID": "your_oauth_client_id",
"GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8765/callback",
"GITLAB_API_URL": "https://gitlab.com/api/v4",
"GITLAB_ALLOWED_PROJECT_IDS": "",
"GITLAB_PERMISSION_MODE": "full",
"USE_GITLAB_WIKI": "true",
"USE_MILESTONE": "true",
"USE_PIPELINE": "true"
}
}
}
}