# 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](/mobb-user-docs/administration/access-tokens.md#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="/files/AwnuD0oBpPZXaUQfeVI5" alt=""><figcaption></figcaption></figure>

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

   <figure><img src="/files/ASKTk5YQWiigj01WBCWR" alt=""><figcaption></figcaption></figure>
2. Under **Model Context Protocol**, check **Turn on Model Context Protocol (MCP) support**, then **Save changes**.\\

   <figure><img src="/files/kSHsNprGay82cSebIUI0" 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="/files/SrIe6CauZd14LXmyeBVO" 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="/files/SueNycJMOXOHyg61JYgy" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mobb.ai/mobb-user-docs/getting-started/mobb-vibe-shield-mvs/vs-code-+-gitlab-duo-chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
