GitLab AI MCP Server
GitLab AI MCP Server
고성능의 컨테이너화된 Model Context Protocol (MCP) 서버로서, AI 코딩 어시스턴트(Claude, Codex, Gemini, Kimi)를 모든 GitLab 인스턴스(셀프 호스팅 또는 클라우드)에 연결합니다.
할 수 있는 작업
영역 | 작업 |
프로젝트 및 이슈 | 목록 보기, 검색, 생성, 업데이트, 라벨 지정, 할당 |
머지 리퀘스트 | diff 검토, 토론 관리, 승인, 병합, 리베이스 |
CI/CD | 파이프라인 검사, 작업 로그 읽기, 작업 재시도/취소, 변수 관리 |
저장소 | 파일 찾아보기, 콘텐츠 읽기, 일괄 커밋 생성, 브랜치 및 태그 관리 |
검색 | 코드 검색, 전체 검색, 사용자 검색 |
보안 | 취약점 발견 항목, 의존성 목록(SBOM), 감사 이벤트 |
로컬 AI | 작업 로그 분류, MR diff의 비밀 정보 스캔, 토론 요약 — 모두 Ollama를 통해 로컬에서 실행 |
Related MCP server: GitLab MCP Server
🚀 빠른 시작
사전 요구 사항
Docker 및 Docker Compose v2
GitLab Personal Access Token (
api범위)
WSL2(Windows 사용자): WSL2 백엔드를 활성화한 상태로 Docker Desktop for Windows를 설치하세요. 이것이 가장 쉬운 방법입니다. 아래 모든 명령은 WSL2 터미널에서 실행하세요.
1. 클론 및 구성
git clone https://github.com/haziqasjad/gitlab-ai-mcp.git
cd gitlab-ai-mcp
cp .env.example .env.env 파일을 편집하세요:
GITLAB_URL=https://gitlab.example.com # your GitLab instance URL
GITLAB_TOKEN=glpat-your-token # your Personal Access Token2. 설정을 선택하고 시작하세요
옵션 A — 핵심 전용 (처음 시작할 때 권장 — 로컬 AI 없이 모든 머신에서 동작):
docker compose up -d --build옵션 B — CPU에서 로컬 AI 사용 (Ollama가 CPU에서 실행되며 첫 실행 시 ~4 GB 모델을 다운로드합니다):
docker compose --profile ollama up -d --build옵션 C — NVIDIA GPU에서 로컬 AI 사용 (가장 빠른 추론 — 아래 추가 설정 필요):
docker compose --profile ollama -f docker-compose.yml -f docker-compose.gpu.yml up -d --build옵션 B와 C는 추가 AI 기능(로그 분류, 개인정보 스캔, 토론 요약)을 활성화합니다. Ollama가 실행 중이지 않으면 이러한 기능은 명확한 오류를 반환하며, 그 외 모든 기능은 정상적으로 작동합니다.
NVIDIA GPU 설정 (옵션 C만 해당)
NVIDIA GPU가 없다면 이 섹션을 건너뛰세요. 옵션 B는 CPU에서도 잘 작동합니다.
🐧 네이티브 Linux
1단계 — NVIDIA 드라이버가 설치되어 있는지 확인하세요:
nvidia-smiGPU가 나열되어 표시되어야 합니다. 그렇지 않으면 먼저 해당 배포판용 드라이버를 설치하세요: NVIDIA 드라이버 다운로드
2단계 — NVIDIA Container Toolkit 설치 (Ubuntu/Debian):
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt update && sudo apt install -y nvidia-container-toolkit3단계 — Docker를 구성하고 확인하세요:
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
# Confirm Docker can see your GPU
docker run --rm --gpus all ubuntu nvidia-smi4단계 — 스택을 시작하세요:
docker compose --profile ollama -f docker-compose.yml -f docker-compose.gpu.yml up -d --build🪟 WSL2 (Windows)
WSL2는 Windows에 설치된 NVIDIA 드라이버를 사용합니다. WSL 내부에는 GPU 드라이버를 설치하지 않습니다.
1단계 — Windows에 NVIDIA 드라이버 설치 (아직 설치되지 않은 경우):
NVIDIA 드라이버 다운로드에서 다운로드하여 설치하세요.
설치 후 Windows를 재부팅하세요.
2단계 — WSL2 내부에서 GPU가 표시되는지 확인하세요:
nvidia-smi이 방법이 작동하면 WSL2에서 GPU를 사용할 수 있습니다. 그렇지 않으면 WSL2(WSL1이 아님)를 사용하고 있는지 확인하세요:
wsl --set-default-version 23단계 — WSL2 내부에 NVIDIA Container Toolkit 설치:
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt update && sudo apt install -y nvidia-container-toolkit4단계 — Docker 구성:
Docker Desktop for Windows를 사용하는 경우(권장):
Docker Desktop을 열고 → Settings → Resources → GPU → GPU를 활성화한 다음 → Apply & Restart
Docker Engine을 WSL2에서 직접 사용하는 경우:
sudo nvidia-ctk runtime configure --runtime=docker
sudo service docker restart # WSL2 uses service, not systemctl5단계 — Docker가 GPU를 인식하는지 확인하세요:
docker run --rm --gpus all ubuntu nvidia-smi6단계 — 스택을 시작하세요:
docker compose --profile ollama -f docker-compose.yml -f docker-compose.gpu.yml up -d --build3. 서버가 실행 중인지 확인하세요
docker compose psgitlab-ai-mcp가 상태 Up으로 표시되어야 합니다. 직접 테스트해 보세요:
docker compose exec gitlab-ai-mcp python run_tests.py4. AI CLI에 등록
먼저 체크아웃 경로를 확인하세요:
pwd # run this inside the Gitlab_AI_MCP directoryWSL2 사용자: Windows 경로가 아니라
pwd로 표시된 Linux 경로(예:/home/yourname/Gitlab_AI_MCP)를 사용하세요. 이 경로가 작동하려면 AI CLI가 동일한 WSL2 터미널에서 실행 중이어야 합니다.
그런 다음 해당 경로를 사용하여 등록하세요:
Claude Code:
claude mcp add gitlab-ai-mcp -- /your/path/to/Gitlab_AI_MCP/scripts/run_codex_mcp.shCodex CLI:
codex mcp add gitlab-ai-mcp -- /your/path/to/Gitlab_AI_MCP/scripts/run_codex_mcp.shGemini CLI:
gemini mcp add gitlab-ai-mcp -- /your/path/to/Gitlab_AI_MCP/scripts/run_codex_mcp.shKimi Code CLI:
kimi mcp add gitlab-ai-mcp -- /your/path/to/Gitlab_AI_MCP/scripts/run_codex_mcp.sh⚙️ 구성
모든 설정은 .env 파일에 입력합니다:
변수 | 필수 | 기본값 | 설명 |
| 예 | — | GitLab 인스턴스의 기본 URL |
| 예 | — | 개인 액세스 토큰 ( |
| 아니요 |
| 상세 콘솔 로깅 활성화 |
| 아니요 |
| Ollama 엔드포인트 (옵션 B/C 전용) |
| 아니요 |
| Ollama 모델 이름 |
| 아니요 |
| 실패 시 API 재시도 횟수 |
| 아니요 |
| 재시도 간 기본 지연 시간(초) |
🔧 문제 해결
컨테이너가 시작되지 않는 경우:
docker compose logs gitlab-ai-mcpGITLAB_TOKEN 또는 GITLAB_URL 오류:
.env파일이 존재하고=주위에 불필요한 공백이 없는지 확인하세요.GitLab → Settings → Access Tokens에서 토큰에
api범위가 있는지 확인하세요.
Ollama 모델이 다운로드되지 않는 경우 (옵션 B/C):
docker compose logs gitlab-ai-ollama-pullGPU가 감지되지 않는 경우 (옵션 C):
nvidia-smi를 실행하세요 — 실패하면 드라이버가 설치되지 않은 것입니다.docker run --rm --gpus all ubuntu nvidia-smi를 실행하세요 — 실패하면 Container Toolkit이 구성되지 않은 것입니다.
WSL2 — WSL 내부에서 nvidia-smi를 찾을 수 없는 경우:
WSL1이 아닌 WSL2를 사용하고 있는지 확인하세요. PowerShell에서
wsl --list --verbose를 실행하고 VERSION 열을 확인하세요.Windows(WSL 내부가 아닌)에 NVIDIA 드라이버를 설치하고 재부팅하세요.
WSL2 — systemctl: command not found:
WSL2는 기본적으로 systemd를 사용하지 않습니다. 대신
sudo service docker restart를 사용하세요.또는 WSL2에서 systemd를 활성화하려면
/etc/wsl.conf에[boot] systemd=true를 추가한 다음 WSL을 재시작하세요(PowerShell에서wsl --shutdown).
WSL2 — Docker Desktop GPU 토글이 없는 경우:
Docker Desktop 4.17 이상과 WSL2 백엔드가 필요합니다. GPU 옵션이 표시되지 않으면 Docker Desktop을 업데이트하세요.
WSL2 — docker compose를 찾을 수 없는 경우:
Docker Desktop은 Compose를 자동으로 설치합니다. WSL2 터미널을 사용하기 전에 Docker Desktop을 열고 실행 중인지 확인하세요.
📁 프로젝트 구조
server.py — MCP server entrypoint
config.py — Settings (reads from .env)
gitlab/client.py — Async HTTP/2 GitLab API client
services/
gitlab_service.py — Business logic and response formatting
local_ai_service.py — Ollama integration for local AI features
review_digest.py — MR discussion digest helpers
tools/ — MCP tool definitions (one file per domain)
tests/ — Unit tests
scripts/run_codex_mcp.sh — Launcher used by all AI CLIs
docker-compose.yml — Base stack
docker-compose.gpu.yml — NVIDIA GPU override (use with --profile ollama)This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceConnects AI assistants to GitLab, allowing users to manage merge requests, view reviews, and interact with discussions through natural language queries.1225MIT
- Flicense-quality-maintenanceConnects AI assistants to GitLab projects, enabling natural language queries for merge requests, code reviews, pipeline tests, job logs, and commit discussions with support for responding to comments.
- Flicense-quality-maintenanceConnects AI assistants to GitLab projects, enabling natural language queries to view merge requests, code reviews, test reports, pipeline statuses, and respond to discussions.
- Flicense-quality-maintenanceConnects AI assistants to GitLab projects, enabling users to query merge requests, review discussions, view test results and pipelines, search by branch, and respond to comments through natural language commands.
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Connect AI assistants to Stellary projects, boards, documents, and governed agent workflows.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/haziqasjad/gitlab-ai-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server