Gitlab Mcp

io.github.mmedum由 GitHub 帳號 mmedum 發布v4.3.0更新於 Nov 4, 2026

GitLab over MCP from your own account: issues, merge requests, reviews, the repository and CI.

發布方自己的服務:Gitlab

已驗證STDIO僅桌面效率與工作流開發者工具

概覽

AI 產生的概覽

本機 stdio MCP 伺服器,讓助理以你的身分在 gitlab.com 專案中工作:議題、合併請求、審查、儲存庫與 CI。

可以做什麼
  • 尋找並讀取專案、成員、使用者、議題、合併請求、差異、提交、分支、標籤、流水線、作業日誌、測試報告、Wiki 頁面、程式碼片段、發行版本、環境以及你的待辦事項
  • 建立與更新議題、留言、討論、關聯、合併請求、分支、提交、標籤、里程碑與程式碼片段,支援 dry_run 與讀取後變更偵測
  • 審查合併請求:草稿留言、差異行內留言、批次發佈、解決討論串、重新請求審查
  • 讀取並檢查 CI 設定,檢視流水線與作業,讀取已遮蔽機密的產物檔案
  • 依需求開啟後可合併、核准、變基、套用建議、執行或重試流水線、建立發行版本與標籤,以及刪除分支、留言、標籤、里程碑、標籤或程式碼片段
適用情境
適合在 gitlab.com 專案中工作、希望助理代為整理議題、審查合併請求、追蹤 CI 失敗或做小幅儲存庫變更,而不必離開用戶端的人。不適用於自架 GitLab 執行個體、執行個體或群組管理,也不提供原始 API 呼叫。
執行需求
以本機二進位檔透過 stdio 執行(go install、發行壓縮檔,或 Claude Desktop 的 .mcpb 套件)。需要 gitlab.com 帳號與自建 OAuth 應用程式,重新導向 URI 為 confidential,scope 為 api 或 read_api;需在終端機登入一次,權杖存入作業系統金鑰圈。設定皆以 GITLAB_MCP_ 為前綴,包括 GITLAB_MCP_READ_ONLY、GITLAB_MCP_ENABLE_SHIP、GITLAB_MCP_ENABLE_DESTRUCTIVE、GITLAB_MCP_TOOLSETS、GITLAB_MCP_UPLOAD_DIRS 與 write_namespaces。
安裝前請注意
所有呼叫都以你登入的帳號身分執行,且預設權杖本身仍可合併與核准,即使 Ship 關閉。Ship 與 Destructive 工具預設關閉;開啟後會加入合併、核准、變基、執行 CI、發行與刪除操作,破壞性呼叫需傳 confirm: true。伺服器不會在呼叫前詢問你,是否放行取決於用戶端的核准與「永遠允許」規則。寫入會改動議題、合併請求、分支與留言;upload_file 只從 GITLAB_MCP_UPLOAD_DIRS 指定的目錄讀取圖片。不要把工具結果貼到議題中,其中包含組織的程式碼。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gitlab Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

gitlab-mcp

[CI] [Release] [Go Reference] [License: Apache 2.0]

An MCP server for gitlab.com. One binary over stdio, signed in as you, with your own OAuth application and the token in your OS keyring.

It is for a person with a gitlab.com account who wants an assistant to find and read issues, review merge requests, follow CI and make the changes they ask for, as them. It works inside projects: issues, merge requests, reviews, the repository and CI. It does not administer an instance or a group, and it does not serve self-managed instances.

Unofficial, and not affiliated with GitLab Inc. See NOTICE.

Goals and non-goals

Goals:

  • Content never steers the assistant through the server. Issues, reviews, files and job logs come back marked as untrusted data, hidden text is counted, nothing they link to is fetched, and token shapes in CI output are masked.
  • Nothing it writes runs a command. A quick action such as /merge in a comment is refused or escaped, never executed.
  • Nothing ships, deletes or reaches further unless you turn it on. Merging, approving, running CI and deleting are not registered by default, code reaches a protected branch only through a merge request, and writes can be confined to the groups you name.
  • A write changes only what you read and named. Writes carry what they read and are refused when it moved, a lost create is settled by reading, and every write takes dry_run.
  • Reads are bounded. Every read has a budget and says what it left out and how to continue.
  • Act as you, and log nothing about your work. Every call runs as the signed-in account, and the logs never carry paths, titles or bodies.

