web content extraction for autonomous agents

Any URL in. Clean, structured content out.

CleanPage is an MCP tool that strips a page down to what an agent actually needs — readable markdown, metadata, links, and structured facts — with a quality score attached, so your agent never has to guess whether the output is any good.

$0.02 USDC per call x402 on Base no signup, no API key
clean_page — live preview
Output will appear here. This preview truncates to 700 characters — the real clean_page tool returns full markdown, metadata, links, images, and structured facts.

Free preview, rate-limited. The MCP tool below returns the untruncated result.

output shape

One call, everything an agent needs to reason about a page

No HTML to parse, no boilerplate to strip, no guessing whether the page loaded correctly. Every response is the same predictable JSON shape.

clean_markdown / plain_text

Article body only — nav, ads, cookie banners, and related-article rails are already gone. Markdown preserves headings, lists, links, and tables; plain_text is the flat version.

metadata

Author, published date, site name, language, word count, and estimated reading time, pulled from the page's own byline and meta tags where available.

structured_facts

Optional array of standalone claims, entities, statistics, quotes, and dates, each with a confidence score — useful for downstream retrieval or fact-checking.

links & images

Internal and external links with their anchor text, plus resolved absolute image URLs, deduplicated and capped to a sane count.

quality_score

A 0–100 heuristic score based on content length, structure, and metadata completeness — so an agent can decide whether to trust or discard a result programmatically.

extraction_notes

Plain-language notes about anything unusual (short content, truncation, skipped enrichment) instead of failing silently or hallucinating a clean result.

pricing

Pay per call. Nothing else.

No subscription, no minimum spend, no dashboard to sign into. Failed extractions — paywalls, bot-blocks, empty pages — are never charged.

$0.02USDC / call

clean_page — the only paid tool. Everything else on this server is free.

  • Charged only on successful extraction
  • Settled on Base via x402, USDC
  • No account, API key, or wallet whitelisting
  • health, list_capabilities, pricing are free, always
Read the API reference

Call clean_page with no payment

You get back HTTP 402 with an accepts array describing exactly what payment is required — amount, network, asset, and payee address.

Sign a USDC authorization

Construct an EIP-3009 transferWithAuthorization payload for the exact amount requested — most x402 client libraries do this automatically from a wallet key.

Retry with X-PAYMENT

Same request, same tool call, with the base64-encoded payment payload attached as a header. The server verifies it against the facilitator before doing any work.

Get your result, plus a receipt

On success, the response carries an X-PAYMENT-RESPONSE header with the settlement transaction hash. If extraction fails, settlement never happens — you keep your USDC.

for agents

Connect in one config block

CleanPage speaks MCP over Streamable HTTP. Point any MCP-compatible agent framework at the endpoint below.

// mcp client config { "mcpServers": { "cleanpage": { "url": "https://cleanpage-mcp.cleanpage-mcp.workers.dev/mcp", "transport": "streamable-http" } } }

Discovery, without a human in the loop

Every capability and price is machine-readable before you spend anything. Call list_capabilities or pricing over MCP, or fetch the static files below directly.

Example tool call

A minimal tools/call request. The first attempt with no payment returns HTTP 402; retry with the resulting X-PAYMENT header to receive the actual result.

POST /mcp { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "clean_page", "arguments": { "url": "https://example.com/article", "options": { "extract_facts": true } } } }

error handling

Typed errors instead of silent junk

If a page can't be cleanly extracted, you get a clear reason and whether it's worth retrying — never a charge for a failed call.

error_codemeaningretryable
INVALID_URLURL is malformed, non-http(s), or resolves to a blocked internal address.no
FETCH_FAILEDThe site returned a non-2xx status, non-HTML content, or was too large.sometimes
TIMEOUTThe page didn't respond within the configured timeout.yes
PAYWALL_DETECTEDThe page is behind a subscription/metered paywall; full content isn't accessible.no
BLOCKED_BY_SITEBot-check, CAPTCHA, or a JS-only shell with no server-rendered content.no
EMPTY_CONTENTNo substantial article content was found (listing page, homepage, etc).no
EXTRACTION_FAILEDThe extraction engine hit an unexpected parsing error.no