# Cursor

## Prerequisites

Before setting up MVS, ensure the following:

* **Cursor** is installed and up to date.
* **Node.js v18.20 or later** is installed. (Check with `node --version`)

## Setup Instructions

**Step 1.** **Create the MCP Configuration File**

In your project root, create a file at `.vscode/mcp.json` (Cursor supports this path):

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

For single-tenant users, add the variables `API_URL` and `WEB_APP_URL` in the `env` section. You can also specify which modes are enabled using `TOOLS_ENABLED`:

```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": "fetch_available_fixes"
      }
    }
  }
}
```

**Step 2.** **Start the MCP Server**

Cursor will automatically detect the `mcp.json` file and start the server. You should see logs indicating the server is running and tools are available. **Step 3.** **Using the Modes**

* To scan and fix vulnerabilities, use the `scan_and_fix_vulnerabilities` tool.
  * Example prompt: `Scan and fix vulnerabilities in my project using Mobb MCP.`
* To fetch available fixes, use the `fetch_available_fixes` tool.
  * Example prompt: `Check for available fixes using the Mobb MCP.`
* To trigger the background scan for new fixes, use the `check_for_new_available_fixes` tool. The first call starts the scan, and MVS will continue to check every 15 minutes.
  * Example prompt: `Check for new available fixes using the Mobb MCP.`

## Deploying a Rulebook for Automated Security Scanning and Fixing

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

To ensure comprehensive security coverage in your development workflow, we recommend the deployment of a security-focused rulebook that mandates Mobb vulnerability scanning and fixing after every code change. In the attached rulebook `.security.mdc`, the following rules are specified:

* **Automatic Mobb scanning and fixing** after implementing any new features or making code changes
* **Security fix rule creation** for every vulnerability type discovered by Mobb
* **Vulnerability prevention** by building a library of security fix rules specific to your codebase

### Deployment Instructions:

1. **Download the rulebook**: Save the `security.mdc` file to your project's `.cursor/rules/` directory
2. **Enable always-apply mode**: The rulebook is configured with `alwaysApply: true` to ensure it's enforced on every interaction
3. **Verify enforcement**: The rulebook includes a critical checklist that prevents task completion without proper security scanning

For more details about Cursor Rules, see the [Cursor Rules documentation](https://docs.cursor.com/context/rules).

## Troubleshooting

* Ensure Node.js is available in your system PATH.
* Check the MCP server logs in Cursor for errors.
* Validate your `mcp.json` syntax and paths.
* Restart Cursor if the MCP server fails to launch after edits.
* For more information, refer to the [VS Code guide](/mobb-user-docs/getting-started/mobb-vibe-shield-mvs/vs-code-+-github-copilot.md) for similar setup steps and troubleshooting tips.


---

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