Published on: September 26, 2025

9 min read

GitLab Duo Agent Platform adds support for Model Context Protocol

GitLab's MCP support enhances AI-powered dev workflows, connecting Duo Agent Platform as an MCP client and serving as an MCP server for external AI assistants.

Artificial intelligence (AI) can accelerate development by generating code, debugging, and automating routine tasks. But on its own, it’s limited to trained data or public sources, while developers often need access to internal systems like project trackers, dashboards, databases, design files in Figma, or documents in Google Drive.

First introduced in GitLab Duo Agent Platform, the Model Context Protocol (MCP) gives AI secure access to internal tools so developers can get comprehensive assistance directly within their workflows.

What is MCP?

MCP, first introduced by Anthropic in 2024, is an open standard that connects AI with data and tools. It works as a secure two-way channel: MCP clients (AI applications, autonomous agents, or development tools) request data or actions, and MCP servers provide trusted, authorized responses from their connected data sources.

MCP servers act as secure bridges to various systems: They can connect to databases, APIs, file systems, cloud services, or any external tool to retrieve and provide data. This enables AI tools and agents to go beyond their initial training data by allowing them to access real-time information and execute actions, such as rescheduling meetings or checking calendar availability, while maintaining strict security, privacy, and audit controls.

Why AI use MCP instead of APIs?

You may ask: Why use MCP if AI can already call system APIs directly? The challenge is that each API has its own authentication, data formats, and behaviors, which would require AI to use custom connectors for every system and continuously maintain them as APIs evolve, making direct integrations complex and error-prone. MCP addresses this by providing a standardized, secure interface that handles authentication, permissions, and data translation. This enables AI tools to connect reliably to any system, while simplifying integration and ensuring consistent, safe behavior.

GitLab's MCP support

GitLab extends Duo Agentic Chat with MCP support, shattering the barriers that previously isolated AI from the tools developers use every day. This empowers developers to access their entire toolkit directly from their favorite IDE, in natural language, enabling GitLab Duo Agent Platform to deliver comprehensive assistance without breaking developer flow or forcing disruptive context switches.

GitLab provides comprehensive MCP support through two complementary workflows:

  • MCP client workflow: Duo Agent Platform serves as an MCP client, allowing features to access various external tools and services.

  • MCP server workflow: GitLab also provides MCP server capabilities, enabling AI tools and applications like Claude Desktop, Cursor, and other MCP-compatible tools to connect securely to your GitLab instance.

Interactive walkthrough demo of the MCP client workflow

Picture this common Monday morning scenario: Your company's checkout service is throwing timeout errors. Customers can't complete purchases, and you need to investigate fast. Normally, you'd open Jira to review the incident ticket, scroll through Slack for updates, and check Grafana dashboards for error spikes. With GitLab's MCP support, you can do all of this in natural language directly from the chat in your IDE. MCP correlates data across all your systems, giving you the full picture instantly, without leaving your development workflow.

To experience this capability firsthand, we've created an interactive walkthrough illustrating the payment service scenario above. Click the image below to start the demo.

MCP walkthrough

Setting up GitLab MCP client

Before you can start querying data through GitLab Duo Agentic Chat or the software development flow, you need to configure MCP in your development environment. The steps include:

  • Turn on MCP for your group — Enable MCP support in your GitLab group settings to allow Duo features to connect to external systems.

  • Set up MCP servers — Define the MCP servers in JSON format in the mcp.json file. Create the file in this location:

    • Windows: C:\Users\<username>\AppData\Roaming\GitLab\duo\mcp.json
    • All other operating systems: ~/.gitlab/duo/mcp.json

{
  "mcpServers": {
    "server-name": {
      "type": "stdio",
      "command": "path/to/server",
      "args": ["--arg1", "value1"],
      "env": {
        "ENV_VAR": "value"
      }
    },
    "http-server": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    },
    "sse-server": {
      "type": "sse",
      "url": "http://localhost:3000/mcp/sse"
    }
  }
}

  • Install and configure your IDE — Ensure Visual Studio Code is installed along with the GitLab Workflow extension (Version 6.28.2 or later for basic MCP support, 6.35.6 or later for full support).

For full step-by-step instructions, configuration examples, and troubleshooting tips, see the GitLab MCP clients documentation.

Example project

To complement the walkthrough, we are sharing the project that served as its foundation. This project allows you to reproduce the same flow in your own environment and explore GitLab's MCP capabilities hands-on.

It demonstrates MCP functionality in a simulated enterprise setup, using mock data from Jira, Slack, and Grafana to model an incident response scenario. The included mcp.json configuration shows how to connect to a local MCP server (enterprise-data-v2) or optionally extend the setup with AWS services for cloud integration.


