Skip to content

Designing a scraping MCP server: control in, data out

A scraping agent that fills its context with pages rarely crashes. It keeps paying for the same rows on every turn, gets slower, and reasons worse as the window tightens. The design question behind a good scraping MCP server is therefore not "how do I fetch a page from an agent?" but "what should cross the boundary between the fetch layer and the model?"

This guide works through that question in the order the costs appear: the fixed bill for tool definitions, the partial relief tool search offers, the much larger bill for results, the one-line handler mistake that serializes throughput, and the isolation limits of letting a model run code next to your data. Every figure below is a dated measurement from July 2026 on a fixed practice catalogue, so treat the ratios as the lesson and re-measure before you budget.

The bill arrives before the first fetch

MCP clients call tools/list at startup and place every tool's name, description and input schema into the prompt. That block sits in context on every turn, whether or not the tool is ever called. It is a fixed cost you choose at design time.

A census across seven published scraping and browser servers showed how weakly tool count predicts that cost. A 10-tool server consumed more definition tokens than a 29-tool server, because per-tool cost tracks how much distinct surface each tool describes — parameter count, nesting depth, enum members, description length. One definition measured 1,928 tokens: 1,200 of description, 600 of schema, the remainder JSON escaping, with 45 properties nested three levels deep. A lean equivalent of the same capability came to 183 tokens.

Descriptions can also contradict themselves. In that 1,200-token block, one paragraph demanded JSON output for specific data points while a later paragraph preferred markdown by default, leaving the model to arbitrate on every call. Prompt caching softens the bill — repeated identical tool arrays were served almost entirely from cache on the second and third request — but editing a single description mid-session resets the cached prefix.

Budget the tool surface like a hot path: every property, enum member and sentence is rent, and caching lowers the rate without making it free.

What deferring definitions buys, and where it stops

Deferring tool definitions is the client-side answer to the fixed bill. Marking a tool as deferred keeps it out of context until a search surfaces it, at which point the matching definitions are expanded into the prompt — five by default. The search index covers tool names, descriptions, argument names and argument descriptions.

On a 112-tool scraping corpus, deferral cut measured total request input by 43% on average across eight tasks, in a range of 41–44%. That is roughly half the "over 85%" saving the vendor documentation quotes, and the gap is explained by denominators: the documentation measures against definition tokens alone, while these figures are total request input including system prompt and task. The implementations and model families also differ, so the two numbers are not directly comparable.

The vendor guidance on when to skip deferral is worth keeping: fewer than ten tools, every tool used on every request, or definitions totalling under 100 tokens. Search-discovered definitions are appended after the cached prefix rather than spliced into it, so deferral does not forfeit the caching discount.

Retrieval is where scraping-specific trouble shows up. Distinctive capabilities were retrieved reliably — the intended tool appeared in the BM25 top five for 100% of tasks where exactly one tool could do the job. The failure case is the most ordinary query in scraping. For "scrape a product page and return its content", the top five spanned two vendors and did not include the obvious page-fetch tool at all. Of the 112 tools, 31 mention scraping or page content in their searchable text, so a search returns a shortlist of near-identical tools with different credit costs and rendering behaviour behind them, not a decision. A regex variant of the search failed by matching too broadly: one pattern hit 35 of 112 tools and returned only the first five.

The model compensates more than the ranking suggests. Where the intended tool was in the shortlist but not at rank one, the model still called it 60% of the time, and selection was stable across repeated runs. What reliably redirects a call is a description that names another tool outright — 20 of the 112 descriptions do exactly that. Rewriting a description for length or persuasion changed nothing across 24 runs; changing what the shortlist contains did. So the stage you can most reliably influence is retrieval: prefix tools by service rather than a generic verb, and make the description say the one thing that separates yours from the thirty tools that also "scrape a page".

The page, not the request, is the payload problem

Tool definitions are fixed. Results are variable, and for scraping they dominate. A tool that returns raw HTML hands the model a document that is mostly markup, and every token of it is billed on every turn that rereads it.

