# Connect Cursor

> Source: https://developers.anymail.watch/mcp-cursor/

Cursor reads MCP servers from `mcp.json`: `.cursor/mcp.json` in a project, or `~/.cursor/mcp.json` for all projects.

## With OAuth

Give Cursor only the URL. Cursor registers itself with anymail and signs in with the authorization code flow and PKCE.

```json
{
  "mcpServers": {
    "anymail": {
      "url": "https://app.anymail.watch/api/mcp"
    }
  }
}
```

Open **Cursor Settings**, then **MCP**. Cursor lists `anymail` and asks you to sign in. Sign in to anymail in the browser, pick the **Workspace** and the **Access**, and select **Allow**.

## With an API token

Keep the token out of the file. Cursor reads environment variables with `${env:NAME}`.

```json
{
  "mcpServers": {
    "anymail": {
      "url": "https://app.anymail.watch/api/mcp",
      "headers": { "Authorization": "Bearer ${env:ANYMAIL_TOKEN}" }
    }
  }
}
```

Set `ANYMAIL_TOKEN` in the environment Cursor starts from. See [Authentication](/authentication/) for how to generate a token.

## Check the connection

**Cursor Settings**, **MCP** shows `anymail` with 44 tools. In the agent chat, ask: "List my anymail mailboxes and tell me which domains have a DNS problem."

## Related

- [MCP server](/mcp-server/)
- [Connect Claude Code](/mcp-claude-code/)
- [Domains](/domains/)
