# VS Code + Claude Code

## Introduction

This guide explains how to integrate **Claude Code** (Anthropic’s AI coding assistant) with **Mobb Vibe Shield (MVS)** to automatically detect and fix security vulnerabilities in your code.

After setup, you’ll be able to use Mobb’s MCP (Model Context Protocol) tools directly inside Claude — both through the **Claude CLI** and the **Claude Code VS Code extension**.

***

## Step 1. Install Claude Code CLI

Claude Code provides a command-line interface that manages configuration, context, and MCP servers.

**Installation Instructions:**\
Follow the official Claude Code CLI setup guide:\
👉 [Claude Code CLI Setup](https://docs.claude.com/en/docs/claude-code/setup)

Once installed, verify installation with:

```bash
claude --version
```

If this returns a version number, you’re ready to proceed.

***

## Step 2. (Optional) Install Claude Code for VS Code Extension

Installing the Claude VS Code extension provides an integrated IDE experience similar to GitHub Copilot. However, **this step is optional**, since you can perform all steps and interactions directly in the **Claude CLI** inside your VS Code terminal.

**Install from the Marketplace:**\
👉 [Claude Code for VS Code](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code)

Once installed, the extension automatically detects any MCP servers configured through the CLI.

***

## Step 3. Add Mobb MCP to Claude

The **Mobb MCP** server connects Claude to Mobb Vibe Shield’s auto-fix engine. This configuration is **project-scoped**, meaning your `.mcp.json` file will live in the project root and can be versioned for team use.

1. Open a terminal in your project directory:

   ```powershell
   PS C:\Users\Antony> cd C:\git-repositories\git-node-app-test2\
   ```
2. Add Mobb MCP (multi-tenant setup):

   ```bash
   claude mcp add --transport stdio mobb-mcp --scope project -- npx -y mobbdev@latest mcp
   ```

   This command:

   * Configures the **Mobb MCP** tool in `.mcp.json`
   * Enables project-level collaboration
3. **Verify `.mcp.json` was created** in your project directory.\
   It should look like this:

   ```json
   {
     "mcpServers": {
       "mobb-mcp": {
         "command": "npx",
         "args": ["-y", "mobbdev@latest", "mcp"]
       }
     }
   }
   ```
4. For **Enterprise Single-Tenant** deployments, include tenant environment variables:

   ```bash
   claude mcp add --transport stdio mobb-mcp --scope project \
     --env API_URL=https://api-st-<YOUR_TENANT_NAME>.mobb.ai/v1/graphql \
     --env WEB_APP_URL=https://<YOUR_TENANT_NAME>.mobb.ai \
     -- npx -y mobbdev@latest mcp
   ```
5. Once complete, Claude will automatically detect the configuration when launched.

***

## Step 4. Confirm MCP Detection and Approval

1. Run Claude in the terminal:

   ```bash
   claude
   ```
2. You’ll see a message that a new MCP server was found in `.mcp.json`:

   <figure><img src="/files/K6oTRmJaNH4VECeztOSz" alt=""><figcaption></figcaption></figure>
3. Select `1` — **Use this and all future MCP servers in this project**.

***

## Step 5. Verify Mobb MCP Connection

Check the connection:

```bash
/mcp
```

Expected output:

```
1. mobb-mcp   ✓ connected
```

<figure><img src="/files/fWRHhJFXrfXphQzJ9bKo" alt=""><figcaption></figcaption></figure>

If not connected, run:

```bash
/doctor
```

This helps identify missing dependencies or permission issues.

***

## Step 6. Using Mobb MCP in Claude Code for VS Code

Once verified in the CLI, the VS Code extension automatically inherits the configuration.

1. Open the **Claude Code sidebar** in VS Code.
2. Run `/mcp` again to verify `mobb-mcp` is connected.

   <figure><img src="/files/k4WxAxL38zICCEqguJb1" alt=""><figcaption></figcaption></figure>

You can also ask Claude:

```
what tools can you see
```

You should see these available tools:

```
mcp__mobb-mcp__scan_and_fix_vulnerabilities
mcp__mobb-mcp__fetch_available_fixes
mcp__mobb-mcp__check_for_new_available_fixes
```

MVS is now fully integrated with Claude Code.

***

## Step 7. (Optional) Install the MVS Rulebook

Install a **MVS rulebook** to guide Claude’s behavior during secure code generation.

1. Download the rulebook file:

{% file src="/files/e2ehp4iO1uE2o9m9LL85" %}

2. Save it to:

```
.claude/CLAUDE.md
```

**Purpose:**

* Enforces Mobb’s `scan_and_fix_vulnerabilities` capability
* Ensures vulnerabilities are rechecked after code changes
* Automatically adds reusable prevention rules under `.claude/instructions/`

***

## Step 8. Troubleshooting

| Issue                    | Possible Cause                 | Recommended Action            |
| ------------------------ | ------------------------------ | ----------------------------- |
| MCP not listed in `/mcp` | `.mcp.json` missing or invalid | Re-run `claude mcp add`       |
| Connection error         | Missing Node.js                | Ensure Node ≥ 18 is installed |
| Enterprise tenant issue  | Wrong API\_URL/WEB\_APP\_URL   | Double-check tenant URLs      |
| Permission errors        | VS Code running elevated       | Reopen without admin mode     |

***

## Summary

Claude Code and Mobb Vibe Shield (MVS) are now connected through MCP. You can now use Mobb’s AI-generated fixes directly within Claude Code for automated, continuous secure coding.


---

# 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-+-claude-code.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.
