mcpField
πŸš€
πŸš€ GitLab MR MCP

πŸš€ GitLab MR MCP

Local
github.com/kopfrechnerVersion Control94Updated 2d ago

About πŸš€ GitLab MR MCP

GitLab MR MCP is an MCP server that lets AI agents work with GitLab merge requests and issues. It is aimed at teams that want agents to assist with code review through the GitLab API.

Key features

  1. 01List GitLab projects accessible with a token
  2. 02Fetch merge request details, diffs and comments
  3. 03Add general and line-specific comments
  4. 04Set merge request title and description

Use cases

  1. 01Assisting code review of merge requests with an AI agent
  2. 02Leaving line-level feedback on merge request diffs

MCP support

The project is an MCP server that exposes GitLab merge request and issue tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json Β· Universal config
{
"mcpServers": {
"gitlab-mr": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
Run commandnpx -y @smithery/cli

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@smithery/cli

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MseeP.ai Security Assessment Badge

GitHub stars License smithery badge

πŸš€ GitLab MR MCP

A Model Context Protocol (MCP) server for interacting with GitLab merge requests and issues.

πŸ“Œ Overview

This project implements a server using the Model Context Protocol (MCP) that allows AI agents to interact with GitLab repositories. It provides tools for:

  • Listing available GitLab projects
  • Fetching merge request details and comments
  • Getting merge request diffs
  • Adding comments to merge requests
  • Adding line-specific comments to code in merge request diffs
  • Fetching issue details
  • Setting merge request title and description

πŸ“¦ Installation

⚑ Using Smithery

To install GitLab MR MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli@latest install @kopfrechner/gitlab-mr-mcp --client claude --config '"{\"gitlabMrMcpToken\":\"YOUR_GITLAB_TOKEN\", \"gitlabMrMcpHost\": \"YOUR_GITLAB_HOST\"}"'
πŸ› οΈ Manual Installation
πŸ”§ Prerequisites
  • Node.js
  • GitLab access token with API access
  • GitLab project ID(s)
πŸ“– Setup
  1. Clone this repository
  2. Install dependencies:
npm install
  1. Add the following to your MCP client configuration:
{
  "mcpServers": {
    "gitlab-mr-mcp": {
      "command": "node",
      "args": ["/path/to/gitlab-mr-mcp/index.js"],
      "env": {
        "MR_MCP_GITLAB_TOKEN": "your_gitlab_token",
        "MR_MCP_GITLAB_HOST": "your_gitlab_host"
      }
    }
  }
}

πŸ› οΈ Available Tools

  • get_projects Gets a list of GitLab projects accessible with your token.

  • list_open_merge_requests Lists all open merge requests in the specified project.

  • get_merge_request_details Gets detailed information about a specific merge request.

  • get_merge_request_comments Gets comments from a specific merge request, including discussion notes and diff notes.

  • add_merge_request_comment Adds a general comment to a merge request.

  • add_merge_request_diff_comment Adds a comment to a specific line in a file within a merge request.

  • get_merge_request_diff Gets the diff for a merge request.

  • get_issue_details Gets detailed information about a specific issue.

  • set_merge_request_title Set the title of a merge request

  • set_merge_request_description Set the description of a merge request

πŸ—οΈ Development

πŸ” Running Inspector

Set up environment variables:

export MR_MCP_GITLAB_TOKEN=your_gitlab_token
export MR_MCP_GITLAB_HOST=your_gitlab_host

# Optional env vars to filter the projects the `get_projects` tool has access to:
# https://docs.gitlab.com/api/access_requests/#valid-access-levels
export MR_MCP_MIN_ACCESS_LEVEL=min_access_level
# Search term that should match the project path or name 
export MR_MCP_PROJECT_SEARCH_TERM=term 

For use with MCP clients, you can run:

npx -y @modelcontextprotocol/inspector npm start

πŸ› οΈ Troubleshooting

If you encounter permissions issues (403 Forbidden), check:

  1. Your GitLab token has the proper scopes (api, read_api)
  2. The token user has proper access to the projects
  3. The project IDs are correct

πŸ“œ License

MIT

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.