# VS Code + GitLab Duo Chat

{% embed url="<https://www.youtube.com/watch?v=-oLycfjlw3Q&t=66s>" %}

## 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](https://about.gitlab.com/free-trial/).
* **VS Code** installed.
* **GitLab Workflow** **VS Code extension** (recommended ≥ **6.35.6**). Extension ID: `GitLab.gitlab-workflow`.
* **Node.js v18.20 or later**.
* **Mobb account + Mobb API Token**. Learn how to generate a Mobb API Token [here](https://docs.mobb.ai/mobb-user-docs/administration/access-tokens#create-new-access-tokens).

***

## Step 1. Enable MCP at the GitLab group

1. In GitLab, open your **Group** → **Settings** → **GitLab Duo** → **Configure Features**.\\

   <figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-d82b90e3fa7708d0d569f5c1804e07fd1fef8243%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

   \
   Click the checkbox under **Feature Preview** to enable preview features. \\

   <figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-f5665b0fb32e9463bb61d6cb75d595bcb4868eb7%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Under **Model Context Protocol**, check **Turn on Model Context Protocol (MCP) support**, then **Save changes**.\\

   <figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-feeff159793280a0fe4d76a868217154a0b309e8%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

***

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

<figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-47bd2bd8b98b39662f91edf5c03e172b202505be%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

***

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

### Option A — User configuration (recommended for secrets)

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
```

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

***

## 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)

```json
{
  "mcpServers": {
    "mobb_mcp": {
      "type" :"stdio",
      "command": "npx",
      "args": ["--yes", "mobbdev@latest", "mcp"]
      }
   }
}
```

### B) Mobb Single-Tenant Configuration

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "mcpServers": {
     "mobb_mcp": {
      "type" :"stdio",
      "command": "npx",
      "args": ["--yes", mobbdev@latest", "mcp"],
      "env": {
        "API_URL": "https://api-st-&#x3C;TENANT>.mobb.ai",
        "WEB_APP_URL": "https://&#x3C;TENANT>.mobb.ai"
      }
    }
  }
}
</code></pre>

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

<figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-0dc0426f32cc96e4ed966f65d8557599e946fd18%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

***

## 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 projec&#x74;**"**
* “**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

* In VS Code, go to the "**Output**" console for viewing logs. Select "**GitLab Language Server**". Filter by "**MCP**" to see all MCP related logs.
* **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.
