# AnyRouter MCP with Cursor

> Add the AnyRouter MCP server to Cursor via the Settings UI or by editing ~/.cursor/mcp.json.


# Connect AnyRouter to Cursor

Cursor exposes MCP through a Settings UI, and you can reach the same result by editing `~/.cursor/mcp.json` directly — pick whichever you prefer below.

::::tabs

:::tab{label="Guided (UI)"}

1. Open **Cursor Settings** → **MCP & Integrations** → **Add Custom MCP**.
2. Fill in the details:
   - **Name**: `anyrouter`
   - **URL**: `https://anyrouter.dev/api/v1/mcp`
3. Click **Save**. Cursor opens your browser at `anyrouter.dev/oauth/consent` — pick a permission level (Read-only is the default and safest) and click **Allow**.

:::

:::tab{label="Manual config"}

1. Open (or create) `~/.cursor/mcp.json`.
2. Add the AnyRouter server:

   ```json
   {
     "mcpServers": {
       "anyrouter": {
         "url": "https://anyrouter.dev/api/v1/mcp"
       }
     }
   }
   ```

3. Reload Cursor. The next tool call triggers the OAuth flow at `anyrouter.dev/oauth/consent` — pick a permission level and click **Allow**.

:::

::::

## Verify

In any Cursor chat, ask **"list my AnyRouter API keys"**. The agent calls `list_keys` and surfaces the result inline. The tools you can reach depend on the permission level you granted at consent.

## Revoke

Disconnecting has two layers:

- **Cursor side** — remove the entry from Settings → MCP & Integrations, or delete it from `~/.cursor/mcp.json`.
- **AnyRouter side** — revoke the OAuth token from the [MCP dashboard](https://anyrouter.dev/dashboard/mcp). This invalidates the connection immediately; any later tool call from Cursor returns `401 Unauthorized` until you reconnect.


## Related

- [AnyRouter MCP with Claude Desktop](/docs/mcp/claude-desktop.md)
- [AnyRouter MCP with Claude Code](/docs/mcp/claude-code.md)
- [AnyRouter MCP with OpenCode](/docs/mcp/opencode.md)
- [AnyRouter MCP with other clients](/docs/mcp/other-clients.md)
