The GitLab MCP Server provides comprehensive GitLab project management capabilities to AI clients through a Model Context Protocol interface, enabling operations on projects, merge requests, issues, pipelines, wiki, and releases. It offers multiple authentication methods including Personal Access Tokens, OAuth2 with browser-based flows, and remote authorization support, with compatibility across stdio, SSE, and HTTP transports for clients like Claude, VS Code, Cursor, and Copilot. The server solves the problem of giving AI assistants secure, authenticated access to GitLab resources while supporting various deployment scenarios from local desktop use to remote multi-user server deployments.
claude mcp add gitlab-mcp --env GITLAB_PERSONAL_ACCESS_TOKEN=YOUR_GITLAB_PERSONAL_ACCESS_TOKEN --env GITLAB_JOB_TOKEN=YOUR_GITLAB_JOB_TOKEN --env GITLAB_AUTH_COOKIE_PATH=YOUR_GITLAB_AUTH_COOKIE_PATH --env GITLAB_API_URL=https://gitlab.com/api/v4 --env GITLAB_ALLOWED_PROJECT_IDS=YOUR_GITLAB_ALLOWED_PROJECT_IDS --env GITLAB_READ_ONLY_MODE=false --env USE_GITLAB_WIKI=false --env GITLAB_TOOLSETS=YOUR_GITLAB_TOOLSETS --env GITLAB_TOOLS=YOUR_GITLAB_TOOLS --env GITLAB_DENIED_TOOLS_REGEX=YOUR_GITLAB_DENIED_TOOLS_REGEX --env GITLAB_TOOL_POLICY_APPROVE=YOUR_GITLAB_TOOL_POLICY_APPROVE --env GITLAB_TOOL_POLICY_HIDDEN=YOUR_GITLAB_TOOL_POLICY_HIDDEN --env NODE_TLS_REJECT_UNAUTHORIZED=YOUR_NODE_TLS_REJECT_UNAUTHORIZED --env GITLAB_CA_CERT_PATH=YOUR_GITLAB_CA_CERT_PATH -- npx -y @zereight/mcp-gitlabRun in your terminal. Replace YOUR_* placeholders with real values; add --scope user to install for every project.
Review the command, arguments, and environment values before installing — MCP servers run with your local permissions.
Verified live against the running server on Jun 10, 2026.
merge_merge_requestMerge a merge request8 paramsMerge a merge request
squashbooleanauto_mergebooleanproject_id*stringmerge_request_iidstringmerge_commit_messagestringsquash_commit_messagestringshould_remove_source_branchbooleanmerge_when_pipeline_succeedsbooleanapprove_merge_requestApprove a merge request4 paramsApprove a merge request
shastringproject_id*stringapproval_passwordstringmerge_request_iid*stringunapprove_merge_requestUnapprove a merge request2 paramsUnapprove a merge request
project_id*stringmerge_request_iid*stringget_merge_request_approval_stateGet merge request approval details including approvers2 paramsGet merge request approval details including approvers
project_id*stringmerge_request_iid*stringget_merge_request_conflictsGet the conflicts of a merge request2 paramsGet the conflicts of a merge request
project_id*stringmerge_request_iid*stringlist_merge_request_pipelinesList pipelines for a merge request with pagination4 paramsList pipelines for a merge request with pagination
pagenumberper_pagenumberproject_id*stringmerge_request_iid*stringcreate_or_update_fileCreate or update a file in a GitLab project8 paramsCreate or update a file in a GitLab project
branch*stringcontent*stringcommit_idstringfile_path*stringproject_id*stringprevious_pathstringcommit_message*stringlast_commit_idstringsearch_repositoriesSearch for GitLab projects4 paramsSearch for GitLab projects
pagenumberquerystringsearchstringper_pagenumbercreate_repositoryCreate a new GitLab project4 paramsCreate a new GitLab project
name*stringvisibilitystringprivate · internal · publicdescriptionstringinitialize_with_readmebooleancreate_groupCreate new group or subgroup5 paramsCreate new group or subgroup
name*stringpath*stringparent_idnumbervisibilitystringprivate · internal · publicdescriptionstringget_file_contentsGet contents of a file or directory from a GitLab project4 paramsGet contents of a file or directory from a GitLab project
refstringpathstringfile_pathstringproject_idstringpush_filesPush multiple files in a single commit4 paramsPush multiple files in a single commit
files*arraybranch*stringproject_id*stringcommit_message*stringcreate_issueCreate a new issue8 paramsCreate a new issue
title*stringlabelsarrayweightnumberissue_typestringissue · incident · test_case · taskdefault: issueproject_id*stringdescriptionstringassignee_idsarraymilestone_idstringcreate_merge_requestCreate a new merge request13 paramsCreate a new merge request
draftbooleantitle*stringlabelsarraysquashbooleanproject_id*stringdescriptionstringassignee_idsarrayreviewer_idsarraysource_branch*stringtarget_branch*stringtarget_project_idstringallow_collaborationbooleanremove_source_branchbooleanfork_repositoryFork a project to your account or specified namespace2 paramsFork a project to your account or specified namespace
namespacestringproject_id*stringcreate_branchCreate a new branch3 paramsCreate a new branch
refstringbranch*stringproject_id*stringget_branchGet branch details (commit, protection status)2 paramsGet branch details (commit, protection status)
project_id*stringbranch_name*stringlist_branchesList branches in project with search filter4 paramsList branches in project with search filter
pagenumbersearchstringper_pagenumberproject_id*stringdelete_branchDelete branch from project2 paramsDelete branch from project
project_id*stringbranch_name*stringget_merge_requestGet details of a merge request (mergeRequestIid or branchName required)3 paramsGet details of a merge request (mergeRequestIid or branchName required)
project_id*stringsource_branchstringmerge_request_iidstringget_merge_request_diffsGet the changes/diffs of a merge request (mergeRequestIid or branchName required)5 paramsGet the changes/diffs of a merge request (mergeRequestIid or branchName required)
viewstringinline · parallelproject_id*stringsource_branchstringmerge_request_iidstringexcluded_file_patternsarraylist_merge_request_changed_filesList changed file paths in a merge request without diff content (mergeRequestIid or branchName required)4 paramsList changed file paths in a merge request without diff content (mergeRequestIid or branchName required)
project_id*stringsource_branchstringmerge_request_iidstringexcluded_file_patternsarraylist_merge_request_diffsList merge request diffs with pagination (mergeRequestIid or branchName required)6 paramsList merge request diffs with pagination (mergeRequestIid or branchName required)
pagenumberunidiffbooleanper_pagenumberproject_id*stringsource_branchstringmerge_request_iidstringget_merge_request_file_diffGet diffs for specific files from a merge request (mergeRequestIid or branchName required)5 paramsGet diffs for specific files from a merge request (mergeRequestIid or branchName required)
unidiffbooleanfile_paths*arrayproject_id*stringsource_branchstringmerge_request_iidstringlist_merge_request_versionsList all versions of a merge request2 paramsList all versions of a merge request
project_id*stringmerge_request_iid*stringget_merge_request_versionGet a specific version of a merge request4 paramsGet a specific version of a merge request
unidiffbooleanproject_id*stringversion_id*stringmerge_request_iid*stringget_branch_diffsGet diffs between two branches or commits5 paramsGet diffs between two branches or commits
to*stringfrom*stringstraightbooleanproject_id*stringexcluded_file_patternsarrayupdate_merge_requestUpdate a merge request (mergeRequestIid or branchName required)13 paramsUpdate a merge request (mergeRequestIid or branchName required)
draftbooleantitlestringlabelsarraysquashbooleanproject_id*stringdescriptionstringstate_eventstringclose · reopenassignee_idsarrayreviewer_idsarraysource_branchstringtarget_branchstringmerge_request_iidstringremove_source_branchbooleancreate_noteCreate a new note (comment) to an issue or merge request4 paramsCreate a new note (comment) to an issue or merge request
body*stringproject_id*stringnoteable_iid*stringnoteable_type*stringissue · merge_requestcreate_merge_request_threadCreate a new thread on a merge request5 paramsCreate a new thread on a merge request
body*stringpositionobjectcreated_atstringproject_id*stringmerge_request_iid*stringresolve_merge_request_threadResolve a thread on a merge request4 paramsResolve a thread on a merge request
resolved*booleanproject_id*stringdiscussion_id*stringmerge_request_iid*stringmr_discussionsList discussion items for a merge request4 paramsList discussion items for a merge request
pagenumberper_pagenumberproject_id*stringmerge_request_iid*stringdelete_merge_request_discussion_noteDelete a discussion note on a merge request4 paramsDelete a discussion note on a merge request
note_id*stringproject_id*stringdiscussion_id*stringmerge_request_iid*stringupdate_merge_request_discussion_noteUpdate a discussion note on a merge request6 paramsUpdate a discussion note on a merge request
bodystringnote_idstringresolvedbooleanproject_idstringdiscussion_idstringmerge_request_iidstringcreate_merge_request_discussion_noteAdd a new discussion note to an existing merge request thread5 paramsAdd a new discussion note to an existing merge request thread
body*stringcreated_atstringproject_id*stringdiscussion_id*stringmerge_request_iid*stringcreate_merge_request_noteAdd a new note to a merge request3 paramsAdd a new note to a merge request
body*stringproject_id*stringmerge_request_iid*stringdelete_merge_request_noteDelete an existing merge request note3 paramsDelete an existing merge request note
note_id*stringproject_id*stringmerge_request_iid*stringget_merge_request_noteGet a specific note for a merge request3 paramsGet a specific note for a merge request
note_id*stringproject_id*stringmerge_request_iid*stringget_merge_request_notesList notes for a merge request6 paramsList notes for a merge request
pagenumbersortstringasc · descorder_bystringcreated_at · updated_atper_pagenumberproject_id*stringmerge_request_iid*stringupdate_merge_request_noteModify an existing merge request note4 paramsModify an existing merge request note
body*stringnote_id*stringproject_id*stringmerge_request_iid*stringget_draft_noteGet a single draft note from a merge request3 paramsGet a single draft note from a merge request
project_id*stringdraft_note_id*stringmerge_request_iid*stringlist_draft_notesList draft notes for a merge request2 paramsList draft notes for a merge request
project_id*stringmerge_request_iid*stringcreate_draft_noteCreate a draft note for a merge request6 paramsCreate a draft note for a merge request
body*stringpositionobjectproject_id*stringmerge_request_iid*stringresolve_discussionbooleanin_reply_to_discussion_idstringupdate_draft_noteUpdate an existing draft note6 paramsUpdate an existing draft note
bodystringpositionobjectproject_id*stringdraft_note_id*stringmerge_request_iid*stringresolve_discussionbooleandelete_draft_noteDelete a draft note3 paramsDelete a draft note
project_id*stringdraft_note_id*stringmerge_request_iid*stringpublish_draft_notePublish a single draft note3 paramsPublish a single draft note
project_id*stringdraft_note_id*stringmerge_request_iid*stringbulk_publish_draft_notesPublish all draft notes for a merge request2 paramsPublish all draft notes for a merge request
project_id*stringmerge_request_iid*stringlist_merge_request_emoji_reactionsList all emoji reactions on a merge request2 paramsList all emoji reactions on a merge request
project_id*stringmerge_request_iid*stringlist_merge_request_note_emoji_reactionsList all emoji reactions on a merge request note. Pass discussion_id for discussion thread replies.4 paramsList all emoji reactions on a merge request note. Pass discussion_id for discussion thread replies.
note_id*stringproject_id*stringdiscussion_idstringmerge_request_iid*stringcreate_merge_request_emoji_reactionAdd an emoji reaction to a merge request (e.g. thumbsup, rocket, eyes)3 paramsAdd an emoji reaction to a merge request (e.g. thumbsup, rocket, eyes)
name*stringproject_id*stringmerge_request_iid*stringdelete_merge_request_emoji_reactionRemove an emoji reaction from a merge request3 paramsRemove an emoji reaction from a merge request
award_id*stringproject_id*stringmerge_request_iid*stringcreate_merge_request_note_emoji_reactionAdd an emoji reaction to a merge request note. Pass discussion_id for discussion thread replies.5 paramsAdd an emoji reaction to a merge request note. Pass discussion_id for discussion thread replies.
name*stringnote_id*stringproject_id*stringdiscussion_idstringmerge_request_iid*stringdelete_merge_request_note_emoji_reactionRemove an emoji reaction from a merge request note. Pass discussion_id for discussion thread replies.5 paramsRemove an emoji reaction from a merge request note. Pass discussion_id for discussion thread replies.
note_id*stringaward_id*stringproject_id*stringdiscussion_idstringmerge_request_iid*stringupdate_issue_noteModify an existing issue thread note6 paramsModify an existing issue thread note
bodystringnote_idstringresolvedbooleanissue_iidstringproject_idstringdiscussion_idstringcreate_issue_noteAdd a note to an issue, optionally replying to a discussion thread5 paramsAdd a note to an issue, optionally replying to a discussion thread
body*stringissue_iid*stringcreated_atstringproject_id*stringdiscussion_idstringlist_issue_emoji_reactionsList all emoji reactions on an issue2 paramsList all emoji reactions on an issue
issue_iid*stringproject_id*stringlist_issue_note_emoji_reactionsList all emoji reactions on an issue note. Pass discussion_id for discussion thread replies.4 paramsList all emoji reactions on an issue note. Pass discussion_id for discussion thread replies.
note_id*stringissue_iid*stringproject_id*stringdiscussion_idstringcreate_issue_emoji_reactionAdd an emoji reaction to an issue (e.g. thumbsup, rocket, eyes)3 paramsAdd an emoji reaction to an issue (e.g. thumbsup, rocket, eyes)
name*stringissue_iid*stringproject_id*stringdelete_issue_emoji_reactionRemove an emoji reaction from an issue3 paramsRemove an emoji reaction from an issue
award_id*stringissue_iid*stringproject_id*stringcreate_issue_note_emoji_reactionAdd an emoji reaction to an issue note. Pass discussion_id for discussion thread replies.5 paramsAdd an emoji reaction to an issue note. Pass discussion_id for discussion thread replies.
name*stringnote_id*stringissue_iid*stringproject_id*stringdiscussion_idstringdelete_issue_note_emoji_reactionRemove an emoji reaction from an issue note. Pass discussion_id for discussion thread replies.5 paramsRemove an emoji reaction from an issue note. Pass discussion_id for discussion thread replies.
note_id*stringaward_id*stringissue_iid*stringproject_id*stringdiscussion_idstringlist_issuesList issues (default: created by current user; use scope='all' for all)21 paramsList issues (default: created by current user; use scope='all' for all)
pagenumberscopestringcreated_by_me · assigned_to_me · allstatestringopened · closed · alllabelsarraysearchstringdue_datestringper_pagenumberauthor_idstringmilestonestringissue_typestringissue · incident · test_case · taskproject_idstringassignee_idstringconfidentialbooleaniteration_idstringcreated_afterstringupdated_afterstringcreated_beforestringupdated_beforestringauthor_usernamestringassignee_usernamearraywith_labels_detailsbooleanmy_issuesList issues assigned to the authenticated user11 paramsList issues assigned to the authenticated user
pagenumberstatestringopened · closed · alllabelsarraysearchstringper_pagenumbermilestonestringproject_idstringcreated_afterstringupdated_afterstringcreated_beforestringupdated_beforestringget_issueGet details of a specific issue2 paramsGet details of a specific issue
issue_iid*stringproject_id*stringupdate_issueUpdate an issue13 paramsUpdate an issue
titlestringlabelsarrayweightnumberdue_datestringissue_iid*stringissue_typestringissue · incident · test_case · taskproject_id*stringdescriptionstringstate_eventstringclose · reopenassignee_idsarrayconfidentialbooleanmilestone_idstringdiscussion_lockedbooleanupdate_issue_description_patchApply a patch (search/replace or unified diff) to an issue description. Reduces token usage by allowing small changes without sending the full description. Supports dry_run to preview changes and create_note to summarize updates.7 paramsApply a patch (search/replace or unified diff) to an issue description. Reduces token usage by allowing small changes without sending the full description. Supports dry_run to preview changes and create_note to summarize updates.
patch*stringdry_runbooleanissue_iid*stringpatch_type*stringsearch_replace · unified_diffproject_id*stringcreate_notebooleanallow_multiplebooleandelete_issueDelete an issue2 paramsDelete an issue
issue_iid*stringproject_id*stringlist_todosList GitLab to-do items for the current user8 paramsList GitLab to-do items for the current user
pagenumbertypestringIssue · MergeRequest · Commit · Epic · DesignManagement::Design · AlertManagement::Alertstatestringpending · doneactionstringassigned · mentioned · build_failed · marked · approval_required · unmergeablegroup_idnumberper_pagenumberauthor_idnumberproject_idnumbermark_todo_doneMark a GitLab to-do item as done1 paramsMark a GitLab to-do item as done
id*numbermark_all_todos_doneMark all pending GitLab to-do items as done for the current userMark all pending GitLab to-do items as done for the current user
No parameters — call it with no arguments.
list_issue_linksList all issue links for a specific issue2 paramsList all issue links for a specific issue
issue_iid*stringproject_id*stringlist_issue_discussionsList discussions for an issue4 paramsList discussions for an issue
pagenumberper_pagenumberissue_iid*stringproject_id*stringget_issue_linkGet a specific issue link3 paramsGet a specific issue link
issue_iid*stringproject_id*stringissue_link_id*stringcreate_issue_linkCreate an issue link between two issues5 paramsCreate an issue link between two issues
issue_iid*stringlink_typestringrelates_to · blocks · is_blocked_byproject_id*stringtarget_issue_iid*stringtarget_project_id*stringdelete_issue_linkDelete an issue link3 paramsDelete an issue link
issue_iid*stringproject_id*stringissue_link_id*stringlist_namespacesList all namespaces (users and groups) available to the current user. Filter by kind='group' for groups only.4 paramsList all namespaces (users and groups) available to the current user. Filter by kind='group' for groups only.
pagenumberownedbooleansearchstringper_pagenumberget_namespaceGet details of a namespace (user or group) by ID or path. Groups are namespaces with kind='group'.1 paramsGet details of a namespace (user or group) by ID or path. Groups are namespaces with kind='group'.
namespace_id*stringverify_namespaceVerify if a namespace path exists1 paramsVerify if a namespace path exists
path*stringget_projectGet details of a specific project1 paramsGet details of a specific project
project_id*stringlist_projectsList projects accessible by the current user15 paramsList projects accessible by the current user
pagenumbersortstringasc · descownedbooleantopicstringsearchstringsimplebooleanarchivedbooleanorder_bystringid · name · path · created_at · updated_at · last_activity_atper_pagenumbermembershipbooleanvisibilitystringpublic · internal · privatemin_access_levelnumbersearch_namespacesbooleanwith_issues_enabledbooleanwith_merge_requests_enabledboolean📖 Documentation → Setup guides, environment variables, and the full tool reference live on the hosted docs site.
New Feature: Dynamic GitLab API URL support with connection pooling! See Dynamic API URL Documentation for details.
A comprehensive GitLab MCP server for AI clients. Manage projects, merge requests, issues, pipelines, wiki, releases, tags, milestones, and more through stdio, SSE, and Streamable HTTP.
Supports PAT, OAuth, read-only mode, dynamic API URLs, and remote authorization for VS Code, Claude, Cursor, Copilot, and other MCP clients.
Quick start: choose either Personal Access Token or OAuth2 setup below and use @zereight/mcp-gitlab in your MCP client configuration.
The server supports four authentication methods:
For local/desktop use (most common):
GITLAB_PERSONAL_ACCESS_TOKEN) — simplest setupGITLAB_USE_OAUTH) — recommended for better securityFor server/remote deployments:
GITLAB_MCP_OAUTH) — for remote MCP clients such as Claude.aiREMOTE_AUTHORIZATION) — multi-user deployments where each caller provides their own tokenFor the simplest local setup, start with a Personal Access Token. For browser-based local auth, use OAuth2. For remote or multi-user deployments, continue to the MCP OAuth and Remote Authorization sections later in this README.
Some MCP clients (like GitHub Copilot CLI) have issues with environment variables. Use CLI arguments instead:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab",
"--token=YOUR_GITLAB_TOKEN",
"--api-url=https://gitlab.com/api/v4"
],
"tools": ["*"]
}
}
}
Available CLI arguments:
--token - GitLab Personal Access Token (replaces GITLAB_PERSONAL_ACCESS_TOKEN)--api-url - GitLab API URL (replaces GITLAB_API_URL)--read-only=true - Enable read-only mode (replaces GITLAB_READ_ONLY_MODE)--use-wiki=true - Enable wiki API (replaces USE_GITLAB_WIKI)--use-milestone=true - Enable milestone API (replaces USE_MILESTONE)--use-pipeline=true - Enable pipeline API (replaces USE_PIPELINE)CLI arguments take precedence over environment variables.
docker run -i --rm \
-e HOST=0.0.0.0 \
-e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \
-e GITLAB_API_URL="https://gitlab.com/api/v4" \
-e GITLAB_READ_ONLY_MODE=true \
-e USE_GITLAB_WIKI=true \
-e USE_MILESTONE=true \
-e USE_PIPELINE=true \
-e SSE=true \
-p 3333:3002 \
zereight050/gitlab-mcp
{
"mcpServers": {
"gitlab": {
"type": "sse",
"url": "http://localhost:3333/sse"
}
}
}
docker run -i --rm \
-e HOST=0.0.0.0 \
-e REMOTE_AUTHORIZATION=true \
-e GITLAB_API_URL="https://gitlab.com/api/v4" \
-e GITLAB_READ_ONLY_MODE=true \
-e USE_GITLAB_WIKI=true \
-e USE_MILESTONE=true \
-e USE_PIPELINE=true \
-e STREAMABLE_HTTP=true \
-p 3333:3002 \
zereight050/gitlab-mcp
{
"mcpServers": {
"gitlab": {
"type": "streamable-http",
"url": "http://localhost:3333/mcp",
"headers": {
"Authorization": "Bearer glpat-..."
}
}
}
}
GITLAB_MCP_OAUTH)For server/remote deployments only. This mode requires the MCP server to be deployed with a publicly accessible HTTPS URL. For local/desktop use, see
GITLAB_USE_OAUTHabove.
For remote MCP clients that support the MCP OAuth specification (e.g. Claude.ai).
The server acts as a full OAuth 2.0 authorization server — unauthenticated requests
receive a 401 + WWW-Authenticate response, which triggers the OAuth browser flow
automatically on the client side.
Remote MCP clients such as OpenCode, MCPJam, and Claude.ai can send their own
callback URL during authorization. If you cannot register every client callback
URL in GitLab, enable GITLAB_OAUTH_CALLBACK_PROXY=true. With callback proxy
mode, GitLab only needs one registered redirect URI: {MCP_SERVER_URL}/callback.
GITLAB_OAUTH_REDIRECT_URI is for local OAuth (GITLAB_USE_OAUTH) only. It does
not override remote MCP OAuth client callback URLs and should not be used to fix
remote Unregistered redirect_uri errors.
This variable exists because the local OAuth flow starts a browser on the same
machine as the MCP server and listens for the callback on a local HTTP server,
for example http://127.0.0.1:8888/callback.
Remote MCP OAuth is different. In GITLAB_MCP_OAUTH=true mode, the MCP client
provides its own callback URL during /authorize. GITLAB_OAUTH_REDIRECT_URI
does not replace that client-provided URL.
| Mode | Enable with | Callback variable | GitLab redirect URI |
|---|---|---|---|
| Local OAuth | GITLAB_USE_OAUTH=true | GITLAB_OAUTH_REDIRECT_URI | http://127.0.0.1:8888/callback or your local callback |
| Remote MCP OAuth | GITLAB_MCP_OAUTH=true | GITLAB_OAUTH_CALLBACK_PROXY=true | {MCP_SERVER_URL}/callback |
Use GITLAB_OAUTH_REDIRECT_URI only when the MCP server itself owns the local
browser callback. Use GITLAB_OAUTH_CALLBACK_PROXY=true when a remote MCP client
owns the callback URL.
How it works: You deploy this MCP server somewhere with a public HTTPS URL. MCP
clients connect to {MCP_SERVER_URL}/mcp. The server handles the OAuth 2.0 flow,
exchanging credentials with GitLab on behalf of the client.
Prerequisites:
MCP_SERVER_URL) — use ngrok for local testingapi (or read_api) scopes
— Go to Admin area → Applications, set Redirect URI to {MCP_SERVER_URL}/callback| Environment Variable | Required | Description |
|---|---|---|
GITLAB_MCP_OAUTH | ✅ | Set to true to enable |
GITLAB_API_URL | ✅ | GitLab API base URL |
GITLAB_OAUTH_APP_ID | ✅ | GitLab OAuth Application ID |
MCP_SERVER_URL | ✅ | Public HTTPS URL of this MCP server |
STREAMABLE_HTTP | ✅ | Must be true |
GITLAB_OAUTH_CALLBACK_PROXY | optional | Set to true to use the MCP server's fixed /callback URL |
GITLAB_OAUTH_SCOPES | optional | Comma-separated scopes (default: api,read_api,read_user) |
GITLAB_OAUTH_ALLOWED_GROUPS | optional | Comma-separated group full paths — only members (and subgroup members) may obtain a token (replaces deprecated GITLAB_ALLOWED_GROUPS) |
When STREAMABLE_HTTP=true, server-side GITLAB_PERSONAL_ACCESS_TOKEN or GITLAB_JOB_TOKEN require REMOTE_AUTHORIZATION=true or GITLAB_MCP_OAUTH=true.
Troubleshooting
Unregistered redirect_uriCheck the
redirect_uriin the browser URL. If it points to a client callback such ashttp://127.0.0.1:xxxxx/.../callback, enable:GITLAB_OAUTH_CALLBACK_PROXY=trueDo not fix remote MCP OAuth by changing
GITLAB_OAUTH_REDIRECT_URI. That variable is for local OAuth (GITLAB_USE_OAUTH) only.
docker run -i --rm \
-e HOST=0.0.0.0 \
-e GITLAB_MCP_OAUTH=true \
-e GITLAB_OAUTH_CALLBACK_PROXY=true \
-e STREAMABLE_HTTP=true \
-e MCP_SERVER_URL=https://your-server.example.com \
-e GITLAB_API_URL="https://gitlab.com/api/v4" \
-e GITLAB_OAUTH_APP_ID=your_app_id \
-p 3000:3002 \
zereight050/gitlab-mcp
MCP client configuration:
{
"mcpServers": {
"gitlab": {
"type": "http",
"url": "https://your-server.example.com/mcp"
}
}
}
REMOTE_AUTHORIZATION)For server/remote deployments only. Each HTTP caller provides their own GitLab token directly in request headers — no OAuth flow involved.
For multi-user or multi-tenant deployments where each caller provides their own GitLab token in the HTTP request header. No OAuth flow — the MCP server forwards the token to GitLab on behalf of the caller.
Header priority: Private-Token > JOB-TOKEN > Authorization: Bearer
| Environment Variable | Required | Description |
|---|---|---|
REMOTE_AUTHORIZATION | ✅ | Set to true to enable |
STREAMABLE_HTTP | ✅ | Must be true |
ENABLE_DYNAMIC_API_URL | optional | Allow per-request GitLab URL via X-GitLab-API-URL header |
GITLAB_ALLOW_UNAUTHENTICATED_TOOL_DISCOVERY | optional | Allow unauthenticated initialize, notifications/initialized, and tools/list only (tool calls still require auth) |
MCP_TRUST_PROXY | optional | Trust Forwarded / X-Forwarded-* headers behind a reverse proxy (download URLs, Express req.ip, OAuth rate limits) |
GITLAB_ALLOW_UNAUTHENTICATED_TOOL_DISCOVERY=true is intended for MCP gateways
or admin UIs that need to inspect tool metadata before a user provides a GitLab
token. Leave it disabled unless the tool list is safe to expose in your deployment.
When MCP_SERVER_URL is not set, remote download URLs fall back to the local
server address. Set MCP_TRUST_PROXY=true only if the server is reachable through a
trusted reverse proxy and direct client access to the MCP server is blocked.
This enables Express trust proxy for Streamable HTTP and SSE, derives public
download URLs from Forwarded / X-Forwarded-Proto / X-Forwarded-Host /
X-Forwarded-Prefix, and keeps OAuth endpoint rate limiting working when
proxies send X-Forwarded-For with a client port (for example 1.2.3.4:5678).
Existing OAuth+proxy deployments must set this explicitly after the flag was
introduced.
Example request headers:
Private-Token: glpat-xxxxxxxxxxxxxxxxxxxx
or using a Bearer token:
Authorization: Bearer glpat-xxxxxxxxxxxxxxxxxxxx
⚠️
REMOTE_AUTHORIZATIONis not compatible with SSE transport.STREAMABLE_HTTP=trueis required.
Use the dedicated reference for the full environment variable list:
Most users only need one of these starting sets:
GITLAB_PERSONAL_ACCESS_TOKEN, GITLAB_API_URLGITLAB_USE_OAUTH=true, GITLAB_OAUTH_CLIENT_ID, GITLAB_OAUTH_REDIRECT_URI, GITLAB_API_URLSTREAMABLE_HTTP=true, REMOTE_AUTHORIZATION=true, HOST, PORTOAUTH_STATELESS_MODE=true, OAUTH_STATELESS_SECRET (same across all pods). See Stateless Mode.Commonly referenced variables:
GITLAB_API_URLGITLAB_PERSONAL_ACCESS_TOKENGITLAB_USE_OAUTHREMOTE_AUTHORIZATIONMCP_TRUST_PROXYGITLAB_MCP_OAUTHGITLAB_OAUTH_CALLBACK_PROXYOAUTH_STATELESS_MODEOAUTH_STATELESS_SECRETThe reference document also covers:
discover_tools (on-demand toolset activation)For callback proxy mode details, see GitLab MCP OAuth Callback Proxy.
When using REMOTE_AUTHORIZATION=true, the MCP server can support multiple users, each with their own GitLab token passed via HTTP headers. This is useful for:
Setup Example:
# Start server with remote authorization
docker run -d \
-e HOST=0.0.0.0 \
-e STREAMABLE_HTTP=true \
-e REMOTE_AUTHORIZATION=true \
-e GITLAB_API_URL="https://gitlab.com/api/v4" \
-e GITLAB_READ_ONLY_MODE=true \
-e SESSION_TIMEOUT_SECONDS=3600 \
-p 3333:3002 \
zereight050/gitlab-mcp
Client Configuration:
Your IDE or MCP client must send one of these headers with each request:
Authorization: Bearer glpat-xxxxxxxxxxxxxxxxxxxx
or
Private-Token: glpat-xxxxxxxxxxxxxxxxxxxx
The token is stored per session (identified by mcp-session-id header) and reused for subsequent requests in the same session.
{
"mcpServers": {
"GitLab": {
"url": "http(s)://<your_mcp_gitlab_server>/mcp",
"headers": {
"Authorization": "Bearer glpat-..."
}
}
}
}
Important Notes:
SESSION_TIMEOUT_SECONDS (default 1 hour) of inactivity. After timeout, the client must send auth headers again. The transport session remains active.MAX_REQUESTS_PER_MINUTE requests per minute (default 60)MAX_SESSIONS concurrent sessions (default 1000)When using GITLAB_MCP_OAUTH=true, the server acts as an OAuth proxy to your GitLab
instance. Claude.ai (and any MCP-spec-compliant client) handles the entire browser
authentication flow automatically — no manual Personal Access Token management needed.
Prerequisites:
A pre-registered GitLab OAuth application is required. GitLab restricts dynamically
registered (unverified) applications to the mcp scope, which is insufficient for API
calls (need api or read_api).
api, read_api, read_user (or whichever scopes you intend to request via GITLAB_OAUTH_SCOPES)GITLAB_OAUTH_APP_IDHow it works:
/.well-known/oauth-authorization-serverPOST /register) — handled locally by the MCP server (each client gets a virtual client ID)https://claude.ai/api/mcp/auth_callbackAuthorization: Bearer <token> on every MCP requestServer setup:
docker run -d \
-e STREAMABLE_HTTP=true \
-e GITLAB_MCP_OAUTH=true \
-e GITLAB_OAUTH_APP_ID="your-gitlab-oauth-app-client-id" \
-e GITLAB_API_URL="https://gitlab.example.com/api/v4" \
-e MCP_SERVER_URL="https://your-mcp-server.example.com" \
-p 3002:3002 \
zereight050/gitlab-mcp
For local development (HTTP allowed):
MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL=true \
STREAMABLE_HTTP=true \
GITLAB_MCP_OAUTH=true \
GITLAB_OAUTH_APP_ID=your-gitlab-oauth-app-client-id \
MCP_SERVER_URL=http://localhost:3002 \
GITLAB_API_URL=https://gitlab.com/api/v4 \
node build/index.js
Claude.ai configuration:
{
"mcpServers": {
"GitLab": {
"url": "https://your-mcp-server.example.com/mcp"
}
}
}
No headers field is needed — Claude.ai obtains the token via OAuth automatically.
Environment variables:
| Variable | Required | Description |
|---|---|---|
GITLAB_MCP_OAUTH | Yes | Set to true to enable |
GITLAB_OAUTH_APP_ID | Yes | Client ID of the pre-registered GitLab OAuth application |
MCP_SERVER_URL | Yes | Public HTTPS URL of your MCP server |
GITLAB_API_URL | Yes | Your GitLab instance API URL (e.g. https://gitlab.com/api/v4) |
STREAMABLE_HTTP | Yes | Must be true (SSE is not supported) |
GITLAB_OAUTH_SCOPES | No | Comma-separated GitLab scopes to request (e.g. api,read_user). Defaults to api (or read_api when GITLAB_READ_ONLY_MODE=true). The pre-registered application must be configured with at least these scopes. |
MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL | No | Set true for local HTTP dev only |
Important Notes:
SSE=true is incompatible)REMOTE_AUTHORIZATION mode (SESSION_TIMEOUT_SECONDS, MAX_REQUESTS_PER_MINUTE,
MAX_SESSIONS)Private-Token or JOB-TOKEN request headers are
present, OAuth validation is skipped and the raw token is used directly for that
session. This allows PATs and CI job tokens to be used alongside the OAuth flow on
the same server instance. Authorization: Bearer is always treated as an OAuth
token — use Private-Token for PAT-based header auth.Pre-built skill files are available in skills/gitlab-mcp/ for AI agents that support skill/instruction loading (Claude Code, GitHub Copilot, Cursor, etc.).
Install with the skills CLI:
npx skills add zereight/gitlab-mcp --skill gitlab-mcp-skill
Register the skill directory in your AI client to get optimal tool usage guidance without relying solely on the full ListTools response.
merge_merge_request - Merge a merge request in a GitLab projectcreate_or_update_file - Create or update a single file in a GitLab projectsearch_repositories - Search for GitLab projectscreate_repository - Create a new GitLab projectcreate_group - Create a new GitLab group or subgroup (name, path, description, visibility, and optional parent_id)get_file_contents - Get the contents of a file or directory from a GitLab projectpush_files - Push multiple files to a GitLab project in a single commitcreate_issue - Create a new issue in a GitLab projectcreate_merge_request - Create a new merge request in a GitLab projectfork_repository - Fork a GitLab project to your account or specified namespacecreate_branch - Create a new branch in a GitLab projectget_merge_request - Get details of a merge request with compact deployment summary, behind-count, commit addition summary, and approval summary (Either mergeRequestIid or branchName must be provided)get_merge_request_diffs - Get the changes/diffs of a merge request (Either mergeRequestIid or branchName must be provided)list_merge_request_diffs - List merge request diffs with pagination support (Either mergeRequestIid or branchName must be provided)get_merge_request_conflicts - Get the conflicts of a merge request in a GitLab projectlist_merge_request_changed_files - STEP 1 of code review workflow. Returns ONLY the list of changed file paths in a merge request — WITHOUT diff content. Call this first to get file paths, then call get_merge_request_file_diff with multiple files in a single batched call (recommended 3-5 files per call). Supports excluded_file_patterns filtering using regex. (Either mergeRequestIid or branchName must be provided)get_merge_request_file_diff - STEP 2 of code review workflow. Get diffs for one or more files from a merge request. Call list_merge_request_changed_files first, then pass them as an array to fetch diffs efficiently. Batching multiple files (recommended 3-5) is supported. (Either mergeRequestIid or branchName must be provided)list_merge_request_versions - List all versions of a merge requestget_merge_request_version - Get a specific version of a merge requestget_branch_diffs - Get the changes/diffs between two branches or commits in a GitLab projectupdate_merge_request - Update a merge request (Either mergeRequestIid or branchName must be provided)create_note - Create a new note (comment) to an issue or merge requestcreate_merge_request_thread - Create a new thread on a merge requestmr_discussions - List discussion items for a merge requestresolve_merge_request_thread - Resolve a thread on a merge requestupdate_merge_request_note - Modify an existing merge request thread notecreate_merge_request_note - Add a new note to an existing merge request threaddelete_merge_request_discussion_note - Delete a discussion note on a merge requestupdate_merge_request_discussion_note - Update a discussion note on a merge requestcreate_merge_request_discussion_note - Add a new discussion note to an existing merge request threaddelete_merge_request_note - Delete an existing merge request noteget_merge_request_note - Get a specific note for a merge requestget_merge_request_notes - List notes for a merge requestget_draft_note - Get a single draft note from a merge requestlist_draft_notes - List draft notes for a merge requestcreate_draft_note - Create a draft note for a merge requestupdate_draft_note - Update an existing draft notedelete_draft_note - Delete a draft notepublish_draft_note - Publish a single draft notebulk_publish_draft_notes - Publish all draft notes for a merge requestlist_merge_requests - List merge requests globally or in a specific GitLab project with filtering options (project_id is now optional)approve_merge_request - Approve a merge request (requires appropriate permissions)unapprove_merge_request - Unapprove a previously approved merge requestget_merge_request_approval_state - Get merge request approval details including approvers (uses approval_state when available, otherwise falls back to approvals)update_issue_note - Modify an existing issue thread notecreate_issue_note - Add a new note to an existing issue threadlist_issues - List issues (default: created by current user only; use scope='all' for all accessible issues)my_issues - List issues assigned to the authenticated user (defaults to open issues)get_issue - Get details of a specific issue in a GitLab projectupdate_issue - Update an issue in a GitLab projectupdate_issue_description_patch - Apply a patch (search/replace or unified diff) to an issue description. Reduces token usage by sending only the change instead of the full description. Supports dry_run to preview and create_note to summarize.delete_issue - Delete an issue from a GitLab projectlist_todos - List GitLab to-do items for the current usermark_todo_done - Mark a GitLab to-do item as donemark_all_todos_done - Mark all pending GitLab to-do items as done for the current userlist_issue_links - List all issue links for a specific issuelist_issue_discussions - List discussions for an issue in a GitLab projectget_issue_link - Get a specific issue linkcreate_issue_link - Create an issue link between two issuesdelete_issue_link - Delete an issue linklist_namespaces - List all namespaces available to the current userget_namespace - Get details of a namespace by ID or pathverify_namespace - Verify if a namespace path existsget_project - Get details of a specific projectlist_projects - List projects accessible by the current userlist_project_members - List members of a GitLab projectlist_group_projects - List projects in a GitLab group with filtering optionslist_group_iterations - List group iterations with filtering optionslist_labels - List labels for a projectget_label - Get a single label from a projectcreate_label - Create a new label in a projectupdate_label - Update an existing label in a projectdelete_label - Delete a label from a projectlist_pipelines - List pipelines in a GitLab project with filtering optionsget_pipeline - Get details of a specific pipeline in a GitLab projectlist_pipeline_jobs - List all jobs in a specific pipelinelist_pipeline_trigger_jobs - List all trigger jobs (bridges) in a specific pipeline that trigger downstream pipelinesget_pipeline_job - Get details of a GitLab pipeline job numberget_pipeline_job_output - Get the output/trace of a GitLab pipeline job with optional pagination to limit context window usagevalidate_ci_lint - Validate provided GitLab CI/CD YAML content for a projectvalidate_project_ci_lint - Validate an existing .gitlab-ci.yml configuration for a projectcreate_pipeline - Create a new pipeline for a branch or tagretry_pipeline - Retry a failed or canceled pipelinecancel_pipeline - Cancel a running pipelineplay_pipeline_job - Run a manual pipeline jobretry_pipeline_job - Retry a failed or canceled pipeline jobcancel_pipeline_job - Cancel a running pipeline joblist_deployments - List deployments in a GitLab project with filtering optionsget_deployment - Get details of a specific deployment in a GitLab projectlist_environments - List environments in a GitLab projectget_environment - Get details of a specific environment in a GitLab projectlist_job_artifacts - List artifact files in a job's artifacts archive. Returns file names, paths, types, and sizesdownload_job_artifacts - Download the entire artifact archive (zip) for a job to a local path. Returns the saved file pathget_job_artifact_file - Get the content of a single file from a job's artifacts by its path within the archivelist_milestones - List milestones in a GitLab project with filtering optionsget_milestone - Get details of a specific milestonecreate_milestone - Create a new milestone in a GitLab projectedit_milestone - Edit an existing milestone in a GitLab projectdelete_milestone - Delete a milestone from a GitLab projectget_milestone_issue - Get issues associated with a specific milestoneget_milestone_merge_requests - Get merge requests associated with a specific milestonepromote_milestone - Promote a milestone to the next stageget_milestone_burndown_events - Get burndown events for a specific milestonelist_wiki_pages - List wiki pages in a GitLab projectget_wiki_page - Get details of a specific wiki pagecreate_wiki_page - Create a new wiki page in a GitLab projectupdate_wiki_page - Update an existing wiki page in a GitLab projectdelete_wiki_page - Delete a wiki page from a GitLab projectlist_group_wiki_pages - List wiki pages in a GitLab groupget_group_wiki_page - Get details of a specific group wiki pagecreate_group_wiki_page - Create a new wiki page in a GitLab groupupdate_group_wiki_page - Update an existing wiki page in a GitLab groupdelete_group_wiki_page - Delete a wiki page from a GitLab groupget_repository_tree - Get the repository tree for a GitLab project (list files and directories)list_commits - List repository commits with filtering optionsget_commit - Get details of a specific commitget_commit_diff - Get changes/diffs of a specific commitlist_commit_statuses - List statuses for a specific commitcreate_commit_status - Create or update the status of a specific commitlist_releases - List all releases for a projectget_release - Get a release by tag namecreate_release - Create a new release in a GitLab projectupdate_release - Update an existing release in a GitLab projectdelete_release - Delete a release from a GitLab project (does not delete the associated tag)create_release_evidence - Create release evidence for an existing release (GitLab Premium/Ultimate only)download_release_asset - Download a release asset file by direct asset pathlist_tags - List repository tags with filtering and pagination supportget_tag - Get details of a specific repository tagcreate_tag - Create a new tag in the repositorydelete_tag - Delete a tag from the repositoryget_tag_signature - Get the signature of a signed tagget_users - Get GitLab user details by usernameslist_events - List all events for the currently authenticated userget_project_events - List all visible events for a specified projectupload_markdown - Upload a file to a GitLab project for use in markdown contentdownload_attachment - Download an uploaded file from a GitLab project by secret and filenameget_work_item - Get a single work item with full details including status, hierarchy (parent/children), type, labels, assignees, and all widgetslist_work_items - List work items in a project with filters (type, state, search, assignees, labels). Returns items with status and hierarchy infocreate_work_item - Create a new work item (issue, task, incident, test_case, epic, key_result, objective, requirement, ticket). Supports setting title, description, labels, assignees, weight, parent, health status, start/due dates, milestone, and confidentialityupdate_work_item - Update a work item. Can modify title, description, labels, assignees, weight, state, status, parent hierarchy, children, health status, start/due dates, milestone, confidentiality, linked items, and custom fieldsconvert_work_item_type - Convert a work item to a different type (e.g. issue to task, task to incident)list_work_item_statuses - List available statuses for a work item type in a project. Requires GitLab Premium/Ultimate with configurable statuseslist_custom_field_definitions - List available custom field definitions for a work item type in a project. Returns field names, types, and IDs needed for setting custom fields via update_work_itemmove_work_item - Move a work item (issue, task, etc.) to a different project. Uses GitLab GraphQL issueMove mutationlist_work_item_notes - List notes and discussions on a work item. Returns threaded discussions with author, body, timestamps, and system/internal flagscreate_work_item_note - Add a note/comment to a work item. Supports Markdown, internal notes, and threaded repliesget_timeline_events - List timeline events for an incident. Returns chronological events with notes, timestamps, and tagscreate_timeline_event - Create a timeline event on an incident. Supports tags: 'Start time', 'End time', 'Impact detected', 'Response initiated', 'Impact mitigated', 'Cause identified'list_webhooks - List all configured webhooks for a GitLab project or group. Provide either project_id or group_idlist_webhook_events - List recent webhook events (past 7 days) for a project or group webhook. Use summary mode for overview, then get_webhook_event for full detailsget_webhook_event - Get full details of a specific webhook event by ID, including request/response payloadssearch_code - Search for code across all projects on the GitLab instance (requires advanced search or exact code search to be enabled)search_project_code - Search for code within a specific GitLab project (requires advanced search or exact code search to be enabled)search_group_code - Search for code within a specific GitLab group (requires advanced search or exact code search to be enabled)execute_graphql - Execute a GitLab GraphQL querylist_merge_request_pipelines - List pipelines for a merge request with pagination supportlist_project_variables - List CI/CD variables for a project with optional environment scope filterget_project_variable - Get a single CI/CD variable from a project by key, with optional environment scope filtercreate_project_variable - Create a new CI/CD variable in a projectupdate_project_variable - Update an existing CI/CD variable in a project, with optional filter to disambiguate by environment scopedelete_project_variable - Delete a CI/CD variable from a project, with optional filter to disambiguate by environment scopelist_group_variables - List CI/CD variables for a group with optional environment scope filterget_group_variable - Get a single CI/CD variable from a group by key, with optional environment scope filtercreate_group_variable - Create a new CI/CD variable in a groupupdate_group_variable - Update an existing CI/CD variable in a group, with optional filter to disambiguate by environment scopedelete_group_variable - Delete a CI/CD variable from a group, with optional filter to disambiguate by environment scopeget_dependency_proxy_settings - Get dependency proxy settings for a group (enabled status, blob count, total size, image prefix, TTL policy)update_dependency_proxy_settings - Update dependency proxy settings for a group (enable/disable, credentials for authenticated Docker Hub pulls)list_dependency_proxy_blobs - List cached dependency proxy blobs for a group with cursor-based paginationpurge_dependency_proxy_cache - Schedule purge of all cached dependency proxy blobs for a groupThe project includes comprehensive test coverage including remote authorization:
# Run all tests (API validation + remote auth)
npm test
# Run only remote authorization tests
npm run test:remote-auth
# Run all tests including readonly MCP tests
npm run test:all
# Run only API validation
npm run test:integration
All remote authorization tests use a mock GitLab server and do not require actual GitLab credentials.
GITLAB_PERSONAL_ACCESS_TOKEN*secretGitLab personal access token for local stdio use. Create a token with the GitLab scopes needed by the tools you plan to use, such as api or read_api.
GITLAB_JOB_TOKENsecretOptional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.
GITLAB_AUTH_COOKIE_PATHOptional path to a GitLab authentication cookie file for cookie-based authentication.
GITLAB_API_URLdefault: https://gitlab.com/api/v4GitLab API base URL. Use https://gitlab.com/api/v4 for GitLab.com or your self-managed GitLab API URL.
GITLAB_ALLOWED_PROJECT_IDSOptional comma-separated list of GitLab project IDs that this server is allowed to access.
GITLAB_READ_ONLY_MODEdefault: falseSet to true to expose only read-only tools and block write operations.
USE_GITLAB_WIKIdefault: falseSet to true to enable GitLab wiki tools.
GITLAB_TOOLSETSOptional comma-separated list of toolsets to enable, such as projects, issues, merge_requests, pipelines, releases, users, groups, wiki, or search.
GITLAB_TOOLSOptional comma-separated list of individual tool names to add on top of enabled toolsets.
GITLAB_DENIED_TOOLS_REGEXOptional regular expression used to hide matching tools from the server.
GITLAB_TOOL_POLICY_APPROVEOptional comma-separated list of tool names that require explicit approval before execution.
GITLAB_TOOL_POLICY_HIDDENOptional comma-separated list of tool names to hide from tools/list.
NODE_TLS_REJECT_UNAUTHORIZEDSet to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates.
GITLAB_CA_CERT_PATHOptional path to a custom CA certificate file for self-managed GitLab instances.
ray0907/git-mcp-server
cyanheads/git-mcp-server
io.github.b1ff/atlassian-dc-mcp-bitbucket
io.github.b1ff/atlassian-dc-mcp-jira
com.mcparmory/atlassian-jira
sirlordt/vscode-terminal-mcp