Non-goals:

  • Self-managed instances. It talks to gitlab.com and nothing else.
  • Administration. Instance and group settings, users, runners, access tokens, deploy keys, webhooks and integrations are out.
  • CI variables and secure files. Reading them would put secrets in a model's context.
  • Deleting projects or groups, force pushes and protected-branch settings, not even behind a switch.
  • A raw API tool. Every call is a tool with its own guards; nothing sends an arbitrary REST or GraphQL request.
  • Events pushed to it. Webhooks need a listener, and a stdio process has none.
  • A hosted service. It speaks stdio only, so Claude on the web and on mobile cannot reach it.
  • Asking you before a call. Your client approves each call; the server asks nothing.

What makes this one different

  • A curated surface, gated by registration. A tool for each thing a person does in a project, rather than an API mirror, and a tool that is switched off is not registered, so it cannot be called at all.
  • Nothing it writes runs a quick action. GitLab runs /merge and the rest from any comment or description sent through its API.
  • Content is marked as untrusted. Issues, reviews, files and job logs come back inside boundaries the content cannot close.
  • Reviews the way people review. Draft comments, published together, and the server, not the model, computes where an inline comment lands.
  • Signs in like a desktop app. Your own OAuth application, a browser tab, the token in the OS keyring. GitLab's own MCP server runs on the instance over HTTP, and a stdio client reaches it through a Node.js proxy.
  • Verifiable releases. Signed checksums, build provenance and SBOMs.

Tools