Four real pages measured in July 2026 ranged from 11,834 tokens for a news front page to 141,871 tokens for a single repository page. A current window holds the largest, but not comfortably: quality degrades even over the portion that fits, as buried material competes for attention. Running out of room is the crude failure; degraded reasoning over a page that technically fits is the quiet one.

The cheapest page is the one you never fetch. Before scraping a source, check whether it already exposes a first-party API, a structured feed, or its own MCP server. That data arrives structured, so you skip both extraction and the consent question. Scraping remains the fallback for the large share of sources that offer nothing.

When you do fetch, reduce at the fetch layer. On a fixed practice catalogue page, six request shapes returned the same HTTP 200 with very different bills: raw HTML at 9,673 tokens for 1 credit, JS-rendered HTML at 9,681 tokens for 5 credits, markdown at 3,055 tokens, text-only at 1,111 tokens, CSS extract_rules at 623 tokens for 1 credit, and AI extraction at 616 tokens for 6 credits. Extraction and raw HTML cost the same credit and the extraction was more than fifteen times cheaper in context, which makes selector-based extraction the default whenever the fields are known.

Markdown is a popular default and was roughly five times the cost of extracted fields here — and it lost data. The site truncates visible link text, so markdown carried a clipped title while the full value sat in an anchor attribute that the CSS rule h3 a@title read directly. Markdown remains the right call when an agent must read a page nobody wrote a selector for. AI extraction landed on the same payload size as CSS extraction for six times the credits; that premium is defensible while a target is still moving and hard to justify once it is stable.

Hosted server or your own: what the defaults decide for you

A hosted scraping MCP server trades setup time for control. Pointing a client at one takes a line of configuration, and in the version measured it worked across a wider set of pages without the agent reasoning about rendering — because it rendered JavaScript on every fetch. That default is defensible: deciding per URL whether a browser is needed is precisely what the agent called the tool to find out. You pay for it on the bill, at five credits and 9,681 tokens against one credit and 9,673 tokens for the unrendered direct call.

The direct API offers a third answer. An auto mode walks configurations from cheapest upward and, per its documentation, bills only the configuration that worked. On the static catalogue page it settled at one credit. On a page whose rows arrive by JavaScript it returned HTTP 200 and stopped at one credit with a 2,671-byte shell containing none of the ten quotes; the explicit JS call cost five credits and returned all ten. The credit was correct by the documented rule — a 200 counted as a working configuration — but the content was not there. Assert on the rows you expected, not the status code, and set rendering explicitly when you already know.

Two smaller defaults matter before driving a hosted server hard. A page-text tool defaulted to markdown output at 3,055 tokens where an explicit text flag returned 1,111 tokens for the same page at the same credit cost. An extraction tool required its rules as a JSON string; passing an object produced a validation error, while a string returned correct data.

Choose the hosted path when an agent is exploring unfamiliar targets, the page count is small, and setup time outweighs unit cost. Build your own when targets are known, when the rendering premium becomes real money at volume, or when you need parameters the hosted tools do not expose — a page that needs clicking or scrolling before it is read, for instance. A hosted surface trails the API it wraps.

One line decides your throughput

An async tool handler runs on a shared event loop, and a single blocking call inside it stalls every other request the server is holding. Four handler shapes were benchmarked against a local origin with a fixed 300 ms delay and 30 concurrent calls:

  • async def with a blocking HTTP client, returning full HTML: 9.38 s, 3.2 calls/s, 9,673 tokens per call.
  • Plain def with the same blocking client: 9.40 s, 3.2 calls/s, same tokens.
  • async def with an async client, full HTML: 0.71 s, 42.2 calls/s, same tokens.
  • async def with an async client, extracted fields: 0.72 s, 41.6 calls/s, 717 tokens per call.

The first row is the expected mistake. The second is the one that surprises people. Turning the handler into a plain def is often recommended for blocking code, on the theory that the framework will hand it to a worker thread. In the pinned SDK version measured, that did not happen: the dispatch invoked a sync handler inline on the event loop, so both shapes serialized. A later major release moved that dispatch onto a worker thread, which makes the old advice correct for the new version and wrong for the old one. Check the dispatch in the SDK you actually ship.

