Works with GitLab accounts to manage repositories, merge requests, code reviews and CI/CD pipelines.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add gitlab --env GITLAB_API_TOKEN='<GITLAB_API_TOKEN>' --env GITLAB_API_URL='<GITLAB_API_URL>' -- node /path/to/mcp-gitlab/build/index.js~/.codex/config.toml
[mcp_servers.gitlab]
command = "node"
args = ["/path/to/mcp-gitlab/build/index.js"]
env = { GITLAB_API_TOKEN = "<GITLAB_API_TOKEN>", GITLAB_API_URL = "<GITLAB_API_URL>" }
# codex mcp add gitlab --env GITLAB_API_TOKEN='<GITLAB_API_TOKEN>' --env GITLAB_API_URL='<GITLAB_API_URL>' -- node /path/to/mcp-gitlab/build/index.js~/.cursor/mcp.json
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "<GITLAB_API_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"gitlab": {
"type": "stdio",
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "<GITLAB_API_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "<GITLAB_API_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "<GITLAB_API_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "<GITLAB_API_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>"
}
}
}
}需要的环境变量
GITLAB_API_TOKENGITLAB_API_URL
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。