跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 GitLab,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 GitLab 中工作:查找项目,分拣和更新议题(issue),审阅合并请求(merge request)及其差异和评论,检查流水线并阅读失败作业的日志,以及读取分支、提交和文件。支持 GitLab.com 或你自己的 GitLab 实例,使用个人访问令牌。
试试这样问
GitLab 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → GitLab、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
GitLab + Meta Muse
让你的 AI 在 GitLab 中工作:查找项目,分拣和更新议题(issue),审阅合并请求(merge request)及其差异和评论,检查流水线并阅读失败作业的日志,以及读取分支、提交和文件。支持 GitLab.com 或你自己的 GitLab 实例,使用个人访问令牌。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
GITLAB_URL, GITLAB_TOKEN
步骤 1 — 获取凭证
- 在 GitLab 中点击你的头像 → Edit profile → Access → Personal access tokens → Generate token。在 GitLab.com 上,该页面位于 gitlab.com/-/user_settings/personal_access_tokens。
- 为令牌命名(例如 "AnythingMCP"),设置过期日期(GitLab.com 上最长 365 天),并勾选权限范围
api。如需只读设置,请改为勾选read_api。 - 立即复制令牌:GitLab 只显示一次。令牌以
glpat-开头。 - 把令牌填入
GITLAB_TOKEN,不要带 Bearer 字样。将GITLAB_URL设为https://gitlab.com(GitLab.com),或设为你的 Self-Managed 或 Dedicated 实例在浏览器中打开时的地址(例如https://gitlab.example.com),不要带/api/v4,末尾也不要加斜杠。然后安装连接器。 - 先运行
gitlab_get_current_user:它会显示该令牌属于哪个 GitLab 用户,并确认地址正确。然后用路径把项目告诉 AI,例如my-group/my-project,或者让它用gitlab_list_projects查找。
令牌有效期和访问范围:GitLab.com 上的令牌最长有效 365 天。过期后,用相同的权限范围生成新令牌,再次填入 GITLAB_TOKEN。连接器以令牌所属用户的身份操作:AI 能看到和修改的正是该用户有权限的内容。fine-grained 个人访问令牌(GitLab 19.2 及以上)用法相同:为相关项目的 issues、merge requests、仓库、流水线和作业授予读写权限。GitLab.com 上有些群组强制要求 fine-grained 令牌,此时传统令牌在它们的项目上会报错 "Access denied: This operation requires a fine-grained personal access token"。项目访问令牌和群组访问令牌也可以使用,但在 GitLab.com 上需要 Premium 或 Ultimate。
只读设置:使用带 read_api 的令牌,并关闭 gitlab_create_issue, gitlab_update_issue, gitlab_add_issue_note, gitlab_create_merge_request, gitlab_update_merge_request, gitlab_add_merge_request_note 和 gitlab_create_branch。
安装时默认关闭:gitlab_delete_issue(永久删除议题,只有项目所有者和管理员可以执行,通常用 gitlab_update_issue 关闭议题才是你想要的)和 gitlab_delete_branch。只有在 AI 需要删除议题或分支时才打开它们。
项目、议题和合并请求:工具通过数字 id 或完整路径(例如 my-group/my-project)接收项目。议题和合并请求用 GitLab 中显示的编号(#42、!17)指定,而不是全局 id。gitlab_list_project_members 提供指派人和审阅人的用户 id。gitlab_list_my_issues 和 gitlab_list_my_merge_requests 跨所有项目工作,默认显示令牌所属用户自己的条目,包括等待其审阅的合并请求。
审阅、流水线和代码:审阅合并请求时,AI 先读取 gitlab_get_merge_request(合并状态和冲突),再逐页读取 gitlab_get_merge_request_diffs,以及 gitlab_list_merge_request_commits 和 gitlab_list_merge_request_notes。差异过大的文件返回时不带文本;AI 会改用 gitlab_get_file_content 在源分支上读取。排查失败的流水线时,它从 gitlab_list_pipelines 到 gitlab_list_pipeline_jobs(只看失败的作业),再到 gitlab_get_job_log。文件和作业日志在 200 KB 处截断,保留开头部分:更长的日志请在 GitLab 中打开。gitlab_search_project 在任何方案下都能搜索单个项目内的代码;用 gitlab_search 在整个实例范围内搜索代码需要 advanced search,这是 Premium 功能。
写入前先确认:议题、评论、合并请求和分支都以令牌所属用户的名义创建。AI 会先给你看标题、正文或分支,等你确认后再写入。评论中的快捷操作(quick actions),例如 /label、/assign、/close、/approve 或 /merge,会由 GitLab 执行,因此 AI 只在你要求时才加入。创建分支需要 Developer 权限。
速率限制:GitLab.com 允许每个用户每分钟约 2,000 次 API 请求、200 个新议题和 60 条新评论,以及每分钟 100 次搜索。Self-Managed 实例的限制由管理员设置。超出限制时 GitLab 返回 429:稍等后再试。
常见错误:401 表示令牌错误、已过期或已被撤销,或者 GITLAB_URL 指向的不是签发该令牌的实例。403 表示缺少权限范围(例如用 read_api 令牌执行写入),或该用户的角色不足以执行此操作。404 表示项目、议题或文件不存在,或该用户看不到它:GitLab 会用 404 隐藏私有资源。400 会指出缺失或无效的字段。新建合并请求时返回 409,表示这两个分支之间已有一个打开的合并请求。已改名的项目在旧路径下仍可读取,但在旧路径上写入会返回 405:请使用新路径或数字 id。
连接器没有用于合并或批准合并请求、推送提交、编辑文件,以及运行、重试或取消流水线的工具,也不涉及 CI/CD 变量、发布(releases)、Wiki、软件包、容器镜像库和管理功能。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Muse 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Muse 以自定义连接器的形式添加远程 MCP 服务器,并通过 OAuth 登录。
- 在 Muse 中打开 Settings → Connectors,选择 Add custom connector。
- 粘贴 MCP 服务器 URL
https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。 - Muse 会打开 AnythingMCP 的登录页面:登录并批准访问。
- 在聊天中,向 Muse 提出需要用到
GitLab的工具的请求。
你也可以在聊天中完成设置,适用于网页版、iOS 和 Android 应用以及 WhatsApp。给 Muse 发送这条消息:
Create a Custom Connector for a new remote MCP server, then connect to it:
Name: AnythingMCP
Transport: remote streamable HTTP
URL: https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID
Auth: OAuth
自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Muse 从 Meta 的云端连接,因此 localhost 无法使用。
可用工具
| Tool | What it does |
|---|---|
gitlab_get_current_user | Get the GitLab user the token belongs to: id, username, name, state, web_url and, for admins, is_admin |
gitlab_list_projects | List projects the token can see, newest activity first by default: id, path_with_namespace, default_branch, web_url, visibility and… |
gitlab_get_project | Get one project by id or path: default_branch, visibility, description, web_url, open_issues_count, permissions of the token's user, and… |
gitlab_list_project_members | List the members of a project, including those inherited from its groups: user id, username, name and access_level (10 Guest, 15 Planner… |
gitlab_list_labels | List a project's labels (including group labels): name, color, description and open issue and merge request counts |
gitlab_list_issues | List a project's issues with filters: iid, title, state, labels, assignees, author, milestone, due_date, web_url |
gitlab_list_my_issues | List issues across all projects: by default the ones assigned to the token's user, or the ones they created, or every issue they can see |
gitlab_get_issue | Get one issue by its iid: title, description (Markdown), state, labels, assignees, author, milestone, due_date, time stats, related merge… |
gitlab_create_issue | Create an issue in a project |
gitlab_update_issue | Change an issue: title, description, labels (replace, add or remove), assignees, milestone, due date, or close or reopen it with state_event |
gitlab_delete_issue | Delete an issue for good |
gitlab_list_issue_notes | List the comments on an issue, newest first by default, including system notes (label and status changes, flagged system: true): id, body… |
gitlab_add_issue_note | Post a comment on an issue, as the token's user |
gitlab_list_merge_requests | List a project's merge requests with filters: iid, title, state, draft, source and target branch, author, reviewers, labels, merge_status… |
gitlab_list_my_merge_requests | List merge requests across all projects: by default the ones created by the token's user, or assigned to them, or waiting for their review… |
gitlab_get_merge_request | Get one merge request by iid: title, description, state, draft, source and target branch, sha, detailed_merge_status (mergeable, conflict… |
gitlab_get_merge_request_diffs | Get the changed files of a merge request, page by page: old_path, new_path, new_file, renamed_file, deleted_file and the diff text of each |
gitlab_list_merge_request_commits | List the commits of a merge request: id (SHA), short_id, title, message, author_name and created_at |
gitlab_list_merge_request_notes | List the comments on a merge request, including review comments on lines (with a position) and system notes: id, body, author, created_at… |
gitlab_add_merge_request_note | Post a general comment on a merge request, as the token's user |
gitlab_create_merge_request | Open a merge request from a source branch into a target branch |
gitlab_update_merge_request | Change a merge request: title (add or remove the Draft: prefix), description, target branch, labels, assignees, reviewers, or close or… |
gitlab_list_pipelines | List a project's CI/CD pipelines, newest first: id, iid, status, ref, sha, source, created_at, updated_at and web_url |
gitlab_get_pipeline | Get one pipeline: status, ref, sha, source, duration, queued_duration, coverage, user, started_at, finished_at and web_url |
gitlab_list_pipeline_jobs | List the jobs of a pipeline: id, name, stage, status, failure_reason, duration, runner, allow_failure and web_url |
gitlab_get_job | Get one CI/CD job: name, stage, status, failure_reason, duration, started_at, finished_at, the commit, the pipeline, artifacts and web_url |
gitlab_get_job_log | Read the log (trace) of a CI/CD job as plain text, with ANSI color codes |
gitlab_list_branches | List a project's branches: name, merged, protected, default, the last commit (id, title, author, date) and web_url |
gitlab_get_branch | Get one branch: its last commit, whether it is merged, protected or the default, and whether the user can push to it |
gitlab_create_branch | Create a branch from a branch, tag or commit |
gitlab_delete_branch | Delete a branch |
gitlab_list_commits | List commits of a branch, tag or the default branch, newest first: id (SHA), short_id, title, author_name, authored_date and web_url |
gitlab_get_commit | Get one commit by SHA, branch or tag name: message, author, committer, parent_ids, stats (additions, deletions), the last pipeline and… |
gitlab_get_commit_diff | Get the changes of one commit, page by page: old_path, new_path, new_file, renamed_file, deleted_file and the diff text per file |
gitlab_list_repository_tree | List files and folders in a repository folder: id (blob or tree SHA), name, type (blob = file, tree = folder), path and mode.… |
gitlab_get_file_info | Get a file's metadata without its content: file_name, file_path, size, encoding, content_sha256, blob_id, commit_id and last_commit_id on… |
gitlab_get_file_content | Read a file from the repository as text, at a branch, tag or commit (the default branch by default) |
gitlab_search | Search the whole instance (only what the token's user can see): projects, groups, issues, work_items, merge_requests, milestones, users or… |
gitlab_search_project | Search inside one project: code (blobs, with file name, path, line number and the matching lines), commits, issues, merge_requests… |
示例提示
- “所有项目中有哪些合并请求在等我审阅?其中哪些有冲突或流水线失败?”
- “my-group/web-app 的 main 分支上最新一次流水线为什么失败?给我看失败的作业和日志里的错误。”
- “总结 my-group/web-app 中的合并请求 !128:改了什么、涉及哪些文件,以及哪些审阅评论还没有解决。”
- “在 my-group/web-app 中创建一个议题,标题为“移动端结账按钮错位”,加上 bug 标签,并指派给 Lena。”
FAQ
Muse 在哪些地区可用? Meta 目前在美国和加拿大提供 Muse,可在网页版、iOS 和 Android 应用以及 WhatsApp 中使用。
Meta 会审核这个连接器吗? 不会。Meta 不审核自定义连接器。Muse 只能看到你在 AnythingMCP 中为此 MCP 服务器启用的工具,你也可以随时在 Settings → Connectors 中断开它。
下一步
这份指南对你有帮助吗?