Rows three and four separate two independent problems. Async I/O bought a thirteen-fold throughput gain and left the payload exactly where it was. Extraction then cut tokens per call by 93% without moving throughput. Fixing one still leaves you with the other.

Anything CPU-bound in a handler belongs on a worker thread too — a single line of anyio.to_thread.run_sync removes a whole class of stalls. The event loop is a shared resource that every in-flight request draws on, so keep both long waits and long computations off it.

Where the tool loop stops working

Each improvement so far lowers the price or raises the speed of a single call. The structure of the tool loop itself is untouched, and that structure is the next thing to give way.

The obvious answer to a long crawl is one tool that does the whole job and returns a summary. A crawl tool that fetched 40 pages returned four counts, a total and the credits spent in 35 tokens. It looks like the end of the story, and it is — for exactly one question. The aggregation was hard-coded because the question was guessed in advance. Ask which five books are most expensive and the tool has no answer; the only way to get one is to return all 800 rows, at 28,332 tokens.

The alternative keeps the rows out of the context window entirely. A crawl tool writes rows into a store and answers with a handle plus a schema rather than the rows themselves: the schema describes what can be asked, the handle says where the data lives. A second tool executes model-written Python beside those rows and returns only what the code prints.

Priced on the same 800 rows, the difference is two orders of magnitude on every question the summary tool was not built for:

  • Total value of every book: 86 tokens (fixed summary) vs 119 tokens (handle plus code).
  • The five most expensive books: 28,332 vs 248.
  • Median price of five-star books: 28,332 vs 141.
  • Titles containing a colon priced over £50: 28,332 vs 215.
  • Four questions in total: 85,082 vs 868.

The right-hand total is not the sum of its four rows. Reaching the handle costs 145 tokens once, no matter how many questions follow; the per-question rows are the marginal cost of one more question against data already fetched. The summary tool wins the question it was built for, and only barely — 86 against 119. Code stays flat: each query cost 119–248 tokens, ran in 0.02–0.03 seconds against the fetched dataset, and spent no further credits.

Both designs move the rows somewhere. The difference is where they stop: in the second, they halt before the context window, which is why its cost stays flat. The server's job changes accordingly: MCP carries control — what to fetch, what shape came back, what broke, where it landed — while the rows sit in a store the agent reaches through code.

This architecture has a floor. At roughly 35 tokens per row, a few hundred rows still fit in a corner of the window. Below that line, returning rows directly is the right call and the store, sandbox and handle lifecycle are premature. It pays off when the dataset would crowd the context, when the questions are open-ended, or both. And it does not replace fetch-layer extraction: pin the schema where the page is stable, leave the aggregation open.

Running model-written code without handing over the machine

Letting a model run code on your machine invites the obvious objection, and it should. Three problems surfaced while building a sandbox, and the third is the one that matters.

First, a memory-limit call raised a ValueError on macOS, and clamping the soft limit to the inherited hard limit was not enough to fix it. Second, blanking dangerous builtins before running the code removed the call itself — the loop that nulled exec also needed exec to run. Taking the references before removing the names fixes that.

Third, and decisively: blocking names inside the same interpreter is guesswork. Python was never designed to confine itself, and a list of names you remembered to blank is not a security boundary. A four-line escape walked the class graph to a class whose __init__.__globals__ held a live sys reference and reached os.system without calling any blocked name; swapping dot access for getattr reached the same place, since getattr was not on the list either.

What a hardened runner actually blocks: an AST check rejects any dunder attribute access before the code runs, which stops both the dunder path and the getattr variant ahead of the blocklist. A wider blocklist covers the introspection builtins that would otherwise route around it. Underneath sit a zero process limit so nothing can fork, an environment with no API key, and two clocks — a CPU limit that killed a spin loop at 5.01 seconds, and a 30-second wall timeout that covers a child hanging without burning CPU. Both paths return a sentence rather than the empty stderr a signal death leaves behind.

