# VS Code + Tabnine Enterprise

## Prerequisites

Before setting up MVS, ensure the following:

* **Node.js v18.20 or later** is installed. (Check with `node --version`)
* **Tabnine Enterprise** plugin is installed and running inside VS Code.
* **Agent** mode is enabled. If you don't see the Agent mode, contact your Tabnine representative.

<figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-eb84c0d972a04102f9f51d2bff42e6c9a117bbed%2Fimage.png?alt=media" alt="Here is an example showing Agent Mode available in the Tabnine plugin" width="375"><figcaption><p>Here is an example showing <strong>Agent Mode</strong> available in the Tabnine plugin</p></figcaption></figure>

***

## Modes Supported

Mobb Vibe Shield supports three primary modes in Tabnine Enterprise:

1. **scan\_and\_fix\_vulnerabilities**: Scans and fixes vulnerabilities in recently modified files.
2. **fetch\_available\_fixes**: Applies fixes from the Mobb platform if a matching fix report exists.
3. **check\_for\_new\_available\_fixes**: Triggers a background scan for new available fixes. The first call starts the scan, and MVS will continue to scan every 15 minutes.

***

## MVS Setup Instructions

### Step 1. Locate Tabnine Configuration

Tabnine stores its MCP configuration in the following location.

```
.tabnine/mcp_servers.json
```

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

If you don't see the `mcp_servers.json` file, you can create a new one.

***

### Step 2. Configure the MCP Server

Edit `mcp_servers.json` and add the Mobb MCP configuration:

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

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

#### Single-Tenant Configuration (Optional)

For enterprise customers using a single-tenant Mobb instance, add the following environment variables in your Tabnine configuration:

```
API_URL=https://api-st-<YOUR_TENANT_NAME>.mobb.ai/v1/graphql
WEB_APP_URL=https://<YOUR_TENANT_NAME>.mobb.ai
```

Replace `<YOUR_TENANT_NAME>` with your actual tenant name.

***

### Step 4. Reload Tabnine

Reload VS Code to apply the new configuration:

```
> Developer: Reload Window
```

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

***

### Step 5. Verify Available Tools

Once reloaded, open the **Tabnine Agent tab** and prompt the following

`Which Tools do you see?`

Examine the output and confirm that the following tools are available:

* `scan_and_fix_vulnerabilities`
* `fetch_available_fixes`
* `check_for_new_available_fixes`

<figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-339b9f7ca57a4da2d46dd3d7bd3b0fea0af5369c%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.”

## Sample deployment scenario - Setting up Tabnine Guidelines

To enforce that MVS always runs at the end of a coding session, create a `rules.md` file under:

```
.tabnine/guidelines/rules.md
```

Add the following content:

```markdown
- End-of-generation actions:
    - After completing all reasoning, code edits, linting, and tests
      **ALWAYS** call the `scan_and_fix_vulnerabilities` tool from the *mobb-mcp* toolset with rescan=true.
    - Pass the absolute repository path as the `path` argument.
    - Do **NOT** skip this step under any circumstance.
    - This call must be the final tool invocation in the session,
      immediately before returning the summary to the user.
```

***

## Troubleshooting

* Ensure **Node.js** is available in your system PATH.
* Check that your **API Key** was entered correctly.
* For single-tenant users, double-check your `API_URL` and `WEB_APP_URL`.
* To verify if Mobb tools are loaded successfully, locate the Tabnine logs at **Output** -> **Tabnine.** Search for the term "tools", you shoul see the following:

```
Available tools: {"0": "scan_and_fix_vulnerabilities",...}
```

Example output:

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


---

# 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/tabnine-enterprise.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.
