mcp-server-typescript icon indicating copy to clipboard operation
mcp-server-typescript copied to clipboard

Tool surface costs ~42k tokens per turn — worth a way to load a subset

Open varun29ankuS opened this issue 4 months ago • 2 comments

Hi — sharing a measurement rather than a bug report, in case it's useful.

The number

Your server exposes 89 tools totalling 42,288 tokens (gpt-4o tokenizer, exact count). That entire surface is sent to the model on every turn, before the user types anything — it is not paid once at install, it is paid per request.

For scale, across 29 measured public MCP servers the median tool surface is 1,679 tokens. Yours is ~25× that, and the largest we measured in that cohort.

Why it's worth attention

Two independent effects, neither about code quality:

  • Cost and latency, on every turn of every conversation.
  • Selection accuracy. Model tool-selection degrades measurably past roughly 30 tools (arXiv:2606.30317); with 89, a model is more likely to pick the wrong DataForSEO endpoint even when it wants the right one.

What usually helps

Let callers load a subset — an env var or flag selecting tool groups (DATAFORSEO_MODULES=serp,labs), so someone who only needs SERP endpoints doesn't pay for all 89. Several large servers have gone this way.

Context on where this came from

We graded 127 public MCP servers with jig, an open-source MCP checker. Being straight with you about the result, since it's public: your server sits at D (60) on our leaderboard — but that grade is the size cap alone. You score 100 on protocol compliance, 100 on schema hygiene, and 100 on description quality; by every craft measure this is one of the better-built servers we measured. It is big, not sloppy, and our rubric was recently changed specifically so that size alone can no longer produce an F.

Reproduce with:

npx @shodh/jig budget --stdio "npx -y dataforseo-mcp-server" --model gpt-4o

If the measurement looks wrong, tell us — corrections get published as loudly as findings.

varun29ankuS avatar Jul 21 '26 16:07 varun29ankuS

Correction to my own issue, before you spend time on it.

Another maintainer we filed a similar issue with today (Softeria/ms-365-mcp-server#579) pointed out that our framing overclaims, and they were right. Two corrections:

1. "Sent on every turn" is not accurate on every client. Claude Code and Codex now defer MCP tool schemas by default — the full set is not put in context each turn, only the tools the model actually reaches for. So the token figure above is best read as what your server advertises, and the worst case — what a non-deferring client sends every turn — rather than a bill every user pays on every request. The measurement stands; my description of its impact was too strong, and I am correcting it on our leaderboard, our site and our census docs as well as here.

2. Our scanner cannot see subsetting options you may already ship. jig grades the default surface. If dataforseo-mcp-server already supports loading a subset — an env var, a flag, a discovery mode — then our finding recommends something you have already built, and our grade does not credit you for it. That is a flaw in our tool, not in your server; we have opened an issue against ourselves for it. If you do have such an option, telling us is the fastest way to get the record straight.

The underlying point is unchanged and I still think it is worth your attention: a large advertised surface costs context on clients without deferral, and tool-selection accuracy degrades as the menu grows. But you should evaluate it against an accurate claim, not an inflated one.

varun29ankuS avatar Jul 21 '26 18:07 varun29ankuS

Hi, thank you for taking the time to measure this, share the results, and especially for the thoughtful correction and additional context.

We’re happy to share that, starting with DataForSEO MCP Server v3.0, we’ve released a substantially rethought version of the server that addresses the large tool/context surface you highlighted.

Rather than continuing to expose a large number of individual API endpoints as separate MCP tools, we redesigned the approach around a much smaller and more flexible interface. The new version allows the MCP client to use our DataForSEO documentation as part of discovery and then make the required API request without having to advertise the entire API surface to the model up front.

This significantly reduces the MCP context/tool footprint while still keeping the full DataForSEO API accessible when needed. It should also help with the tool-selection problem you mentioned, since the model no longer needs to choose between dozens of narrowly differentiated endpoint tools.

So this was not just a matter of adding a module filter, in v3.0 we reconsidered the server architecture specifically to make it scale better as the DataForSEO API continues to grow.

We’d be very interested to see how the new version performs. If you rerun the measurement against v3.0+, please let us know if you notice anything that can still be improved.

And thank you again for publishing both the original finding and the correction so transparently. Feedback like this is genuinely useful for improving out solutions.

Best regards, Vi From DataForSEO

dfsvlado avatar Aug 18 '26 09:08 dfsvlado