The memory cap is the one that is not there. The address-space limit bounds reserved space, not resident memory, and CPython on macOS reserves far more than a 512 MB cap; the cap swallowed the rejection and a 700 MB allocation succeeded inside the sandbox. Read back the limit you got rather than trusting the constant. The runner is POSIX-only and needs WSL or a container on Windows.

The cage also taxes legitimate queries. Asking for a median, the obvious first move — importing the statistics module — dies on the nulled import, and the model routed around it by hand-rolling the calculation. The hand-rolled median returned £36.03, and the denied import would have returned the same figure, since both interpolate. An earlier £36.39 in this guide is an upper-middle pick, a difference of median convention rather than anything the cage did. Harden the cage and you change how a legitimate query gets computed.

A second run on a different model went further: blocked from importing, it moved the prices to an execution environment it controlled and ran the statistics there. The figures were correct, and the rows travelled into the context window on the way — the one thing the design exists to prevent. A sandbox constrains the code inside it, not an agent's decision to compute somewhere else. If that matters, the boundary you need is on what leaves the store, not on what the sandbox executes; an output cap is the crude version of that.

Shrinking the language instead of hardening the cage

Before hardening a Python sandbox, check whether you can shrink the language. All four benchmark questions were tabular, and SQL answers every one with no exec, no imports and no builtins to blank. A DuckDB connection loads the stored rows, then disables external access and caps memory before the model's query runs.

That lockdown deserves the same scrutiny the blocklist got. On the version tested, flipping the flag back raised an error, and attaching a database, copying, remote reads and reading a new file each raised a permission error, while queries against the loaded table kept working. That is a stronger result than the blocklist managed, though it is five probes rather than a proof.

The SQL versions also cost less context on all four questions — 101–190 tokens against Python's 119–248. One convention difference surfaced: DuckDB's median interpolates the two middle values on an even count and reported 36.03, while the Python version's upper-middle pick said 36.39. Send tabular questions through the smaller language, and reserve the Python tool for what SQL cannot express.

For production, the Python path still needs real isolation at the kernel or hypervisor level. A user-space syscall-intercepting container runtime is the smallest real step up, at some throughput cost on I/O-heavy work; microVMs give each run its own kernel and want a supervisor process, which is a bigger change than a runtime flag. A server that only reads may never need the next step, but one that writes will: if the query tool ever needs authenticated access, an egress proxy that injects the header on the way out beats an environment with no key, because the sandboxed process never holds the credential. Benchmark the boundary you pick against your own syscall mix, and assume it eventually fails.

What the 2026 specification changes for scraping servers

The handle design above carries a flaw that only surfaces once a second instance exists: the handle names a directory on whichever machine ran the crawl, while the 2026-07-28 specification allows any request to land anywhere. Four enhancement proposals in that release get you to a stateless deployment:

  • Protocol-level sessions are removed, along with the session header. Because no request is tied to a particular instance, a scraping server can run behind a round-robin load balancer without sticky routing or a shared session store.
  • The initial handshake is removed. Client info, capabilities and protocol version move into a metadata field on every request, so each POST stands alone.
  • Routing headers become mandatory: a method header on every request and a name header on tool calls, resource reads and prompt gets. A gateway can rate-limit a crawl tool differently from a query tool without parsing a body.
  • List and read results carry cache hints, modelled on HTTP caching. A stable tool set can tell clients to stop re-fetching the tool list on every connection.

The spec authors hit the same wall from the inside and dropped the task-list method entirely, because a task list cannot be scoped safely once there are no sessions to scope it to. Tasks moved out of the core protocol into a separate extension with its own specification repository and uneven client support. They fit the crawl half of the design: a fetch runs for minutes while the client polls until the task turns terminal. That extension is also the migration path off the deprecated API the pinned SDK still exposes — same shape, different import.

None of these is a speed change, which matters before rewriting a transport layer for the wrong reason. The same tuned server timed at 321.1 ms over stdio and 324.0 ms over stateless Streamable HTTP for one call against a 300 ms local origin, and thirty concurrent calls finished in 0.72 seconds on each transport. Pick the transport for how you need to deploy.

