Skip to main content
Glama
nonamebkz

mcp-http-gitlab

by nonamebkz

mcp-http-gitlab

MCP server for posting inline comments on GitLab merge request line changes via the REST API.

Tools

Tool

Description

gitlab_get_merge_request

MR metadata and diff_refs SHAs

gitlab_get_mr_changes

Changed files with raw diffs

gitlab_create_mr_line_comment

Post inline comment on a diff line

Related MCP server: GitLab Code Review MCP

Setup

npm install
npm run build

Environment

Variable

Required

Default

Description

GITLAB_TOKEN

yes

Personal access token with api scope

GITLAB_URL

no

https://gitlab.com

GitLab instance base URL

Cursor MCP config

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-http-gitlab/dist/index.js"],
      "env": {
        "GITLAB_TOKEN": "glpat-your-token-here",
        "GITLAB_URL": "https://gitlab.com"
      }
    }
  }
}

Typical agent flow

  1. gitlab_get_merge_request — confirm MR state and get SHAs

  2. gitlab_get_mr_changes — read diffs and pick a file/line

  3. gitlab_create_mr_line_comment — post the review comment

Example: create inline comment

{
  "project_path": "my-group/my-repo",
  "mr_iid": 42,
  "file_path": "src/main.ts",
  "line_number": 15,
  "body": "Consider extracting this into a helper function."
}

Agent integration

Skill, Cursor rules, and install snippets live in agent/:

./agent/scripts/install-cursor.sh   # symlink skill → ~/.cursor/skills/

Copy agent/cursor-rules/*.mdc into target repos under .cursor/rules/. See agent/README.md for full integration steps.

Notes

  • Token is read from the environment only (never passed as a tool argument).

  • The server validates the token on startup via GET /user.

  • Line numbers refer to lines visible in the MR diff (new-file lines for additions/context).

  • Renamed files are resolved automatically from MR changes.

  • MVP scope: new discussions only (no reply/resolve).

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to review GitLab merge requests by fetching changes, analyzing diffs, adding comments, and managing approvals through the GitLab API. Supports complete merge request analysis, file-specific reviews, and version comparisons.
    12
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to review GitLab merge requests by fetching diffs, analyzing code changes, adding comments, and managing approvals through the GitLab API. Supports comprehensive merge request analysis and version comparison for automated code review workflows.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with GitLab repositories, manage merge requests, review code diffs, post comments, and handle issues directly through natural language.
    32 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with GitLab repositories, allowing them to manage merge requests and issues including listing projects, fetching MR details and diffs, adding comments, and updating MR titles and descriptions.
    32 npm
    94
    MIT