The Trawl MCP server lets an AI client (Claude, Cursor, or your own code) list, run, create and debug your scraps as tools. Connect the client once; it then finds the tools by itself.
Endpoint
One address, POST only:
Send JSON-RPC 2.0 with three headers:
Authorization: Bearer <YOUR_API_KEY>Content-Type: application/jsonAccept: application/json, text/event-stream: required, even though the answer is plain JSON.
Each call stands alone: no session to open, no stream to keep.
POST https://api.trawl.me/api/mcpCredentials
All three work on every plan and go in the same Authorization: Bearer header.
| Sign in from Claude | API key | Session token | |
|---|---|---|---|
| Get it | add Trawl as a connector: see Add Trawl to Claude | Developers → API Keys in the web app | trawl login, then trawl token (CLI) |
| Lasts | 1 hour, renewed by Claude (30 days without use ends it) | up to 2 years (1 year by default) | 7 days |
| Can do | the access you approved, in the organization you picked | the scopes of the key, and only its scraps if it has a list | everything your account can do |
The API key is the right choice for a client that runs unattended. trawl_whoami tells which one a call used.
Connect Claude Desktop or Cursor
On Claude (web, Desktop, mobile, Code), the simplest way is to sign in with your Trawl account, with no key to copy: see Add Trawl to Claude. For any other setup, put a key in the client's config.
Claude Desktop, in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Cursor, in Settings → Model Context Protocol:
Restart the client: the trawl tools appear in its tool list. A session token goes in the same place, but you must replace it every 7 days.
{
"mcpServers": {
"trawl": {
"transport": {
"type": "http",
"url": "https://api.trawl.me/api/mcp",
"headers": { "Authorization": "Bearer <YOUR_API_KEY>" }
}
}
}
}{
"mcpServers": {
"trawl": {
"url": "https://api.trawl.me/api/mcp",
"headers": { "Authorization": "Bearer <YOUR_API_KEY>" }
}
}
}The tools
| Tool | What it does | Scope |
|---|---|---|
trawl_whoami |
Who you are, your organization, the key's scrap list | none |
trawl_health_ping |
Checks that the server answers | none |
trawl_list_scraps |
Lists your scraps | trawl:scraps:read |
trawl_get_scrap |
One scrap | trawl:scraps:read |
trawl_trigger_scrap_run |
Runs a scrap and waits for its rows | trawl:scraps:run |
trawl_scrap_latest_result |
The rows of the last run, without running | trawl:history:read |
trawl_create_scrap |
Writes a scrap from a URL and a goal, creates it and runs it | trawl:scraps:create |
trawl_get_scrap_runs |
A scrap's past runs | trawl:history:read |
trawl_get_run |
Why one run failed, and what auto-fix did | trawl:history:read |
trawl_diagnose_scrap |
The same, for a scrap's last run | trawl:history:read |
trawl_get_run_snapshot |
Where to download the page a run saw | trawl:history:read |
A key without the scope gets -32001 (forbidden). A key limited to some scraps gets -32001 for the others; an id that does not exist gets -32004. Every tool that reads takes response_format: "markdown" for a text answer instead of JSON.
Check your connection
trawl_whoami takes no argument. Call it first, right after you connect.
The answer: the tool's data is in structuredContent, and again as a JSON string in content[0].text.
scrapIdsAllowlist empty means the key reaches every scrap. mode is apiKey, jwt or oauth. The next sections show only structuredContent.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_whoami","arguments":{}}}'{ "jsonrpc": "2.0", "id": 1, "result": {
"content": [{ "type": "text", "text": "{\"userId\":\"6650a1b2c3d4e5f6a7b8c9d1\",…}" }],
"structuredContent": { "userId": "6650a1b2c3d4e5f6a7b8c9d1", "email": "you@example.com", "organizationId": "6650a1b2c3d4e5f6a7b8c9d2",
"organizationName": "Acme", "scrapIdsAllowlist": [], "mode": "apiKey" } } }Check the server
trawl_health_ping takes no argument.
The answer: uptime is in seconds.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_health_ping","arguments":{}}}'{ "ok": true, "version": "3.20.1", "uptime": 86400 }List your scraps
trawl_list_scraps with no argument returns your first 20 scraps.
The answer: status is the last run, true success, false failure, null never run.
Optional:
limit: 1 to 100 scraps per page, default 20.cursor: the next page. Its value isnextCursorfrom the previous answer;nullmeans there is no next page.query: only scraps whose title or script contains this text.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_list_scraps","arguments":{}}}'{ "scraps": [{ "id": "64a1f2e3b5c6d7e8f9a0b1c2", "title": "Hacker News front page", "description": "", "url": "https://news.ycombinator.com",
"status": true, "lastRunAt": "2026-11-23T07:00:12.000Z", "containerId": "64a0f2e3b5c6d7e8f9a0b1c0", "cron": "0 7 * * 1",
"cronTimezone": "UTC", "autoFix": true, "createdAt": "2026-11-20T10:12:00.000Z", "updatedAt": "2026-11-20T10:12:00.000Z" }],
"nextCursor": null }Get one scrap
trawl_get_scrap needs scrapId, the id from trawl_list_scraps.
The answer: the same fields as one item of trawl_list_scraps. Stored logins never leave the server.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_get_scrap","arguments":{"scrapId":"<SCRAP_ID>"}}}'{ "scrap": { "id": "64a1f2e3b5c6d7e8f9a0b1c2", "title": "Hacker News front page", "url": "https://news.ycombinator.com", "status": true, "cron": "0 7 * * 1", "autoFix": true } }Run a scrap
trawl_trigger_scrap_run needs scrapId. It waits for the run to end, often 30 seconds to 4 minutes: set your client's tool timeout above that, since many stop at 30 seconds.
The answer: result holds the rows.
status is completed (rows), blocked (the site blocked the run), empty (no rows) or failed (then error gives the reason). Pass runId to trawl_get_run to see why. When the scrap has no cron, a warning says that nothing checks its health after this run.
Optional:
params: your own values, e.g.{ "TRAWL.city": "Paris" }. The keys are those of the scrap's first stored scenario, spelled the same, all of them. Required when the scrap has stored params; find them in the app or withtrawl get <id> --json.reason: a note for your own records, up to 500 characters.
A run with your own params that comes back empty or crashes is first checked against a stored scenario, before any auto-fix.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_trigger_scrap_run","arguments":{"scrapId":"<SCRAP_ID>"}}}'{ "scrapId": "64a1f2e3b5c6d7e8f9a0b1c2", "runId": "65a0f2e3b5c6d7e8f9a0b1c4", "status": "completed", "statusDetail": "success",
"blocked": false, "length": 2, "result": [{ "title": "Show HN: Trawl", "points": 128 }, { "title": "Ask HN: Scraping", "points": 64 }] }Read the last result
trawl_scrap_latest_result needs scrapId. It reads the last run without starting one.
The answer:
result and runId are null when the scrap never ran. Above 100 KB, the answer is { "truncated": true, "url": "…" }: fetch the rows from url with your key.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_scrap_latest_result","arguments":{"scrapId":"<SCRAP_ID>"}}}'{ "scrapId": "64a1f2e3b5c6d7e8f9a0b1c2", "runId": "65a0f2e3b5c6d7e8f9a0b1c4", "status": true, "statusDetail": "success",
"startedAt": "2026-11-23T07:00:12.000Z", "result": [{ "title": "Show HN: Trawl", "points": 128 }] }Create a scrap
trawl_create_scrap needs url (the page) and goal (what to extract, in plain words, up to 500 characters). Trawl writes the script, tests it on the live page, creates the scrap and runs it once. It uses your AI credits.
The answer:
successis the first run, not the creation: when it isfalsethe scrap exists and auto-fix retries it.verified: truemeans the exact script shipped passed its test on the live page.falsemeans the first run is its first real test: check its rows.iterationsis how many test runs it took.runId(alsohistoryId) goes totrawl_get_run.
It often takes 1 to 7 minutes, and longer on a hard site. The server closes the call after about 22 minutes while the creation goes on: set your client's tool timeout to at least 22 minutes, and if the call is cut, list your scraps before you try again. The CLI trawl create shows each step and waits up to about 80 minutes.
Optional:
autoFix:falseto not let AI fix the first run. Defaulttrue.reason: a note for your own records.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_create_scrap","arguments":{"url":"https://news.ycombinator.com","goal":"Title, link and points of each story"}}}'{ "success": true, "scrap": { "id": "64a1f2e3b5c6d7e8f9a0b1c2", "title": "Hacker News front page", "url": "https://news.ycombinator.com",
"status": true, "cron": "0 7 * * 1", "cronTimezone": "UTC", "autoFix": true },
"historyId": "65a0f2e3b5c6d7e8f9a0b1c4", "runId": "65a0f2e3b5c6d7e8f9a0b1c4", "verified": true, "iterations": 2 }List past runs
trawl_get_scrap_runs needs scrapId. Newest run first.
The answer:
statusDetail is success, error, empty or regression (fewer rows than usual). failureKind sorts a failure: block, auth (a login page), selector, empty, timeout, nav or unknown. proxyTier is a level from tier0 to tier4.
Optional:
from,to: only runs started in that window, ISO 8601 dates (2026-11-01T00:00:00Z).limit: 1 to 100 runs, default 20.cursor: the next page, fromnextCursor.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_get_scrap_runs","arguments":{"scrapId":"<SCRAP_ID>"}}}'{ "scrapId": "64a1f2e3b5c6d7e8f9a0b1c2", "nextCursor": null, "runs": [{ "id": "65a0f2e3b5c6d7e8f9a0b1c4", "scrapId": "64a1f2e3b5c6d7e8f9a0b1c2",
"status": true, "statusDetail": "success", "startedAt": "2026-11-23T07:00:12.000Z", "endedAt": "2026-11-23T07:00:14.384Z", "durationMs": 2384,
"length": 30, "triggeredBy": "cron", "blocked": false, "failureKind": null, "errorMessage": null, "failedSelector": null,
"emptyContext": null, "fixVersionId": null, "proxyTier": "tier1" }] }Find why a run failed
trawl_get_run needs historyId: a run id from trawl_get_scrap_runs, or the runId of trawl_trigger_scrap_run. When you only have the scrap, call trawl_diagnose_scrap with scrapId instead: it reads the last run and answers the same.
The answer: run has the same fields as in trawl_get_scrap_runs; autofix is what auto-fix did, or null when it did not run.
trawl_diagnose_scrap adds scrapId and hasRuns; a scrap that never ran gives { "scrapId": "…", "hasRuns": false, "run": null, "autofix": null }.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_get_run","arguments":{"historyId":"<RUN_ID>"}}}'{ "run": { "id": "65a0f2e3b5c6d7e8f9a0b1c9", "status": false, "statusDetail": "empty", "length": 0, "blocked": false, "failureKind": "selector",
"errorMessage": null, "failedSelector": ".product-card .price", "emptyContext": { "page": { "url": "https://shop.example.com", "totalAnchors": 112 } }, "proxyTier": "tier1" },
"autofix": { "outcome": "applied", "classification": "selector_fix", "reason": null,
"fixDiff": "@@ -3 +3 @@\n-await page.$$eval('.product-card .price', …)\n+await page.$$eval('.product-card [data-price]', …)",
"dryRunResults": [{ "status": "success" }], "versionId": "65f9a0b1c2d3e4f5a6b7c8d9" } }Get the page a run saw
trawl_get_run_snapshot needs historyId. It gives where to download the page, never the page itself.
The answer:
The url needs a session token, not an API key, because the page may show logged-in content: trawl scraps snapshot <id> in the CLI downloads it. When nothing was saved, available is false and reason is no_capture (never saved) or blob_missing (the saved file is gone).
Optional: kind: "error" for the page saved when the run failed, instead of the page at the end of the run.
curl https://api.trawl.me/api/mcp \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"trawl_get_run_snapshot","arguments":{"historyId":"<RUN_ID>"}}}'{ "historyId": "65a0f2e3b5c6d7e8f9a0b1c9", "kind": "success", "available": true, "bytes": 48213, "url": "https://api.trawl.me/api/runs/65a0f2e3b5c6d7e8f9a0b1c9/html-snapshot" }Errors and limits
A call the server refuses before any tool runs (a bad request, a wrong host) answers in JSON-RPC form, for example:
An error raised while a tool runs (scope, not found, no credit) comes back instead as a normal result with isError: true, the error object as its text.
| Code | Meaning |
|---|---|
-32602 |
Wrong arguments |
-32000 |
Not signed in, or the key is not valid |
-32001 |
Forbidden: missing scope, or a scrap the key cannot reach |
-32002 |
Payment needed: no credit left or a late payment; the reason is in data |
-32003 |
Unavailable for now |
-32004 |
Not found |
-32005 |
Too many calls |
-32006 |
Method not allowed (GET, DELETE) |
-32603 |
Server error |
Limits: 60 calls a minute per IP address, then 120 calls a minute per user or key. Answers above 100 KB are replaced by { "truncated": true, "url": "…" }.
See also: API Keys · Scrap Payload · Webhooks
Next step → Using Trawl with Claude
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "Invalid params" } }