SDKs lagged the specification and then caught up. The pinned version reported the older protocol revision, as did the hosted server measured, at no cost to clients since negotiation is backward compatible; a later SDK release reports the 2026 revision. Field names shift across that boundary too — the SDK exposes a poll interval under one name where the extension specifies another — so code spanning both versions wants a single accessor rather than a repository-wide search. Lock the SDK version in every deployment, and keep the long-running part of a crawl behind an interface you can replace.

The control-plane surface, mapped

The reference server exposes two tools and 163 tokens of definitions — under 4% of what the median server in the census charged before doing any work. Neither tool returns a page.

ToolInputOutputNotes
fetch_cataloguefirst, last (integers, 1–50, both required)handle, row count, failed pages, credits spent, schema, one sample rowCrawls through the API with extract_rules, so the page HTML never crosses the wire or gets parsed locally. The handle is deterministic on purpose: a second crawl of the same range replaces the first, and the write lands via a temp file and rename so a concurrent reader never sees a half-written file.
query_datasethandle (string), code (string)whatever the code prints, capped at 4,000 charactersRuns in a fresh interpreter with no API key, no network client and capped CPU. The cap turns a silent regression — a model printing all 800 rows — into a clear error.

The handle is deliberately not a resource link. A link invites the client to read the resource, and reading it pulls the rows into context — precisely what this design is meant to prevent. The handle is a name to query, not an address to fetch.

You can stage the build. The field-returning handler from the throughput section keeps its fetch and its parse; the only change is the return, which writes rows to a store and hands back a handle, row count and schema. That took the response from 717 tokens to 28 against the same page. The sandbox and task wrapper can come later.

Run against a live catalogue, 40 pages holding 389,680 tokens of HTML cost 40 credits to crawl, and the whole session — tool definitions, crawl and three analytical questions — spent 530 tokens of context. Pointed at a category with only two pages and asked for six, the same run reported 32 rows and pages 3–6 as failed, so the agent learns which pages are missing without anyone reading a log. Credits spent counts only successful responses; read the usage endpoint if you need to know what a failed request costs.

What still breaks at scale

The design solves throughput, payload and question coverage. Eight things it does not solve will show up in production. 1. The dataset store must move off local disk before a second instance exists. The blast radius is small — a temp write and rename, and an existence check — but swapping those for object-storage keys or a database row is the version that survives a load balancer, and it is what lets a fleet of agents share one crawl: one subagent fetches, several query, all against the same handle. 2. Handles also need a TTL, otherwise a stale crawl lingers indefinitely. Store the expiry alongside the rows and handle an expired handle exactly as you would a missing one. 3. A semaphore is not a rate limiter. It bounds concurrent requests, not requests per second, and it is a separate number from your plan's concurrency ceiling. Read the ceiling from the usage endpoint and size the semaphore under it, leaving room for other jobs. The same call reports credit limits and current concurrency, so it also tells you what a crawl has cost so far. 4. Scraped text still reaches the model, just less of it: a schema and a sample row travel with every handle, and a sample row is scraped content. How much that matters has been measured. One analysis examined 12,230 tools across 1,360 MCP servers, accepted for IEEE Symposium on Security and Privacy 2026, traced the root cause to MCP lacking context-tool isolation and least-privilege enforcement, and found 27.2% of those servers exposing at least one threat-relevant tool. 5. A crawler is still a crawler. Nothing here replaces frontier management, deduplication or retry budgets. Past what a single tool call should own, reach for a crawler — a CLI with resume for recursive jobs and an input-file mode for a fixed URL list can be less code than a second server. 6. Permission is part of the budget now. A newer family of purpose-based controls governs the reason content may be used, not merely whether a crawler is allowed to fetch it, and some sites bill access per crawl at the CDN. Read a target's terms and its controls before aiming a fleet at it, and plan for a metered source as a line item rather than something to work around. 7. In-memory task stores do not survive a restart. The SDK's default store keeps tasks in the process, so a crawl that outlives a deploy leaves a handle that no longer resolves. A replacement store can be supplied; the interface in the pinned version is nine async methods covering create, get, update, result storage and retrieval, list, delete, plus wait and notify for the polling handshake. A later SDK release removes that module, so treat the shape as durable and the import path as disposable. Backing tasks with the same store that holds your datasets keeps both lifetimes in one place. 8. The whole dataset is re-read on every query. The query tool parses the stored JSON into Python objects on each call, so wall time and memory scale with row count while token cost does not. These 800 rows are about 0.5 MB in memory; a million would be closer to 620 MB, held for the duration of the call. Past a few hundred thousand rows, query the store without loading it — the stronger argument for the SQL path. Credits scale with pages fetched, not with questions asked. The crawl above cost 40 credits and the three questions added nothing; the same crawl with JS rendering at five credits a call would cost 200. A 40,000-page job turns that gap into a budget conversation, so return credits spent with every handle. Current rates live on the pricing page, which also states the free tier; the ladder and one crawl spend 55 credits between them, and the rest of the runs take it to a few hundred.

