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

# Connect Cursor

> Add the Ocean Security MCP server to Cursor, globally or per project.

## Overview

[Cursor](https://docs.cursor.com) supports MCP servers in its agent. This guide adds Ocean as
a remote MCP server so Cursor can query threats, metrics, phishing reports, and allow/deny
lists.

For connection details and the full tool catalog, see the
[MCP Server Overview](/api-reference/mcp/overview).

## Prerequisites

* Cursor installed.
* MCP access enabled for your tenant.
* An Ocean account to sign in with — or, if you're using the API key method, an Ocean **API
  key** (see [Authentication](/api-reference/introduction#authentication)).

## Where the config lives

Cursor reads MCP servers from an `mcp.json` file. Choose where to put the Ocean entry:

* **Global** (all projects): `~/.cursor/mcp.json`
* **Project** (this workspace only): `.cursor/mcp.json` in the project root

## Add with OAuth (recommended)

Add Ocean as a remote server with no credential, and let Cursor run the OAuth flow:

```json mcp.json theme={null}
{
  "mcpServers": {
    "ocean": {
      "url": "https://api.ocean.security/mcp"
    }
  }
}
```

Open **Cursor Settings → MCP** (or **Tools & Integrations**). The `ocean` server prompts you to
log in; complete the browser sign-in with your Ocean account and approve the access Cursor
asked for. Cursor stores the token and refreshes it automatically.

Because there's no secret in the file, this entry is safe to commit — each teammate
authenticates as themselves.

<Note>
  OAuth access to Ocean is **read-only**. If you need the allow/deny write tools, use an API
  key instead — see [Authentication](/api-reference/mcp/overview#authentication).
</Note>

## Add with an API key

Put your API key in the `headers` block instead:

```json mcp.json theme={null}
{
  "mcpServers": {
    "ocean": {
      "url": "https://api.ocean.security/mcp",
      "headers": {
        "X-Api-Key": "YOUR_API_KEY"
      }
    }
  }
}
```

<Warning>
  For a project-scoped `.cursor/mcp.json` that you commit, don't hard-code the key. Reference an
  environment variable — `"X-Api-Key": "${OCEAN_API_KEY}"` — and export `OCEAN_API_KEY` in your
  shell before launching Cursor.
</Warning>

## Verify the connection

<Steps>
  <Step title="Check the server is enabled">
    In **Cursor Settings → MCP**, confirm `ocean` shows a green (connected) status and that its
    tools are listed.
  </Step>

  <Step title="Ask a question">
    In the Cursor chat (Agent mode), try **"Use Ocean to list recent phishing reports"** and
    confirm Cursor calls an Ocean tool.
  </Step>
</Steps>

## Troubleshooting

* **Server shows red / not connected.** Confirm the URL is `https://api.ocean.security/mcp`.
  Toggle the server off and on in MCP settings.
* **Stuck asking you to log in.** Remove the `ocean` entry, save, then add it back so Cursor
  re-runs the OAuth flow from scratch.
* **401 on tool calls.** With an API key, the key is missing, expired, or inactive — update it
  in `mcp.json`. With OAuth, log in again from MCP settings.
* **No Ocean tools listed.** MCP access may not be enabled for your tenant, or your identity
  lacks the relevant permissions. See the
  [overview troubleshooting](/api-reference/mcp/overview#troubleshooting).
