# Connect your client

Every client needs the same two things: the server URL and an API key sent as a bearer token. Pick yours.

- [Claude Code](/developers/mcp/claude-code.md): One terminal command
- [Claude Desktop and claude.ai](/developers/mcp/claude-desktop.md): Config file
- [Cursor](/developers/mcp/cursor.md): `.cursor/mcp.json`
- [Agent frameworks](/developers/mcp/agent-frameworks.md): Any MCP client over HTTP

## 1. Create a read-only key

In the admin, open **Organisation › API Keys** and create a key with the `read` scope. Add `asset_view` if the agent should fetch reports. Give the agent its own key, so you can revoke it without touching other integrations.

## 2. Add the server

| | |
|---|---|
| **URL** | `https://api.audiobly.com/mcp` |
| **Transport** | Streamable HTTP |
| **Header** | `Authorization: Bearer sk_live_…` |

## 3. Check it works

Ask your client: *"List my Audiobly events from this year."* It should call `list_events` and answer with your events. If it says the server failed to connect, the key is missing, revoked or lacks `read`.

> **Warning:** Config files with a key in them are secrets. Keep them out of shared repositories, or read the key from an environment variable.

```bash tab=Terminal title=Claude_Code
claude mcp add --transport http audiobly \
  https://api.audiobly.com/mcp \
  --header "Authorization: Bearer sk_live_…"
```

```json tab=mcp.json group=config title=Any_client_that_reads_a_JSON_config
{
  "mcpServers": {
    "audiobly": {
      "type": "http",
      "url": "https://api.audiobly.com/mcp",
      "headers": {
        "Authorization": "Bearer sk_live_…"
      }
    }
  }
}
```

```json tab=Cursor group=config
{
  "mcpServers": {
    "audiobly": {
      "url": "https://api.audiobly.com/mcp",
      "headers": {
        "Authorization": "Bearer sk_live_…"
      }
    }
  }
}
```

```bash tab=cURL title=Test_without_a_client
curl -X POST https://api.audiobly.com/mcp \
  -H "Authorization: Bearer $AUDIOBLY_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",
       "params":{"protocolVersion":"2025-06-18",
       "capabilities":{},"clientInfo":{"name":"test","version":"1"}}}'
```