The risk this design does not remove

This server supplies one leg of the lethal trifecta on its own: untrusted content, since anything at the fetched URL ends up in the dataset. The other two legs — private data and a way to communicate externally — come from whatever else sits in the agent's toolkit. Per-server least privilege does not catch that, because the risk assembles across the whole session rather than inside one server. Researchers showed the composition failing against a major code host's own MCP server. A public issue could carry an injected instruction, and in their proof of concept an agent with access to both repositories drew private data into context and leaked it through a pull request it opened. Every tool call in the chain was individually authorized; the composition was not. The IEEE paper's end-to-end runs found 9 of 10 real toolchains leaking private data in at least one of 10 trials. Model behaviour split sharply: some held out against every attack, while others fell in nearly every case. Keeping fewer rows in context narrows the opening; it does not close it. The isolation described earlier — a separate process and an egress proxy — bounds what a breach can touch, not the injection itself. The defences aimed at that are structural rather than infrastructural: one keeps untrusted text away from the privileged model with a dual-model split; another mediates, by capability, what a tool may act on. Both are still research rather than a library you install, but they are where the answer to composed attacks is being built.

A short checklist before you ship

  • Count what your clients load today. Run a definition census against the servers you have connected and add up the token column; tool count is a poor proxy. - Rename any tool whose description could belong to thirty others, and remove descriptions that name a competing tool outright. - Point extraction rules at your own target and compare the token counts of raw HTML, markdown and extracted fields before choosing a default. - Check the dispatch path in the SDK version you ship before relying on a plain def handler to move off the event loop. - Decide the break-even for a handle: if the dataset is a few hundred rows and the questions are predictable, returning rows directly is cheaper and simpler. - Move the dataset store off local disk before a second instance exists, and decide what your sandbox boundary is worth before someone else decides for you. Context windows will keep growing, and these figures will drift along with them. What stays fixed is the underlying trade: whatever context you hold costs you on every turn, both in billing and in the model's attention. Everything an MCP server places before a model counts as context, so the least expensive row is the one that never arrives.

Frequently asked questions

What is an MCP server?

An MCP server exposes tools, resources and prompts to an MCP client over the Model Context Protocol. The client lists the tools at startup and calls them during a conversation. For scraping, a server typically wraps fetching, unblocking and parsing behind a few named tools.

How many tools should an MCP server have?

There is no fixed limit, but tool definitions occupy context on every turn. In a seven-server census, per-tool cost ranged from 141 to 1,011 tokens, so a ten-tool server can cost more than a 29-tool one. Measure the token total rather than counting tools.

Do MCP servers slow down agents?

They can, mainly in two ways. A handler that blocks the event loop serializes concurrent calls: in one benchmark, throughput fell from 42 to 3.2 calls per second. Large results also slow later turns, because the model re-reads them. Against a local origin, transport choice made no difference this method could resolve.

Should an MCP tool return data or a handle?

Return a handle once results grow past a few hundred rows. In one test, four questions against 800 scraped rows cost 85,082 tokens when the tool returned rows. The same four cost 868 tokens against a handle the agent queried with code.

Does tool search fix MCP context bloat?

