Turning GitLab Merge Requests into MCP-Native Data with gitlabmcp
AI copilots are only as helpful as the context they can reach. Most GitLab reviews still involve tab juggling and copy-pasting links into assistants. So I built @archisbhoir/gitlabmcp: an MCP server plus npm library that exposes complete merge request context (commits, discussions, pipelines, approvals, diffs, jobs) to any MCP-compatible client with one command.
Why a GitLab MCP server?
- Unified MR snapshot: GitLab splits data between GraphQL and REST. MCP clients want one payload.
- Transport flexibility: Some copilots launch stdio servers locally; others prefer HTTP. Supporting both keeps the codebase unified.
- Automation hooks: Once the data is normalized, I can reuse it from scripts without spinning up a server.
What the MCP server provides
-
npx @archisbhoir/gitlabmcp@lateststarts either a stdio server (perfect for Claude Desktop) or an HTTP server (gitlabmcp-http). - Tool catalog includes:
-
get_merge_requestfor the full view (commits, diffs, pipelines, approvals, discussions). - Focused helpers:
get_merge_request_commits,get_merge_request_discussions,get_merge_request_diffs,get_merge_request_approvals,get_merge_requests_by_user,create_merge_request,health_check. - Pipeline tooling:
get_merge_request_pipelines,get_pipeline,get_pipeline_jobs(with status scoping).
-
- Drop-in MCP configs live in the README for Claude Desktop or any MCP client; you can also hit
/mcpvia HTTP for remote/browsers.
Library mode for scripting
Need MR or pipeline data in a Node script? Install and call the exports directly:
npm install @archisbhoir/gitlabmcp
import {
getMergeRequestView,
fetchAllCommits,
fetchAllDiscussions,
getMRChangesRest,
getMRApprovalsRest,
getMRPipelines,
getPipeline,
getPipelineJobs,
} from '@archisbhoir/gitlabmcp';
const view = await getMergeRequestView('group/project', '123');
const pipelines = await getMRPipelines('group/project', '123');
const jobs = await getPipelineJobs('group/project', '456', { scope: 'failed' });
All helpers read GITLAB_BASE_URL and GITLAB_TOKEN from process.env (or .env), so scripts get the same normalization as the MCP server.
Quick-start commands
# Stdio MCP server (Claude Desktop, other stdio clients)
npx @archisbhoir/gitlabmcp@latest
# HTTP MCP server
npx -p @archisbhoir/gitlabmcp@latest node dist/server-http.js
Set the environment variables first:
export GITLAB_BASE_URL=https://gitlab.example.com
export GITLAB_TOKEN=glpat-your-token-with-read_api-or-api
Pipelines front and center
Release engineers often ask for pipeline history while reviewing a merge request. Instead of opening GitLab separately, copilots can call:
-
get_merge_request_pipelines→ all pipelines tied to an MR. -
get_pipeline→ details on any pipeline (status, SHA, web URL, source). -
get_pipeline_jobs→ individual jobs filtered by status (running,failed,manual, etc.).
Combine those with MR discussions or diffs to build “summarize failing jobs” workflows entirely inside your MCP client.
Visualizing the data flow
Where to go next
- Docs & code: https://github.com/archisbhoir/gitlabmcp
- npm: https://www.npmjs.com/package/@archisbhoir/gitlabmcp
- Ideas welcome: I’m eyeing reviewer insights and automated summaries next—let me know what would make your MR reviews easier.
Whether you want your AI assistant to summarize discussions, remind you of pending approvals, or watch pipeline failures, gitlabmcp keeps GitLab context flowing directly into the MCP ecosystem. Let me know how it works for you and what tooling you’d like layered on top.

Top comments (0)