# IntelliJ IDEA + GitHub Copilot

## Prerequisites

Before configuring MVS in IntelliJ, ensure the following tools are installed and functional:

#### **IntelliJ IDEA**

* **IntelliJ IDEA 2024.1 or later** is recommended.
* [Download IntelliJ](https://www.jetbrains.com/idea/download/)

#### GitHub Copilot permissions

If you are using GitHub Copilot through a **GitHub organization**, verify that the following settings are enabled:

* **Copilot Chat in the IDE**
* **MCP servers in Copilot**

These settings are configured in your GitHub org admin panel:\
`Settings → Copilot → Policies`

#### **GitHub Copilot Plugin**

Install GitHub Copilot from the plugin marketplace:

1. Navigate to `Settings → Plugins → Marketplace`.
2. Search for **GitHub Copilot** and click **Install**.
3. Accept the **Third-Party Plugins Notice** when prompted.

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

Restart the IDE if prompted.

#### **Node.js**

Ensure **Node.js v18.20 or later** is available:

<pre class="language-bash"><code class="lang-bash"><strong>node --version
</strong></code></pre>

If not installed or outdated, install via [nodejs.org](https://nodejs.org/).

***

### Step 1. Load Mobb Tools in Copilot Chat

1. Open **Copilot Chat** from the right-hand sidebar.
2. Expand the chat panel and switch to the **Agent (Preview)** tab.
3. Click the **tools icon** (bottom-left of the chat panel).\\

   <figure><img src="https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-51c2488ff89f62ff7d49d5c97f9731b360ef774b%2Fimage.png?alt=media" alt="" width="404"><figcaption></figcaption></figure>
4. Click **Add More Tools...**\
   ![](https://2539741639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8WF4UBNkXMHG7Dz0RXI7%2Fuploads%2Fgit-blob-c7309117809bda0c5b1197b01488332796acf0e9%2Fimage.png?alt=media)
5. A `mcp.json` file should be opened. You will need to put the following configuration in this file:\\

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

   Save the file. \\
6. Click the tools icon again — you should now see tools listed under **MCP Server: mobb-mcp** such as:
   * `scan_and_fix_vulnerabilities`
   * `fetch_available_fixes`

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

### Step 1. Add `mcp.json` in Your Workspace

1. In your project, create a file: `.vscode/mcp.json` (yes, the IntelliJ Copilot plugin respects the same path format).
2. Add the following configuration:

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

{% hint style="success" %}
For single-tenant users, ensure you add the variables `API_URL` and `WEB_APP_URL` in the `env` section. Furthermore, `TOOLS_ENABLED` allows you to specify which [modes](https://docs.mobb.ai/mobb-user-docs/getting-started/mobb-vibe-shield-mvs/..#modes) are allowed:

For example:

```json
{
  "servers": {
    "mobb-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["--yes", "mobbdev@latest", "mcp"],
      "env": {
        "API_URL": "https://api-st-<YOUR_TENANT_NAME>.mobb.ai/v1/graphql",
        "WEB_APP_URL": "https://<YOUR_TENANT_NAME>.mobb.ai",
        "TOOLS_ENABLED": ["check_for_available_fixes"]
      }
    }
  }
}
```

{% endhint %}

***

### Step 2. Start the MCP Server

Once the `mcp.json` file is created and saved, GitHub Copilot will attempt to launch the configured servers automatically. You should see logs appear in the **GitHub Copilot MCP Log** window.

Look for:

* `Starting server mobb-mcp`
* `Connection state: Running`
* `Discovered 2 tools` (or similar)

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

***

### Step 4. Run Mobb MCP

In the chat prompt, type:

```
Check for available fixes using the Mobb MCP
```

MVS will analyze your code using the specified MCP configuration and apply security fixes interactively.

***

### Troubleshooting

* Check the **GitHub Copilot MCP Log** panel for errors.
* Ensure `node` and `npx` are available in your system PATH.
* If no tools are detected, confirm your `mcp.json` syntax and paths.
* Restart IntelliJ if the MCP server fails to launch after edits.
* If you encounter plugin issues, verify you're using the official GitHub Copilot plugin from the Marketplace.


---

# 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/intellij-idea-+-github-copilot.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.
