# Quickstart: connect your agent to Trawl

Add one MCP URL to your client, sign in and pick a credit pack in the browser, then make a free check call. Or paste one line and let your agent do it.

## The one-line way

Paste this into Claude Code, Codex CLI, Cursor or any agent that can run commands and open links:

```
Fetch https://trawlmcp.com/setup.md and follow it to set me up with Trawl.
```

The agent reads [setup.md](/setup.md). It installs the Trawl skills and server where it can and gives you a sign-in link. You sign up and click Allow in your browser; some clients also need a reload or a click in their settings. Free: 1,000 credits a month. No card. Then it adds one line to its instruction file, checks the setup with the free account call and runs a first read on a public topic of yours. The agent never sees your card or a key.

## Add the server yourself

The MCP endpoint is `https://mcp.trawlmcp.com` (Streamable HTTP). Clients sign in with OAuth: the first call opens your browser, where you sign in, buy credits if your balance is zero and allow the connection. The [setup page](/setup) has the steps and the line to copy for each client:

- [Claude Code](/setup#claude-code) · [Claude app](/setup#claude-app) · [Cursor](/setup#cursor) · [ChatGPT](/setup#chatgpt) · [Codex CLI](/setup#codex) · [VS Code](/setup#vscode) · [Windsurf](/setup#windsurf) · [Gemini CLI](/setup#gemini-cli)
- In code: [Claude Agent SDK](/setup#claude-agent-sdk) · [OpenAI Agents SDK](/setup#openai-agents-sdk) · [Vercel AI SDK](/setup#vercel-ai-sdk) · [LangChain](/setup#langchain) · [REST](/setup#rest)

A server added inside a running session may need a reconnect before its tools appear (Claude Code: `/mcp` → Reconnect; Codex: start a new session).

## Check that it works

Ask your agent to call `account`. It is free and answers with available credits, credits held by running calls, today’s spend against the daily cap and every price. Then try one cheap read:

```
read_profile {"urls":["x:@nasa"]}
```

Over MCP every answer starts with one line: what came back, what it cost, how many credits are left, and whether it came fresh or from the cache; over REST the same facts are in `meta`. If a read is still running after 40 s, the answer says `running`; call again with the same arguments after 20 s and you pay once.

## API keys and REST

For agents without MCP, or clients that cannot finish an OAuth sign-in, create an API key on your account page (it is shown once) and keep it in your environment, never in a chat:

.env and a first request

```
TRAWL_API_KEY=trawl_live_…
curl -s -H "Authorization: Bearer $TRAWL_API_KEY" https://mcp.trawlmcp.com/v1/account
```

`account` is `GET https://mcp.trawlmcp.com/v1/account` and free. Read tools are `POST https://mcp.trawlmcp.com/v1/<tool>` with the tool’s JSON input as the body (`Content-Type: application/json`); a `GET` on them is not a route. The OpenAPI description is at `https://mcp.trawlmcp.com/openapi.json`, the inputs are on the [tool reference](/docs/tools).

**MCP** (tool results in an MCP client): a finished answer is a header line, a newline, then the minified JSON of `data`; a read still running is the header line alone (`running · call again …`); an error is a tool result with `isError: true`, the header line `error · <code> · not charged` and `{"error": {…}}`. **REST** (`https://mcp.trawlmcp.com/v1/<tool>`): a finished answer is HTTP 200 with `{"meta": {…}, "data": {…}}`; a read still running is HTTP 202 with `"data": null`; an error is `{"error": {…}}` with an HTTP status: the one the errors table lists for its code, except that a request body that is too large answers `invalid_input` with 413, and one not sent as `application/json` with 415. `data` is the same on both surfaces; the header line and `meta` describe the call in different shapes.

REST: `POST /v1/read_profile` with `{"urls":["x:@nasa"]}`, HTTP 200, captured from the API on 2026-12-03 (one line on the wire, indented here)

```json
{
  "meta": {
    "tool": "read_profile",
    "status": "ok",
    "platform": "x",
    "items": 1,
    "credits": 1,
    "balance": 2463,
    "cache": "cached",
    "ms": 136,
    "request_id": "req_05efc5b71ba9423cbede"
  },
  "data": {
    "items": [
      {
        "url": "https://x.com/NASA",
        "kind": "account",
        "name": "NASA",
        "handle": "NASA",
        "bio": "Making the seemingly impossible, possible. ✨",
        "followers": 92013556,
        "following": 115,
        "posts": 74606,
        "verified": true,
        "location": "Pale Blue Dot",
        "website": "http://www.nasa.gov/",
        "extra": {
          "verified_type": "Government"
        }
      }
    ]
  }
}
```

MCP: the same answer as the agent receives it

```
1 profile · x · 1 credit · 2,463 left · cached
{"items":[{"url":"https://x.com/NASA","kind":"account","name":"NASA","handle":"NASA","bio":"Making the seemingly impossible, possible. ✨","followers":92013556,"following":115,"posts":74606,"verified":true,"location":"Pale Blue Dot","website":"http://www.nasa.gov/","extra":{"verified_type":"Government"}}]}
```

The same keys work in MCP clients as a bearer header; the [setup page](/setup) shows where each client takes one.

## Limits worth knowing

- Up to 25 items per list or search call (default 10), up to 25 URLs per `read_profile` or `read_post` call, up to 50 comments per post.
- Every key and every connected client has a daily cap, 3,000 credits by default; change it on your account page.
- 2 reads per account run at the same time; more wait for a free slot, then answer `rate_limited` with a retry time.
- A repeat read inside the cache window costs 1 credit. Errors cost nothing.
- The `balance` in an answer is a snapshot taken while that call was handled. For what can be spent now, call `account`: its `balance` already subtracts the credits held by calls that are still running.

---
Updated 2026-12-03. HTML version: https://trawlmcp.com/docs/quickstart
