# Cursor

Source: https://openpanel.sh/docs/ai/cursor

Add OpenPanel's MCP server to Cursor.

## Add the MCP server [#add-the-mcp-server]

Create `.cursor/mcp.json` in your project (for this project only) or `~/.cursor/mcp.json` in your home folder (for every project):

```json
{
  "mcpServers": {
    "openpanel": {
      "url": "https://openpanel.sh/api/mcp"
    }
  }
}
```

Cursor shows **openpanel** under its MCP settings with a **Needs login** button. Choose it: your browser opens OpenPanel; sign in if you are not, check the tool's name, and choose **Allow**.

### With an API key instead [#with-an-api-key-instead]

Make an [API key](/docs/api/authentication#api-keys) with the scope the agent needs (signed in with the CLI: `openpanel keys create --name "Cursor" --scope deploy`), put it in an environment variable, and send it as a header:

```json
{
  "mcpServers": {
    "openpanel": {
      "url": "https://openpanel.sh/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:OPENPANEL_TOKEN}"
      }
    }
  }
}
```

Never write the key itself into `mcp.json`: the file is often committed.

### Another organization [#another-organization]

Add `?org=<slug>` to the address to work in another organization you belong to: `"url": "https://openpanel.sh/api/mcp?org=acme"`.

## Check it [#check-it]

In Cursor's MCP settings, **openpanel** shows its tools. Ask the agent "Which OpenPanel projects do I have?": it calls `projects_list`.