# Connect a client

> Set up Claude Code, Claude Desktop, Cursor and other MCP clients.

You need the endpoint and a token from [Authentication](/docs/mcp/authentication).

```text
https://api.quillhive.com/api/mcp
```

## Claude Code

```bash
claude mcp add --transport http quillhive https://api.quillhive.com/api/mcp \
  --header "Authorization: Bearer blgg_pat_..."
```

Add `--scope user` to use it in every project. Run `/mcp` inside Claude Code to check it's connected.

## Cursor and other remote MCP clients

Clients that support remote (HTTP) servers take a URL and headers. In Cursor, add this to `.cursor/mcp.json` or **Settings → MCP**:

```json title="mcp.json"
{
  "mcpServers": {
    "quillhive": {
      "url": "https://api.quillhive.com/api/mcp",
      "headers": { "Authorization": "Bearer blgg_pat_..." }
    }
  }
}
```

## Clients that only speak stdio

Bridge with the [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) npm package. This works for Claude Desktop and any client that starts servers as local commands:

```json title="claude_desktop_config.json"
{
  "mcpServers": {
    "quillhive": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.quillhive.com/api/mcp",
        "--header",
        "Authorization: Bearer ${QUILLHIVE_API_KEY}"
      ],
      "env": { "QUILLHIVE_API_KEY": "blgg_pat_..." }
    }
  }
}
```

## Check it works

Ask your assistant:

- *"Which Quillhive sites can you see?"* It calls `list_sites`.
- *"Show me my latest drafts."* It calls `list_posts` with `status: "draft"`.

If you see an authentication error, check that the header is `Authorization: Bearer <token>` and that the token hasn't been revoked.

> [!TIP]
> Keep tokens out of files you commit. Most clients can read the token from an environment variable, as in the `mcp-remote` example.
