GitLab MR MCP

GitLab MR MCP

An MCP server for AI-powered interaction with GitLab merge requests and issues.

65
Stars
19
Forks
65
Watchers
7
Issues
GitLab MR MCP implements a server for the Model Context Protocol (MCP) enabling AI agents to perform structured interactions with GitLab repositories. It provides capabilities for reading merge request and issue details, listing projects, fetching diffs and comments, and making changes such as commenting or updating titles and descriptions. Installation is supported via Smithery or manually, and integration with MCP clients and Inspector tools is documented for development and troubleshooting.

Key Features

List accessible GitLab projects
Fetch merge request details and comments
Retrieve merge request diffs
Post general and line-specific comments on merge requests
Fetch and manage issue details
Update merge request titles and descriptions
Manual and automated installation support
Integration with MCP Inspector
Token-based authentication for GitLab API
Environment variable configuration

Use Cases

Automating code review processes with AI agents
Building AI-powered developer assistants for GitLab
Generating and managing GitLab merge request feedback programmatically
Synchronizing project issue data with AI tools
Automating merge request metadata updates (title, description)
Enabling AI-driven triage and discussion of code changes
Providing context-aware code review suggestions to developers
Monitoring and tracking GitLab project activity for machine learning pipelines
Enhancing collaborative workflows with intelligent commenting
Integrating MCP-compliant tools into DevOps pipelines

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:

bash
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:
bash
npm install
  1. Add the following to your MCP client configuration:
json
{
  "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:

bash
export MR_MCP_GITLAB_TOKEN=your_gitlab_token
export MR_MCP_GITLAB_HOST=your_gitlab_host

# Optional evn 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:

bash
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.

Star History

Star History Chart

Repository Owner

Repository Details

Language JavaScript
Default Branch main
Size 130 KB
Contributors 6
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
96.99%
Dockerfile
3.01%

Tags

Topics

gitlab mcp mcp-server merge-requests

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • MCP Linear

    MCP Linear

    MCP server for AI-driven control of Linear project management.

    MCP Linear is a Model Context Protocol (MCP) server implementation that enables AI assistants to interact with the Linear project management platform. It provides a bridge between AI systems and the Linear GraphQL API, allowing the retrieval and management of issues, projects, teams, and more. With MCP Linear, users can create, update, assign, and comment on Linear issues, as well as manage project and team structures directly through AI interfaces. The tool supports seamless integration via Smithery and can be configured for various AI clients like Cursor and Claude Desktop.

    • 117
    • MCP
    • tacticlaunch/mcp-linear
  • MyMCP Server (All-in-One Model Context Protocol)

    MyMCP Server (All-in-One Model Context Protocol)

    Powerful and extensible Model Context Protocol server with developer and productivity integrations.

    MyMCP Server is a robust Model Context Protocol (MCP) server implementation that integrates with services like GitLab, Jira, Confluence, YouTube, Google Workspace, and more. It provides AI-powered search, contextual tool execution, and workflow automation for development and productivity tasks. The system supports extensive configuration and enables selective activation of grouped toolsets for various environments. Installation and deployment are streamlined, with both automated and manual setup options available.

    • 93
    • MCP
    • nguyenvanduocit/all-in-one-model-context-protocol
  • Plane MCP Server

    Plane MCP Server

    Enables LLMs to manage Plane.so projects and issues via the Model Context Protocol.

    Plane MCP Server provides a standardized interface to connect large language models with Plane.so project management APIs. It enables LLMs to interact directly with project and issue data, supporting tasks such as listing projects, retrieving detailed information, creating and updating issues, while prioritizing user control and security. Installation is streamlined through tools like Smithery, and configuration supports multiple clients including Claude for Desktop.

    • 32
    • MCP
    • kelvin6365/plane-mcp-server
  • Azure DevOps MCP Server

    Azure DevOps MCP Server

    Standardized AI access to Azure DevOps via Model Context Protocol.

    Implements the Model Context Protocol (MCP) to enable AI assistants to securely and efficiently interact with Azure DevOps resources. Provides a standardized bridge for managing projects, work items, repositories, pull requests, and pipelines through natural language interfaces. Supports modular authentication and a feature-based architecture for scalability and integration. Facilitates seamless integration with AI tools such as Claude Desktop and Cursor AI.

    • 306
    • MCP
    • Tiberriver256/mcp-server-azure-devops
  • mcp-graphql

    mcp-graphql

    Enables LLMs to interact dynamically with GraphQL APIs via Model Context Protocol.

    mcp-graphql provides a Model Context Protocol (MCP) server that allows large language models to discover and interact with GraphQL APIs. The implementation facilitates schema introspection, exposes the GraphQL schema as a resource, and enables secure query and mutation execution based on configuration. It supports configuration through environment variables, automated or manual installation options, and offers flexibility in using local or remote schema files. By default, mutation operations are disabled for security, but can be enabled if required.

    • 319
    • MCP
    • blurrah/mcp-graphql
  • Teamwork MCP Server

    Teamwork MCP Server

    Seamless Teamwork.com integration for Large Language Models via the Model Context Protocol

    Teamwork MCP Server is an implementation of the Model Context Protocol (MCP) that enables Large Language Models to interact securely and programmatically with Teamwork.com. It offers standardized interfaces, including HTTP and STDIO, allowing AI agents to perform various project management operations. The server supports multiple authentication methods, an extensible toolset architecture, and is designed for production deployments. It provides read-only capability for safe integrations and robust observability features.

    • 11
    • MCP
    • Teamwork/mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results