VS Code + GitLab Duo Chat

Prerequisites

  • Access to a GitLab group/project with GitLab Duo. If you don't have GitLab Duo, you can sign up for a 30 day free trial here.

  • VS Code installed.

  • GitLab Workflow VS Code extension (recommended ≥ 6.35.6). Extension ID: GitLab.gitlab-workflow.

  • Node.js 20 and above.

  • Mobb account + Mobb API Token. Learn how to generate a Mobb API Token here.


Step 1 — Enable MCP at the GitLab group

  1. In GitLab, open your GroupSettingsGitLab DuoConfigure Features.

    Click the checkbox under Feature Preview to enable preview features.

  2. Under Model Context Protocol, check Turn on Model Context Protocol (MCP) support, then Save changes.


Step 2 — Enable the Duo Agent Platform in VS Code

  1. Install GitLab Workflow from the VS Code Marketplace (ID: GitLab.gitlab-workflow).

  2. In VS Code, open Settings and search for agent platform.

  3. Enable GitLab › Duo Agent Platform: Enabled.

  4. Open the GitLab Duo Agent Platform (Beta) view in the left sidebar and confirm the Chat tab loads.


Step 3 — Choose where to store your MCP config

GitLab’s VS Code client reads both user and workspace configs and merges them (workspace overrides). Keep secrets in user config when possible.

Create or open mcp.json in your home config folder:

  • Windows: C:\Users\<you>\AppData\Roaming\GitLab\duo\mcp.json

  • macOS/Linux: ~/.gitlab/duo/mcp.json

Tip: Command Palette → GitLab MCP: Open User Settings (JSON) will open/create this file.

Option B — Workspace configuration (project-specific)

Create the file in your repo:

<repo>/.gitlab/duo/mcp.json

Security note: Currently the API key is stored in mcp.json. If you use a workspace config, add this path to .gitignore (or use user config) to avoid committing secrets.


Step 4 — Add the Mobb MCP server to mcp.json

Below are ready-to-use configurations to enable the Mobb MCP:

A) Standard Configuration (Public Tenant)

{
  "mcpServers": {
    "mobb-mcp": {
      "command": "npx",
      "args": ["-y", "mobbdev@latest", "mcp"],
      "env": {
        "API_KEY": "<YOUR_MOBB_API_KEY>"
      }
    }
  }
}

B) Mobb Single-Tenant Configuration

{
  "mcpServers": {
    "mobb-mcp": {
      "command": "npx",
      "args": ["-y", "mobbdev@latest", "mcp"],
      "env": {
        "API_KEY": "<YOUR_MOBB_API_KEY>",
        "API_URL": "https://api-st-<TENANT>.mobb.ai",
        "WEB_APP_URL": "https://<TENANT>.mobb.ai"
      }
    }
  }
}

Required: API_KEY must be placed in mcp.json for this VS Code client flow. Optional: API_URL and WEB_APP_URL are for single-tenant hosts and deep links.


Step 5 — Verify the Mobb tools load

  1. In VS Code, open GitLab Duo Agent Platform (Beta)Chat.

  2. Run one of the Quick start prompts below.

  3. The extension will initialize the MCP server and expose the Mobb tools for the agent to call.


Quick start prompts (copy/paste)

Use these in Duo Chat inside the GitLab Duo Agent Platform view:

  • Fetch all available fixes from Mobb. Then show me a summary by severity.”

  • Scan and generate fixes for all available issues in my project"

  • Create a patch with the top 5 available fixes by severity and explain changes inline before applying.”

  • Check and fetch remaining available fixes after the last patch.”


Troubleshooting

  • spawn … ENOENT / server won’t start Ensure node/npx are on your PATH, or provide absolute paths in command.

  • No tools appear in Chat

    • Confirm you're using GitLab Duo Agent Platform and NOT GitLab Duo Chat (Which lacks agentic capbilities)

    • Confirm you’re on GitLab Workflow ≥ 6.35.6 if you rely on both user and workspace configs.

    • Validate your mcp.json syntax and paths.

  • Agentic Chat panel doesn’t render Make sure Duo Agent Platform is enabled in VS Code settings and you’re authenticated with GitLab.com in the extension.

Last updated

Was this helpful?