Connect GitLab to Claude Code
Browse projects, triage issues, review merge requests, and check pipelines. Add Toolspoke to Claude Code once and it can use 14 GitLab actions. Your GitLab credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install GitLab and connect it
Add GitLab to a project in your Toolspoke workspace.
Personal access token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Personal access token
- GitLab → your avatar → Edit profile → Access tokens. The api scope covers every action here; read_api is enough if you only want the read actions to work. A project or group access token works too and is narrower.
Choose what Claude Code may do
All 14 actions start on. Switch off any of the 3 actions that change something in GitLab, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the GitLab actions that only read, so they are safe to try first.
- Find projects by name, path or description, or list the ones you are a member of
- List a project's issues with filters for state, labels, milestone, assignee, author and free text
- Fetch one issue in full: description, state, labels, assignees, milestone, due date, time tracking and web URL
- List a project's merge requests, filtered by state, branch, author, reviewer, labels or free text
What Claude Code can do in GitLab
11 actions read and 3 write.
Reads
List projects
Find projects by name, path or description, or list the ones you are a member of. Every other action here needs a project_id, and this is where you get it: use either the numeric id or the full path such as gitlab-org/gitlab, both of which this returns. Set membership true to see only projects you belong to, which is usually what you want on a large instance where an unfiltered search returns thousands of public repositories.
Get project
Fetch one project: description, default branch, visibility, clone URLs, web URL, topics and which features are enabled. Call it when you need the default branch name for get_file, or to confirm you have the right repository before writing to it. Takes the numeric id or the URL path from list_projects.
List issues
List a project's issues with filters for state, labels, milestone, assignee, author and free text. Returns the issue iid, the per-project number shown in the UI as #42, which every other issue action here takes; the global id in the same response is not interchangeable with it. Use get_issue when you already know the iid and want one issue in full.
Get issue
Fetch one issue in full: description, state, labels, assignees, milestone, due date, time tracking and web URL. Takes the project-scoped iid from list_issues, not the global id. Use this when you need the actual body; list_issues already carries titles and states.
List merge requests
List a project's merge requests, filtered by state, branch, author, reviewer, labels or free text. Returns each one's iid, the per-project number in the UI, plus title, state, merge status and branches. Use get_merge_request for the description, diff statistics and pipeline of a single one. state defaults to opened, which is what a review queue means.
Get merge request
Fetch one merge request in full: description, source and target branches, merge status, approvals state, head SHA, and the pipeline attached to it. Takes the project-scoped iid from list_merge_requests. Read this before commenting with create_merge_request_note, and take diff_refs.head_sha from here if a later action needs it.
List pipelines
List a project's CI pipelines, newest first, optionally narrowed to one branch, commit SHA or status. Returns each pipeline's id, status, ref, SHA and web URL but nothing about individual jobs, take an id from here and call list_pipeline_jobs to find which job failed. Filter status to failed when you are investigating a broken build.
List pipeline jobs
List the jobs in one pipeline with each job's name, stage, status, duration, runner and web URL. Call list_pipelines first for the pipeline_id. Set scope to failed to go straight to what broke. This returns job metadata, not job logs, open the job's web_url for the trace.
Get file
Read one file from a repository at a given branch, tag or commit. GitLab returns the content base64-encoded and it is decoded to text for you, so this is only useful for text files, a binary will come back as mojibake. ref defaults to HEAD, which resolves to the project's default branch. Use list_branches if you need a branch name, and get_project for the default branch.
List branches
List a repository's branches with their latest commit, protection status and whether the token's owner can push to each. Filter with search when a project has hundreds. Use it to confirm a branch name before get_file, or to see what work is in flight alongside list_merge_requests.
Get current user
Return the account this token belongs to: username, name, numeric id, email and whether it is an administrator. Use it to confirm which GitLab identity an agent is acting as, and to get the numeric user id that create_issue's assignee_ids expects. Takes no arguments and changes nothing, which is why it is the install-time health check.
Writes
Create issue
Open a new issue on a project. Only the title is required. Labels are a comma-separated string, and GitLab creates any label that does not already exist, so check list_issues output for the names in use before inventing one. The description is markdown. Returns the created issue including its iid and web URL.
Update issue
Change an existing issue: retitle it, rewrite the description, reassign it, adjust labels, or close and reopen it with state_event. Send only what you want changed. Prefer add_labels and remove_labels over labels, labels replaces the whole set, and an empty string strips every label. Closing is reversible from here, which is why this is a write rather than a destructive action.
Create merge request note
Post a comment on a merge request's main discussion. This is a thread-level note, not a line comment on the diff, and it notifies everyone participating in the review. Get the merge_request_iid from list_merge_requests or get_merge_request first. The body is markdown; GitLab quick actions such as /assign work in it, so keep the text to what you actually mean to say.
GitLab in Claude Code: questions
Does Claude Code see my GitLab credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in GitLab?
Yes. Each of the 14 actions can be switched off for a project. Turn off the 3 that change something and Claude Code can only read.
Will 14 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the GitLab action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a GitLab call does not run in a sandbox, so it bills nothing.
GitLab in your other apps
Try GitLab in Claude Code
Free to start, and tool calls cost nothing on any plan.