Use FastAF from the Cloudflare Agents SDK
Agents built on Cloudflare’s Agents SDK can connect to remote MCP servers. FastAF exposes one at https://api.fastaf.co/mcp (Streamable HTTP).
1. Connect the MCP server
Inside your Agent class, add FastAF as a remote MCP server and pass your FastAF API key as a bearer header (stored as a Worker secret, here FASTAF_API_KEY):
await this.addMcpServer("fastaf", "https://api.fastaf.co/mcp", {
transport: {
headers: { Authorization: `Bearer ${this.env.FASTAF_API_KEY}` },
},
});
addMcpServer(serverName, url, options) with options.transport.headers is the signature in Cloudflare’s MCP client API reference and in the type definitions of the agents npm package (0.31.0), both checked on 28 Oct 2026.
The tool list is public. Tools include google_search (title, URL, snippet, position; query, optional country, language) and scrape_url (one public URL as markdown, max_chars 1,000–30,000, default 12,000). Every tool is annotated readOnlyHint: true. Calling a tool needs the API key: without it /mcp answers HTTP 401. x402 is not accepted on /mcp; to pay per call without an account, use the REST routes below.
2. Or call the REST routes with x402
If your Worker already has an x402 client, call the routes directly. An unpaid request returns HTTP 402 with the price, asset (USDC) and network (Base, eip155:8453). Payment is settled only if the request succeeds.
const r = await fetch("https://api.fastaf.co/x402/v1/serp?query=" + encodeURIComponent(q));
if (r.status === 402) {
// hand r to your x402 v2 client: it signs the PAYMENT-REQUIRED header and retries with PAYMENT-SIGNATURE
}
Prices start at $0.003 per call (serp, search, amazon, reddit). Full list in https://api.fastaf.co/openapi.json.
3. Without a wallet
Create a free account at https://fastaf.co/signup/: 500 free credits every month after email verification, then optional prepaid credits.
Related: Add FastAF to Claude Code, Codex and Cursor · x402 discovery checklist
Reference
- MCP server documentation: every parameter and response field
- Docs: authentication, errors, MCP and x402
- Pricing: credit packs from $10, without expiry
Other sources
- How to read public Amazon data when your requests fail
- How to read public Google Search data when your requests fail
- How to read public Walmart data when your requests fail
- How to read LinkedIn data with an API
- How to read public eBay data when your requests fail
- How to read public Booking.com data when your requests fail
- How to read X profile data with an API
- How to read public Zillow data when your requests fail
- Pay-per-call web scraping for AI agents with x402
- MCP servers for Amazon, SERP and web scraping
- Cost per agent: monthly SaaS vs x402 pay-per-call
- How FastAF handles heavy pages and timeouts
- x402 endpoint discovery checklist: how agents find a paid API (and how FastAF passes it)
- Add FastAF to Claude Code, Codex and Cursor
- How to detect poisoned or incomplete SERP results in AI agents
- Cap agent spend per call with fixed x402 prices
- FastAF as a fallback search provider
- Budget a scraping job before you run it
- Try FastAF for free, no card
- Too many MCP tools? Keep agent context small
- How agents find an API (and where FastAF is)
- Why agent retries cost more than you think
- All how-to guides