GitLab MCP Server
AI 에이전트가 GitLab 프로젝트, 병합 요청, 이슈, 파이프라인, 위키, 릴리스를 다룰 수 있게 해 줍니다.
2.1k GitHub 스타제작 zereight라이선스 MIT업데이트 18일 전
설치 방법
이 MCP는 로컬 방식이에요. 내 컴퓨터에서 실행돼요.
PC에 설치한 앱(Claude Desktop, Claude Code, Cursor, VS Code 등)에서 쓸 수 있어요. 앱을 고르세요:
터미널에 붙여 넣기:
claude mcp add gitlab -- npx -y @zereight/mcp-gitlab
채워야 할 것
| 이름 | 설명 | 필수 |
|---|---|---|
GITLAB_PERSONAL_ACCESS_TOKEN | GitLab personal access token for local stdio use. A non-empty value overrides GITLAB_PERSONAL_ACCESS_TOKEN_FILE. One of this token, GITLAB_PERSONAL_ACCESS_TOKEN_FILE, GITLAB_JOB_TOKEN, GITLAB_AUTH_COOKIE_PATH, or GITLAB_USE_OAUTH=true must be set. Create a token with the GitLab scopes the tools need, such as api or read_api. | 아니요 |
GITLAB_PERSONAL_ACCESS_TOKEN_FILE | Path to a file that contains the personal access token. Read once at startup and trimmed. Ignored when GITLAB_PERSONAL_ACCESS_TOKEN or --token is non-empty. A missing, unreadable, or empty file stops startup. Does not replace job token, OAuth, cookie, or remote authorization. | 아니요 |
GITLAB_JOB_TOKEN | Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI. | 아니요 |
GITLAB_AUTH_COOKIE_PATH | Optional path to a GitLab authentication cookie file for cookie-based authentication. | 아니요 |
GITLAB_USE_OAUTH | Set to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file. | 아니요 |
GITLAB_OAUTH_CLIENT_ID | GitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT. | 아니요 |
GITLAB_OAUTH_TOKEN_SCRIPT | Command that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID. | 아니요 |
GITLAB_API_URL | GitLab API base URL. Use https://gitlab.com/api/v4 for GitLab.com or your self-managed GitLab API URL. | 아니요 |
GITLAB_ALLOWED_PROJECT_IDS | Optional comma-separated list of GitLab project IDs that this server is allowed to access. | 아니요 |
GITLAB_PERMISSION_MODE | Tool exposure. Allowed values are readonly, modify, and full. Unset uses full. readonly keeps read-only tools. modify blocks delete and teardown tools. | 아니요 |
GITLAB_TOOLSETS | Optional comma-separated toolset ids (projects, issues, merge_requests, …). Unset keeps the lean core default plus discover_tools. Do not set all unless you accept loading ~all schemas (~73k tokens). | 아니요 |
GITLAB_TOOLS | Optional comma-separated list of individual tool names to add on top of enabled toolsets. | 아니요 |
GITLAB_DENIED_TOOLS_REGEX | Optional regular expression used to hide matching tools from the server. | 아니요 |
GITLAB_TOOL_POLICY_APPROVE | Optional comma-separated list of tool names that require explicit approval before execution. | 아니요 |
GITLAB_TOOL_POLICY_HIDDEN | Optional comma-separated list of tool names to hide from tools/list. | 아니요 |
NODE_TLS_REJECT_UNAUTHORIZED | Set to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates. | 아니요 |
GITLAB_CA_CERT_PATH | Optional path to a custom CA certificate file for self-managed GitLab instances. | 아니요 |
GITLAB_MASKING_ENABLED | Set to true to mask text tool results and returned errors using built-in or configured rules. | 아니요 |
GITLAB_MASKING_CONFIG | Optional path to a response-masking JSON configuration file. | 아니요 |
GITLAB_MASKING_POLICY_FILE | Optional protected server-owned JSON file containing managed masking policies. | 아니요 |
GITLAB_MASKING_WORKSPACE_DIR | Directory used to resolve response-masking configuration paths. | 아니요 |
준비 끝! 이제 테스트해 보세요
앱을 다시 시작하고 아래 요청 중 하나를 채팅에 붙여 넣으세요:
group/project의 병합 요청 123번에서 변경된 파일을 나열해 주세요.
실패한 파이프라인 작업의 출력을 보여 주세요.
무엇인가요
이 서버는 REST와 GraphQL API로 에이전트를 GitLab에 연결합니다. 40개 도구로 시작하며, 카테고리별로 더 켜서 총 288개까지 늘릴 수 있습니다. gitlab.com과 자체 호스팅 인스턴스를 모두 지원하며, 읽기 전용 모드도 있습니다.
할 수 있는 일
list_merge_request_changed_files와get_merge_request_file_diff: 병합 요청을 두 단계로 검토합니다get_pipeline_job_output: 페이지 단위로 작업 로그를 읽습니다discover_tools: 도구 카테고리를 더 활성화합니다helpexecute_graphql- 프로젝트, 이슈, 위키, 릴리스, 태그, 마일스톤
jmespath옵션: 큰 결과를 줄입니다
언제 쓰나요
- ›에이전트가 병합 요청의 파일을 하나씩 검토하게 하고 싶을 때
- ›파이프라인이 실패했을 때 GitLab을 열지 않고 작업 로그를 보고 싶을 때
- ›채팅에서 이슈와 마일스톤을 관리하고 싶을 때
필요한 것
npm install -g @zereight/mcp-gitlab으로 설치한 뒤 zereight-mcp-gitlab 실행 파일을 사용하세요.함께 쓰면 좋은 스킬
MCP일까, 스킬일까?
MCP는 에이전트에게 손을 주고, 스킬은 그 손을 제대로 쓰는 법을 알려 줘요. 함께 쓰면 결과가 좋아지고 토큰도 덜 들어요.
자주 묻는 질문
기본으로 도구가 몇 개 보이나요?
기본은 40개입니다(핵심 38개와 discover_tools, help). 전체는 288개입니다.
모든 도구를 불러와야 하나요?
아니요. README는 GITLAB_TOOLSETS=all을 쓰지 말라고 합니다. 약 73k 스키마 토큰이 들기 때문입니다. 대신 discover_tools를 사용하세요.
어떻게 로그인하나요?
GITLAB_PERSONAL_ACCESS_TOKEN, 로컬 OAuth, Claude.ai용 MCP OAuth, 요청별 원격 인증 중에서 선택할 수 있습니다.
자체 호스팅 GitLab과 함께 쓸 수 있나요?
네. GITLAB_API_URL을 자신의 인스턴스 주소로 설정하세요.
MCP 없이도 쓸 수 있나요?
네. Skill과 CLI 방식으로 터미널에서 zereight-mcp-gitlab을 사용해 같은 작업을 할 수 있습니다.
api 도구 모음은 안전한가요?
README는 이 도구 모음이 허용 목록과 안전 검사를 우회할 수 있고, 프롬프트 인젝션으로 조작될 수 있다고 경고합니다. 꼭 필요할 때만 켜세요.
작동하지 않을 때
- ›토큰이 설정되어 있는지, GITLAB_API_URL이 맞는지 확인하세요. 예: https://gitlab.com/api/v4
- ›Node.js 버전이 20 이상인지 확인하세요.
- ›project_id에는 group%2Fproject처럼 URL 인코딩된 프로젝트 경로를 사용하세요.
매주 새 스킬 5개. 읽는 데 1분.