{
  "mcpServers": {
    "enterprise-data-v2": {
      "type": "stdio", 
      "command": "node",
      "args": ["src/server.js"],
      "cwd": "/path/to/your/project"
    },
    "aws-knowledge": {
      "type": "stdio"
      "command": "npx",
      "args": ["mcp-remote", "https://knowledge-mcp.global.api.aws"]
    },
    "aws-console": {
      "type": "stdio"
      "command": "npx", 
      "args": ["@imazhar101/mcp-aws-server"],
      "env": {
        "AWS_REGION": "YOUR_REGION",
        "AWS_PROFILE": "default",
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_ID",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY"
      }
    }
  }
}

Security note: The aws-console uses a community-developed MCP server package (@imazhar101/mcp-aws-server) for AWS integration that has not been independently verified.

This is intended for demonstration and learning purposes only. For production use, evaluate packages thoroughly or use official alternatives.

To get started, clone the project, install dependencies with npm install, then start the local MCP server with npm start. Create an ~/.gitlab/duo/mcp.json file with the configuration above, update the file path to match your local setup, and restart VS Code to load the MCP configuration. Optionally, add your AWS credentials to experience live cloud integration.

Clone the project here: GitLab Duo MCP Demo.

Example prompts to try with the demo project

Once you've configured the example project, you can start exploring your data and tools directly from GitLab Duo Agentic Chat in your IDE. Here are some prompts you can try:

  • "What tools can you access through MCP?"

What tools can you access through MCP?

  • "Show me recent Slack discussions about the database issues."

Slack discussion about tools to access through MCP

GitLab MCP server capabilities

So far, we've looked at how GitLab Duo Agent Platform acts as an MCP client, connecting to external MCP servers. Now, let's explore the GitLab MCP server capabilities.

The GitLab MCP server lets AI tools like Cursor or Claude Desktop connect securely to your GitLab instance and work with your development data through natural language. Authentication is handled through OAuth 2.0 Dynamic Client Registration, so AI tools can register automatically and access your GitLab data with proper authorization.

Currently, the server supports:

  • Issues — get details or create new issues
  • Merge requests — view details, commits, and file changes
  • Pipelines — list jobs and pipelines for merge requests
  • Server info — check the MCP server version

For the complete list of available tools and capabilities, see the MCP server docs.

Interactive walkthrough: GitLab MCP server in action

Experience the GitLab MCP server firsthand with our interactive walkthrough.

It guides you through setting up Cursor with the MCP server and using Cursor Chat to securely connect to your GitLab instance. You'll see how to perform actions like viewing issues, creating a new issue, and checking merge requests, all directly through natural language, without leaving your development environment.

MCP server walkthrough

How to configure MCP server in your AI tool

  1. Enable feature flags

    • Activate mcp_server and oauth_dynamic_client_generation in your GitLab instance.
  2. Add GitLab MCP server configuration to your AI tool

    • Add the MCP server entry to your tool's configuration file (mcp.json for Cursor, claude_desktop_config.json for Claude Desktop):
{
  "mcpServers": {
    "GitLab": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://<your-gitlab-instance>/api/v4/mcp",
        "--static-oauth-client-metadata",
        "{\"scope\": \"mcp\"}"
      ]
    }
  }
}

Register and authenticate

On first connection, the AI tool will:

  • Automatically register as an OAuth application

  • Request authorization for the mcp scope

Authorize in browser

When connecting, the MCP client will automatically open your default browser to complete the OAuth flow. Review and approve the request in GitLab to grant access and receive an access token for secure API access.

Access request

Using the MCP server

Once your AI tool is connected to the MCP server, you can securely fetch and act on GitLab data (issues, merge requests, and pipelines) directly from your development environment using natural language. For example:

  • Get details for issue 42 in project 123

  • Create a new issue titled "Fix login bug" with description about password special characters

  • Show me all commits in merge request 15 from the gitlab-org/gitlab project

  • What files were changed in merge request 25?

  • Show me all jobs in pipeline 12345

This feature is experimental, controlled by a feature flag, and not yet ready for production use.

For full step-by-step instructions, configuration examples, and troubleshooting tips, see the GitLab MCP server documentation.

Summary

GitLab Duo Agent Platform introduces supports for MCP, enabling AI-powered development workflows like never before. With MCP support, GitLab acts as both a client and a server:

  • MCP Client: GitLab Duo Agent Platform can securely access data and tools from external systems, bringing rich context directly into the IDE.

  • MCP server: External AI tools like Cursor or Claude Desktop can connect to your GitLab instance, access project data, and perform actions, all while maintaining strict security and privacy.

This bidirectional support reduces context switching, accelerates developer workflows, and ensures AI can provide meaningful assistance across your entire toolkit.

Try it today

Try the beta of GitLab Duo Agent Platform and explore MCP capabilities.

Read more

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum.
Share your feedback

50%+ of the Fortune 100 trust GitLab

Start shipping better software faster

See what your team can do with the intelligent

DevSecOps platform.