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

# Connecting

> Step-by-step setup to connect Claude Code, Claude Desktop, Cursor, ChatGPT, and other MCP clients to the Crevio MCP server, verify the connection with whoami, and start delegating work.

The Crevio MCP server uses **Streamable HTTP** transport — a single endpoint that accepts JSON-RPC requests and returns JSON-RPC responses. It is stateless: every request is self-contained, so there is no session to keep alive and any MCP-compatible client that supports Streamable HTTP can connect.

## Base URL

```
https://mcp.crevio.co/mcp
```

A public server card for discovery lives at `https://mcp.crevio.co/mcp/server-card`, listed in the AI catalog at `https://crevio.co/.well-known/ai-catalog.json`.

## Authentication

Every request carries a **Bearer token** in the `Authorization` header — the same API tokens from your [Developer settings](/docs/developer/guides/api-overview#creating-api-tokens).

```bash theme={null}
curl -X POST https://mcp.crevio.co/mcp \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

The server is also an OAuth 2.1 protected resource: an unauthenticated request gets a `401` with a `WWW-Authenticate` header pointing at `/.well-known/oauth-protected-resource`, so clients that support MCP's OAuth flow (Claude's connector directory, ChatGPT) can sign in interactively instead of pasting a token.

<Warning>
  An MCP connection has the full permissions of the token (or OAuth grant) behind it — everything the account can do. Only connect AI tools and agents you trust, and revoke the token to cut a connection off instantly.
</Warning>

## Claude Code

```bash theme={null}
claude mcp add --transport http crevio https://mcp.crevio.co/mcp \
  --header "Authorization: Bearer $CREVIO_API_TOKEN"
```

Then, in a session: *"Call whoami on crevio"* — or just *"Ask Crevio which products sold best this week."*

## Claude Desktop

Add this to `claude_desktop_config.json` and restart Claude Desktop:

```json theme={null}
{
  "mcpServers": {
    "crevio": {
      "url": "https://mcp.crevio.co/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}
```

You can then delegate in plain English:

> "Ask Crevio to create a 20% discount code called SUMMER20 that expires next month"
>
> "Have Crevio draft and schedule three posts about my new course, then tell me what it scheduled"
>
> "Who are my top 5 customers by order count?" *(the agent may answer this directly with `api_execute`)*

## Cursor

Add to `~/.cursor/mcp.json` (or **Settings → MCP Servers → Add**, type *Streamable HTTP*):

```json theme={null}
{
  "mcpServers": {
    "crevio": {
      "url": "https://mcp.crevio.co/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN"
      }
    }
  }
}
```

## Other clients

Most MCP clients accept the same JSON shape: a `url` plus an `Authorization` header. For clients that drive OAuth themselves, point them at `https://mcp.crevio.co/mcp` and let the `401` challenge start the sign-in.

## Verify the connection

Call `whoami`. It takes no arguments, has no side effects, and returns the account and user behind the credential, the plan and credit balance, rate limits, wait limits, and the full tool list.

```bash theme={null}
curl -X POST https://mcp.crevio.co/mcp \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"whoami","arguments":{}}}'
```

If `whoami` comes back, the connection is good. If it doesn't:

* **401** — the token is missing, mistyped, expired, or revoked. Mint a new one in **Settings → Developers**.
* **Tools missing in the client** — most clients cache `tools/list`; reconnect or restart the client.
* **429** — the token is over its 600-requests-per-minute budget (shared with the REST API); back off until `X-RateLimit-Reset`.

## First delegation

```bash theme={null}
curl -X POST https://mcp.crevio.co/mcp \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0", "id": 2, "method": "tools/call",
    "params": {
      "name": "ask_crevio",
      "arguments": { "message": "Summarize this week'"'"'s orders and flag anything unusual.", "timeout_seconds": 60 }
    }
  }'
```

The result is a **run** with the agent's reply in `result`. If it comes back as `wait_timed_out`, the job is still going — call `wait_for_run` with the run's `id`.

<Note>
  See the [Overview](/docs/developer/mcp) for the full tool reference — delegation (`ask_crevio`, `start_chat`, `wait_for_run`, `send_message`, …) and direct API access (`api_search`, `api_execute`).
</Note>
