gitlab-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GITLAB_TOKEN | Yes | GitLab personal access token with the api scope, sent as the PRIVATE-TOKEN header | |
| GITLAB_BASE_URL | Yes | Instance root, e.g. http://gitlab.example.com (not /api/v4) | |
| GITLAB_READ_ONLY | No | true registers only read-only tools, and the CLI refuses write subcommands | |
| GITLAB_TIMEOUT_MS | No | Request timeout, default 30000 | 30000 |
| GITLAB_MAX_RETRIES | No | Retries for 429/502/503/504, default 2 | 2 |
| GITLAB_TLS_REJECT_UNAUTHORIZED | No | false for a self-signed certificate |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gitlab_whoamiA | Get the authenticated user. Call this first: it is the cheapest way to prove the token and base URL work before any write. |
| gitlab_server_versionA | Get the GitLab version answering this token (GET /version). Confirms which version the instance is on, which matters because most public documentation describes newer releases. |
| gitlab_raw_apiA | Call any API v4 endpoint directly - the escape hatch for endpoints with no dedicated tool (issues, labels, pipelines, snippets, members). Prefer a dedicated tool when one exists: this one does no validation, so a wrong path or field is exactly what the instance receives. |
| gitlab_project_getA | Get a project by id or path. Use it to turn a project name into the path the other tools take, and to read default_branch. |
| gitlab_project_searchA | Search projects visible to this token by name. Use it when the exact project path is unknown. |
| gitlab_labels_listA | List a project's labels. Check here before setting labels: 11.3 creates an unknown label silently when the account may, and rejects it when the account may not. |
| gitlab_users_searchA | Find users by name or username. Needed because 11.3 assigns and filters by numeric user id and never by username. |
| gitlab_branches_listA | List a project's branches. Useful before gitlab_mr_create to confirm the source branch exists and to find the target branch. |
| gitlab_file_getA | Read one file from the repository at a ref. Defaults to the project default branch - pass ref= to read the file as the merge request sees it. Output is capped, and a truncated read says so. |
| gitlab_mr_listA | List a project's merge requests. Defaults to state=opened because the raw API would return every state at once. This version has no reviewers or draft filter - read work_in_progress on each item instead. |
| gitlab_mr_getA | Get one merge request. Read state before anything else: only an opened merge request can be merged, and a merged one still reports merge_status can_be_merged. work_in_progress says whether it is a draft. |
| gitlab_mr_changesA | The merge request diff, summarised per file: status, added/removed line counts and a capped patch. Read this before commenting on a line, and to learn which paths and lines exist. Use path to pull one file's patch at a larger cap. |
| gitlab_mr_createA | Create a merge request from source_branch into target_branch. On 11.3 there is no reviewers attribute (assign instead) and no draft parameter: pass draft:true and the required "WIP: " title prefix is applied for you. Creating an MR whose branches already have an open one fails with 409 - update that one instead. |
| gitlab_mr_updateA | Update a merge request. Pass draft to set or clear the "WIP: " prefix (when no title is given the current title is read first). labels:[] clears all labels and assignee_id:0 unassigns - omitting a field leaves it alone. |
| gitlab_mr_commentA | Post a comment on the merge request itself. For a comment on a specific line of the diff, use gitlab_mr_comment_on_line so it appears in the changed line's thread. |
| gitlab_mr_mergeA | Merge a merge request. The merge request must be opened - merging a merged or closed one fails. It fails with 405 while it is not mergeable (conflicts, or a required pipeline still running) and with 409 when the source branch moved since you read it, so read the merge request first and pass its sha to pin the merge. |
| gitlab_mr_pipelinesA | List the pipelines recorded against this merge request. Read before merging: 11.3 refuses the merge while one is running or failed. |
| gitlab_mr_versionsA | List the diff versions of a merge request, newest first as GitLab returns them. Only needed to debug comment positions - gitlab_mr_comment_on_line resolves them itself. |
| gitlab_mr_discussionsA | List the discussion threads of a merge request, with each diff comment's file and line. System notes are filtered out by default and |
| gitlab_mr_comment_on_lineA | Comment on one line of the merge request diff, as a normal review comment. Give the path exactly as gitlab_mr_changes reports it and the line number in that side of the file. The required base/start/head SHAs and the old-side line number are resolved from the merge request's latest diff version, so a stale SHA or a line that is not in the diff is reported instead of being sent. The result carries discussion_id - pass it to gitlab_mr_reply to continue the thread. |
| gitlab_mr_replyA | Reply inside an existing discussion thread. Use it to answer a review comment instead of starting a second thread on the same line. |
| gitlab_mr_resolveA | Resolve or unresolve a discussion thread. This is how review state is recorded on CE 11.3, which has no approve API. Reply to the thread first if the resolution needs an explanation. |
| gitlab_project_issuesC | List a project's issues. Read-only extra: this file declares the endpoints the merge-request tools do not cover, so they cost no code. |
| gitlab_issue_getA | Get one issue by its project-scoped iid. |
| gitlab_project_membersA | List a project's members with their access level and numeric user id - the ids gitlab_mr_create/update take as assignee_id. |
| gitlab_project_pipelinesA | List a project's pipelines, optionally filtered by ref or status. On 11.3 a merge request's own pipelines come from gitlab_mr_pipelines. |
| gitlab_pipeline_jobsA | List the jobs of a pipeline with their status, stage and failure reason. Job logs are text, not JSON, so they are not reachable from this JSON layer. |
| gitlab_commit_listA | List repository commits on a ref. Use it to see what a merge request's source branch contains beyond the diff. |
| gitlab_tags_listC | List repository tags. |
| gitlab_group_projectsB | List the projects of a group (including its subgroups), to find a project path from a group. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 30 tools
Most tools target distinct resources and actions, but the comment-related trio (gitlab_mr_comment, gitlab_mr_comment_on_line, gitlab_mr_reply) and the pipeline listings (gitlab_mr_pipelines, gitlab_project_pipelines, gitlab_pipeline_jobs) require careful reading to avoid misselection. Descriptions do a good job of clarifying boundaries, so confusion is limited but not absent.
All names use snake_case with a uniform gitlab_ prefix, and most follow a resource_action pattern. Minor deviations exist: some list tools include an explicit verb (gitlab_labels_list, gitlab_branches_list), while others omit it (gitlab_project_issues, gitlab_project_members, gitlab_mr_discussions), and a few names are phrase-like (gitlab_whoami, gitlab_raw_api).
30 tools is heavy for a server whose primary focus is merge request workflows. Many auxiliary read-only list/get tools (e.g., project issues, members, pipelines, commits, tags, group projects) add bulk that could be consolidated or handled via the provided raw API escape hatch.
The core merge request lifecycle — list, get, changes, create, update, comment, line comment, reply, resolve, discussions, versions, pipelines, and merge — is well-covered. Gaps remain for common write operations outside MRs (issue creation/update, branch creation, file/commit writes), though the raw API tool provides a workaround.