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

# Cursor

> Connect Cursor to PostQueen over MCP

Cursor speaks MCP over streamable HTTP, so her server plugs in with a single URL. Once connected, Cursor's agent can list your channels, generate media and schedule posts without leaving the editor. Analytics is not among the tools, so that stays with the CLI or the API.

<Info>
  You need your PostQueen API key first. In the app at [app.postqueen.ai](https://app.postqueen.ai), open **Settings > Developers > Public API** and click **Reveal**.
</Info>

## Option A: Cursor UI

<Steps>
  <Step title="Open the Customize page">
    Open the **Customize** page from the Cursor sidebar, which is where you install and remove MCP servers.
  </Step>

  <Step title="Add the PostQueen server">
    Add an entry named `postqueen` with the streamable HTTP URL. Cursor opens an `mcp.json` file for you to edit:

    ```json theme={"system"}
    {
      "mcpServers": {
        "postqueen": {
          "url": "https://api.postqueen.ai/mcp/YOUR_API_KEY"
        }
      }
    }
    ```

    Replace `YOUR_API_KEY` with the key you revealed in the PostQueen app, then save the file.
  </Step>

  <Step title="Enable the server">
    Back on the **Customize** page, make sure the `postqueen` server is enabled. Cursor connects and lists the server's 11 tools.
  </Step>
</Steps>

## Option B: Config File

You can skip the UI and create the config file directly. Cursor reads MCP servers from two locations:

* `.cursor/mcp.json` in your project root, which applies to that project only
* `~/.cursor/mcp.json` in your home directory, which applies to every project

A project-level file lets you scope the server to one repo.

<Tabs>
  <Tab title="API Key in URL">
    ```json theme={"system"}
    {
      "mcpServers": {
        "postqueen": {
          "url": "https://api.postqueen.ai/mcp/YOUR_API_KEY"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Bearer Token">
    ```json theme={"system"}
    {
      "mcpServers": {
        "postqueen": {
          "url": "https://api.postqueen.ai/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

Both forms authenticate with the same API key; pick whichever fits your setup. See Cursor's own [MCP documentation](https://cursor.com/docs/mcp) for the full `mcp.json` reference.

<Warning>
  Your API key is a secret. If you put it in a project-level `.cursor/mcp.json`, keep that file out of version control by adding it to `.gitignore`, since anyone with the key can post to your connected accounts. For personal setups, the global `~/.cursor/mcp.json` is the safer default. If the key leaks, regenerate it in **Settings > Developers > Public API** and update every client that uses it.
</Warning>

## Self-Hosted

On a self-hosted instance, replace `https://api.postqueen.ai` with your `NEXT_PUBLIC_BACKEND_URL`:

```json theme={"system"}
{
  "mcpServers": {
    "postqueen": {
      "url": "https://postqueen.example.com/api/mcp/YOUR_API_KEY"
    }
  }
}
```

Most self-hosted setups serve the backend under `/api`, so the MCP path sits at `/api/mcp`. Use whatever `NEXT_PUBLIC_BACKEND_URL` is set to, then append `/mcp/YOUR_API_KEY`.

Your reverse proxy has to forward the `/mcp` paths and stream the response rather than buffering it. The configuration, and the Nginx setting that silently breaks this, are on [MCP on a self-hosted install](/mcp/self-hosting).

## Verify

Open Cursor's chat in agent mode and ask:

> "List my connected social media accounts"

Your channel names come back, because the agent reached for her `integrationList` tool. If it fails, check that the `postqueen` server is enabled on the Customize page, that the API key was pasted in full, and that no firewall blocks `api.postqueen.ai`.

<Tip>
  Cursor asks for approval before running MCP tools by default. Keep that on for `integrationSchedulePostTool` so you see each post before she puts it on the calendar.
</Tip>
