gitlab mcp server
personal project
this started as a small tool wrapper and grew into something closer to a full gitlab client for ai agents. the goal was to let claude and cursor do real gitlab work — not just read files, but open merge requests, manage branch protection, triage issues, pull ci/cd logs when a pipeline fails, and search across projects — without me copy-pasting urls and diffs back and forth.
there are over 40 tools now, each mapped to a specific gitlab api operation with pydantic models validating both the request and response shape, so a malformed tool call fails fast instead of silently sending garbage to gitlab. the whole thing runs in docker so the token scoping and network access stay contained.
the part i’m most glad i built is the standalone gemini-powered agent that sits alongside the mcp server — it can pick up a failing pipeline, pull the logs itself, reason about the failure, and open a fix as a merge request autonomously. that’s the difference between “an agent that can call gitlab tools when i ask” and “an agent that notices something is broken and just handles it.”
the hardest design problem was scope: gitlab’s api surface is huge, and it’s tempting to expose everything. i ended up cutting tools that overlapped in function or that an agent could accomplish just as reliably by composing two simpler tools — fewer, well-specified tools consistently beat more, overlapping ones for getting an llm to pick the right one.