# MCP server

`POST /mcp` mounts a Streamable HTTP MCP transport (stateless). Reachable through the same three
access paths as `GET /take` (x402 / API key / keyless).

## Tools

- **screenshot** — capture a URL as an image. Params: `url`, `format` (png/jpeg/webp), plus the
  common render params (viewport, delay, wait_until, block_ads, block_cookie_banners, dark_mode,
  full_page).
- **pdf** — capture a URL as a PDF. Same common render params; `format` is fixed to `pdf`.
- **capture_element** — capture a URL after waiting for a CSS `selector` to appear. Same params as
  `screenshot` plus a required `selector`.

All three tools declare `ToolAnnotations: { readOnlyHint: true, destructiveHint: false,
idempotentHint: true, openWorldHint: true }` and return image + extracted text/metadata content
blocks in one call.

Tool-level failures (bad params, navigation failure, timeout) come back as MCP
`isError: true` results with a self-correcting message — never as an HTTP error status, per MCP
convention.

Every request must send `Accept: application/json, text/event-stream` — `application/json` alone
is rejected with 406.