It reduces the cost without fixing the choice. Deferring definitions on a 112-tool scraping corpus cut measured request input by 43%. The search put the intended tool at rank one in only two of the six tasks where several servers offered the same capability.

Is it safe to let an agent run code?

Only with genuine isolation. A separate process capped on CPU and forks limits resource consumption, yet it is not a security boundary. A four-line escape reached os.system past a six-name blocklist without ever calling a blocked name. For production you need a kernel or hypervisor boundary, such as gVisor or a microVM, and even those are not a guarantee.

When is a handle-plus-code design not worth it?

When the dataset is small and the questions are predictable. At roughly 35 tokens per row, a few hundred rows still fit in a corner of the context window, and returning them directly is cheaper and simpler than maintaining a store, a sandbox and a handle lifecycle. The architecture pays off when the dataset would crowd the context, when the questions are open-ended, or both.

Why did extraction and raw HTML cost the same credit?

On the page measured, selector-based extraction returned 623 tokens against 9,673 for raw HTML at the same one-credit cost. The credit price reflects the fetch configuration, not the output size, so reducing at the fetch layer is free in credits and more than fifteen times cheaper in context whenever the fields are known.

Deferred vs fully loaded tool definitions on a 112-tool corpus
TaskAll 112 loaded (total input tokens)Deferred (total input tokens)Saving on total request input
Get the transcript of a YouTube video22,16212,59643%
Scrape a product page and return its content22,16313,08541%
Take a screenshot of a rendered page22,16112,79442%
Run a Lighthouse accessibility and SEO audit22,16412,60943%
Search Walmart for a product listing22,16012,34544%
Extract structured fields with CSS selectors22,16312,74542%
Find every URL on a site22,16012,75642%
Download a PDF or image file from a URL22,16312,70443%

July 2026 figures, one request per arm per task, on gpt-5.4. Mean saving 43%, range 41–44%.

BM25 retrieval accuracy by task group
Task groupIn BM25 top 5At BM25 rank 1Median definition tokens returned
Exactly one tool can do it, 8 tasks100%75%1,536
Several servers can, 6 tasks83%33%2,431

14 tasks split by whether the corpus contained exactly one tool capable of the job.

Raw HTML token cost of four real pages
PageHTML sizeRaw HTML tokens
Hacker News front page34.0 KB11,834
Python docs, asyncio-task172.0 KB50,024
MDN HTTP headers reference284.2 KB78,703
github.com/modelcontextprotocol/servers348.2 KB141,871

Fetched July 2026; tokens counted with a single consistent encoding.

One catalogue page, six request shapes
Request shapeCreditsSeconds (single run)Tokens returned
Raw HTML, no rendering13.479,673
Raw HTML, JS rendered51.909,681
Markdown10.923,055
Text only10.921,111
extract_rules (CSS)10.94623
ai_extract_rules63.43616

Each shape is one run against the same URL; the first row carries connection setup, so timings are not a latency comparison.

Hosted MCP path vs direct API on the same page
PathMedian secondsCredits per callTokens returned
MCP get_page_html (1.1.1, always renders JS)8.4159,681
Direct API, render_js=false1.2519,673
Direct API, extract_rules (title + price only)0.831463

First two rows are medians of five runs; the extraction row is a single call asking for two fields, not the three used in the ladder, which is why it reads 463 rather than 623.

Handler shapes at 30 concurrent calls
HandlerWall timeCalls per secondTokens per call
async def + blocking client, full HTML9.38s3.29,673
def + blocking client, full HTML (mcp 1.28.1; fixed in 2.0)9.40s3.29,673
async def + async client, full HTML0.71s42.29,673
async def + async client, extracted fields0.72s41.6717

Median of three runs per variant against a local origin with a fixed 300 ms delay.

Fixed-summary tool vs handle plus model-written code, 800 rows
QuestionFixed-summary toolHandle plus model-written code
Total value of every book86119
The 5 most expensive books28,332248
Median price of 5-star books28,332141
Titles containing a colon, priced over £5028,332215
4 questions, total85,082868

Each figure includes the measured 71-token envelope around every tool call. The handle total adds a one-time 145-token handle entry cost to the four marginal per-question costs.