> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptguard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Use PromptGuard in Cursor: the MCP server, the editor extension, and the agent rules and commands

> [!NOTE]
>
> PromptGuard works in Cursor three ways, which you can combine: the [MCP server](https://docs.promptguard.co/tools/mcp.md) gives the Cursor agent PromptGuard tools, the [editor extension](https://docs.promptguard.co/tools/vscode.md) marks unprotected LLM SDK calls in your code, and the [PromptGuard plugin](https://github.com/promptguardhq/promptguard-plugin)'s rules and commands steer the agent toward secure LLM code.

## MCP server

Open this link in Cursor to add PromptGuard's hosted server, then click **Needs login** next to it and sign in with your PromptGuard account. There is no API key to copy:

```
cursor://anysphere.cursor-deeplink/mcp/install?name=promptguard&config=eyJ1cmwiOiJodHRwczovL2FwaS5wcm9tcHRndWFyZC5jby9tY3AifQ==
```

It adds this entry to your Cursor MCP configuration:

```json theme={"system"}
{
  "mcpServers": {
    "promptguard": {
      "url": "https://api.promptguard.co/mcp"
    }
  }
}
```

The agent can then scan text for prompt injection and other threats, redact PII, and find LLM SDK calls in code you give it. To let it scan the files of your project instead, add the [local server](https://docs.promptguard.co/tools/mcp.md#local-server), which runs the [PromptGuard CLI](https://docs.promptguard.co/tools/cli.md) on your machine. The tools each server offers, and their parameters, are on the [MCP server page](https://docs.promptguard.co/tools/mcp.md#available-tools).

## Editor extension

The [PromptGuard extension](https://docs.promptguard.co/tools/vscode.md) runs in Cursor, but it is not on Open VSX, so Cursor's extension search does not find it. Download `promptguard-vscode-<version>.vsix` from the [latest release](https://github.com/promptguardhq/promptguard-vscode/releases/latest), then run **Extensions: Install from VSIX...** from the Command Palette and choose the file. It is not updated automatically: install each new release's `.vsix` the same way.

## Rules and commands

The [PromptGuard plugin repository](https://github.com/promptguardhq/promptguard-plugin) holds Cursor rules and agent commands. It is not listed in the Cursor Marketplace; to use them, copy them into your project:

* `rules/secure-llm-usage.mdc` and `rules/llm-security-review.mdc` into `.cursor/rules/`
* `commands/promptguard-scan.md` and `commands/promptguard-secure.md` into `.cursor/commands/`

| File | What it does |
| - | - |
| `secure-llm-usage.mdc` | Always applied. When the agent writes code that uses an LLM SDK, it adds PromptGuard auto-instrumentation (`promptguard.init()`), keeps keys in environment variables, and flags user input concatenated into prompts. |
| `llm-security-review.mdc` | A security review checklist for LLM code going to production. |
| `/promptguard-scan` | Find unprotected LLM calls, hardcoded secrets and missing configuration, report them and offer fixes. |
| `/promptguard-secure` | Add PromptGuard to the project: install the SDK, add initialization, set environment variables and verify the integration. |

The same repository packages skills and a security-reviewer agent for Claude Code and Codex; its [README](https://github.com/promptguardhq/promptguard-plugin#readme) covers those.

## Related

* [Plugin source](https://github.com/promptguardhq/promptguard-plugin)
* [CLI source](https://github.com/promptguardhq/promptguard-cli)
* [Extension source](https://github.com/promptguardhq/promptguard-vscode)
* [PromptGuard Dashboard](https://app.promptguard.co)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.