ToolWhat it does
get_meWho is signed in, with which scopes, and what GitLab reports about itself
resolve_urlTurn a GitLab web URL into the arguments another tool takes, and name that tool
search_projectsFind projects by name, or within a group
get_projectOne project: default branch, visibility, what it has turned on
list_membersWho has access to a project, and with which role
find_usersAccounts by exact username or by name
search_issuesFind issues across gitlab.com, a group or a project
get_issueOne issue, its description marked as untrusted content, and its linked merge requests
create_issueCreate an issue; labels, assignees and milestone checked first
update_issueChange an issue's fields, refused if it changed since you read it
list_discussionsThe comment threads on an issue or a merge request
list_item_eventsAn issue's or a merge request's label, state, milestone and weight changes, newest first
add_commentComment on an issue or merge request, reply in a thread, or start one, on a diff line or not
update_commentEdit one of your own comments in place, in its thread and on its diff line
resolve_discussionResolve or reopen a thread on a merge request or an issue
link_issuesLink two issues, in one project or two
unlink_issuesRemove the link between two issues
link_merge_requestsMake one merge request wait for another to merge, in one project or two
unlink_merge_requestsRemove a dependency between two merge requests
search_merge_requestsFind merge requests across gitlab.com or a project
get_merge_requestOne merge request with its approvals, reviewer states, linked issues and dependencies
list_mr_filesThe files a merge request changes, with line counts and GitLab's markers
get_mr_diffA merge request's diffs, file by file, bounded
list_mr_commitsA merge request's commits
list_mr_versionsA merge request's diff versions, one per push
compare_mr_versionsWhat changed between two versions of a merge request, or since one
create_merge_requestOpen a merge request from a branch
update_merge_requestChange a merge request's fields, refused if it changed since you read it
track_timeSet or reset an issue's or a merge request's time estimate, and add or reset its time spent
add_review_commentA draft review comment, on the merge request or a diff line
list_review_commentsYour unpublished review comments on a merge request
delete_review_commentDelete one of your drafts
update_review_commentChange the text of one of your drafts, keeping its place
publish_review_commentPublish one of your drafts on its own
submit_reviewPublish all your drafts at once, with a summary and reviewer state
rerequest_reviewAsk a reviewer for a new review once their requested changes are addressed
get_fileA file at a ref, bounded
list_treeA directory listing at a ref
list_branchesA project's branches
list_commitsCommits on a ref or a path
get_commitOne commit and its diff, bounded, and the merge requests that contain it
compare_refsThe commits and diffs between two refs, bounded
list_tagsA project's tags
create_branchCreate a branch from a ref
create_commitCommit file changes to a branch; never the default or a protected one
get_blameWho last changed each line of a file, bounded
cherry_pick_commitApply a commit to a branch; never the default or a protected one
revert_commitUndo a commit on a branch with a new one; never the default or a protected one
list_pipelinesA project's CI pipelines
get_pipelineOne pipeline with the jobs that failed, trigger jobs included
list_jobsA pipeline's jobs
get_job_logA window of a job's log, secrets masked; the failing section on request
get_test_reportA pipeline's test counts and failed cases, secrets masked, bounded
lint_ciCheck a project's CI configuration at a ref, or configuration you pass
list_job_artifactsThe files a job kept as artifacts
get_job_artifactOne text file of a job's artifacts, secrets masked, bounded
list_labelsThe labels a project's issues and merge requests can carry
list_milestonesA project's or a group's milestones
list_boardsA project's issue boards and their lists, each with the search_issues arguments that read it
searchCode, commits, comments and more, in a project, a group or everywhere
list_todosYour to-do items
mark_todos_doneMark your to-do items done
add_todoAdd a to-do for yourself on an issue or a merge request
subscribeSubscribe to an issue's or a merge request's notifications, or unsubscribe
reactAdd or remove your emoji reaction on an issue, a merge request or a comment
upload_fileUpload an image from a directory you allowed and get the Markdown that shows it in a comment or description
merge_merge_requestMerge at the head you reviewed, or when the pipeline succeeds (Ship)
cancel_auto_mergeStop a merge request merging when its pipeline succeeds (Ship)
approve_merge_requestApprove at the head you reviewed (Ship)
unapprove_merge_requestWithdraw your approval (Ship)
apply_suggestionsCommit suggestions from a merge request's diff comments to its source branch; never a protected one (Ship)
rebase_merge_requestRebase a merge request's source branch, from the head you reviewed (Ship)
move_issueMove an issue to another project, never to one more people can see (Ship)
run_pipelineRun a pipeline for a ref, with variables whose values are never shown (Ship)
run_merge_request_pipelineRun a merge request's pipeline, merged results or detached as GitLab picks; not for a fork's merge request (Ship)
retry_pipelineRetry a pipeline's failed and canceled jobs (Ship)
retry_jobRun a finished job again, with inputs (Ship)
play_jobStart a manual job, with variables and inputs (Ship)
cancel_pipelineCancel a running pipeline (Ship)
delete_branchDelete a branch; never the default, a protected or an unmerged one unless asked (Destructive)
delete_commentDelete one of your own comments (Destructive)
make_issue_publicMake a confidential issue public (Destructive)
list_wiki_pagesA project wiki's pages (wiki toolset)
get_wiki_pageOne wiki page, bounded (wiki toolset)
save_wiki_pageCreate a wiki page, or change one unchanged since you read it (wiki toolset)
delete_wiki_pageDelete a wiki page (wiki toolset, Destructive)
list_snippetsA project's snippets, or your own (snippets toolset)
get_snippetOne snippet and a file of it, bounded (snippets toolset)
create_snippetCreate a snippet, always private (snippets toolset)
update_snippetChange one of your own private snippets: title, description, files; refused if it changed since you read it (snippets toolset)
delete_snippetDelete one of your own snippets (snippets toolset, Destructive)
list_releasesA project's releases (releases toolset)
get_releaseOne release and its notes (releases toolset)
create_releaseCreate a release, and its tag at a ref, with asset links to the project's own pages (releases toolset, Ship)
create_tagCreate a tag at a ref; never a protected one (releases toolset)
delete_tagDelete a tag; never a protected one (releases toolset, Destructive)
create_labelCreate a project label (planning toolset)
update_labelChange a project label unchanged since you read it (planning toolset)
delete_labelDelete a project label (planning toolset, Destructive)
create_milestoneCreate a project milestone (planning toolset)
update_milestoneChange, close or reopen a milestone unchanged since you read it (planning toolset)
delete_milestoneDelete a project milestone (planning toolset, Destructive)
list_environmentsA project's environments and their last deployment (deployments toolset)
list_deploymentsWhat was deployed where, and by which job (deployments toolset)
list_eventsRecent activity, yours or a project's (activity toolset)

Ship and Destructive tools are registered only with the settings below, and the toolsets only when GITLAB_MCP_TOOLSETS names them.

Resources carry the same text for clients that attach rather than call: an issue, a merge request and a job log.

Install

Download an archive for your platform from the releases page, or:

bash
go install github.com/mmedum/gitlab-mcp/v4/cmd/gitlab-mcp@latest

Claude Desktop users can open the .mcpb bundle from the same release. It does not log you in; do the steps below first.

Sign in

You bring your own OAuth application. Nothing is shipped in the binary, and there are no personal access tokens.

  1. Register an application, once. On gitlab.com: your avatar → Edit profile → Applications (or a group's). Redirect URI http://127.0.0.1/callback, Confidential unchecked, scope api (read_api for read-only). docs/setup.md has the exact values.

  2. Log in from a terminal:

    bash
    gitlab-mcp login --client-id <application id>

    It prints the scopes it will ask for, opens your browser, and stores the token in the OS keyring. On a machine without a browser, --no-browser prints the URL and the ssh -L line to forward the callback.

  3. Check it:

    bash
    gitlab-mcp doctor

    doctor walks the connection, TLS, the sign-in, the application, the granted scopes and one call as you, and names what is missing. status and logout do what they say; --profile keeps two gitlab.com logins side by side.

Connect a client

Claude Code:

bash
claude mcp add gitlab -- gitlab-mcp

Any client that takes a JSON server list:

json
{  "mcpServers": {    "gitlab": { "command": "gitlab-mcp" }  }}

Claude Desktop can instead open the .mcpb bundle from a release. It asks for the same settings: merging, approving, rebasing, applying suggestions, moving issues, CI and releases (enable_ship) and deleting (enable_destructive) stay off unless you turn them on, and write_namespaces confines writes to the groups and projects you name. This server asks nobody before a call. Claude Desktop approves each tool, and a tool you always allow then runs unasked, so leave a switch off unless you need its tools.

Configuration

Every setting is an environment variable with the GITLAB_MCP_ prefix and a matching flag. docs/configuration.md lists them all.

Safety

GitLab content was written by someone other than you, and some of it is written to steer an agent. The server marks it as untrusted data, never fetches what it references, and nothing it adds tells the model to act on it.

What can be registered depends on the settings, because GitLab's api scope cannot separate any of it:

SettingRegisters
GITLAB_MCP_READ_ONLY=trueRead tools only, with a read_api token
defaultRead, Write and Adding: issues, comments, reviews, branches, merge requests
GITLAB_MCP_ENABLE_SHIP=trueadds merging, approving, rebasing, applying suggestions, moving issues, running CI and releases
GITLAB_MCP_ENABLE_DESTRUCTIVE=trueadds deletion and making an issue public, and each call must pass confirm: true

Your MCP client approves each call; the server does not ask you itself. claude.ai, Claude Desktop and Codex prompt for every tool marked destructive: every write but the ones that only add, such as create_issue and create_label. VS Code prompts for every tool that writes. In Claude Code, delete_label, delete_milestone and make_issue_public ask on every call whatever your rules say, since none can be undone and each reaches past the one item: a label or milestone comes off every issue and merge request, and a public issue is read by everyone. For the rest, list the calls you want to approve one by one under permissions.ask in your settings, with the name you gave the server in place of gitlab. For example, the writes that ship, publish, upload or delete:

json
{  "permissions": {    "ask": [      "mcp__gitlab__merge_merge_request", "mcp__gitlab__approve_merge_request",      "mcp__gitlab__apply_suggestions", "mcp__gitlab__run_pipeline",      "mcp__gitlab__run_merge_request_pipeline", "mcp__gitlab__play_job",      "mcp__gitlab__create_release", "mcp__gitlab__create_tag", "mcp__gitlab__move_issue",      "mcp__gitlab__upload_file",      "mcp__gitlab__delete_branch", "mcp__gitlab__delete_comment",      "mcp__gitlab__delete_wiki_page", "mcp__gitlab__delete_label",      "mcp__gitlab__delete_milestone", "mcp__gitlab__delete_tag",      "mcp__gitlab__delete_snippet"    ]  }}
  • No quick actions. GitLab runs /merge, /close and the rest from a description or comment. Every body this server sends is checked, and a quick-action line is refused, or escaped when you ask.
  • Protected branches. Code reaches the default branch or a protected branch only through a merge request; a direct commit there is refused.
  • No blind retries. A create that may or may not have happened is settled by reading, never by creating again.
  • Local files only from where you allow. upload_file reads an image only from the directories GITLAB_MCP_UPLOAD_DIRS names, and only a PNG, JPEG, GIF or WebP judged from its bytes, so a comment asking for a key file to be "attached" gets nothing.

The default token can still merge and approve; leaving Ship off stops this server doing so, not anything else holding the token. docs/security.md says more.

Verify a release

Each release signs checksums.txt with a keyless Sigstore certificate and attests every archive and the bundle:

bash
sha256sum -c checksums.txt --ignore-missingcosign verify-blob checksums.txt --bundle checksums.txt.bundle \  --certificate-identity "https://github.com/mmedum/gitlab-mcp/.github/workflows/release.yml@refs/tags/<tag>" \  --certificate-oidc-issuer https://token.actions.githubusercontent.comgh attestation verify <archive> --repo mmedum/gitlab-mcp

Getting help

Run gitlab-mcp doctor first: it checks the connection, the sign-in, the application and the granted scopes, and names what is missing. docs/troubleshooting.md covers each failure. Then open an issue with doctor's output and the version. Do not paste a tool result: it is your organization's code and other people's words.

Documentation

  • docs/setup.md: registering the OAuth application and logging in.
  • docs/configuration.md: every setting, what each registers, and where state is stored.
  • docs/troubleshooting.md: symptoms and their fixes, then rotating the token, revoking access and handling a suspected exposure.
  • docs/security.md: the threat model.
  • docs/architecture.md: how it works, and the design decisions a contributor should not undo.
  • docs/release.md: how a release is cut and checked.
  • CHANGELOG.md: what each release changed. The tool names and their output fields are the contract, and anything you have to act on is marked Breaking.

Contributing

CONTRIBUTING.md covers the gates, the live run and the review flow. Security reports go through SECURITY.md, not an issue.

License

Apache-2.0. See LICENSE and NOTICE.

來源:README.md,提交 79e23ef

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

15
  1. v4.3.0最新Nov 4, 2026
  2. v4.2.1Nov 4, 2026
  3. v4.2.0Nov 1, 2026
  4. v4.1.4Oct 29, 2026
  5. v4.1.3Oct 25, 2026
  6. v4.1.2Oct 24, 2026
  7. v4.0.1Oct 23, 2026
  8. v3.0.0Oct 22, 2026
  9. v2.4.0Oct 10, 2026
  10. v2.3.0Oct 8, 2026
  11. v2.2.1Oct 2, 2026
  12. v2.1.0Oct 1, 2026
  13. v2.0.0Sep 30, 2026
  14. v1.1.0Sep 28, 2026
  15. v1.0.0Sep 27, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Gitlab 整合