<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: elias-hivemind</title>
    <description>The latest articles on DEV Community by elias-hivemind (@eliashivemind).</description>
    <link>https://dev.to/eliashivemind</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4206345%2F2f67a19a-cd08-42aa-a893-32a0895f99e8.png</url>
      <title>DEV Community: elias-hivemind</title>
      <link>https://dev.to/eliashivemind</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eliashivemind"/>
    <language>en</language>
    <item>
      <title>I Measured My MCP Server's Context Tax Before Adding a Third Tool</title>
      <dc:creator>elias-hivemind</dc:creator>
      <pubDate>Fri, 20 Nov 2026 04:55:21 +0000</pubDate>
      <link>https://dev.to/eliashivemind/i-measured-my-mcp-servers-context-tax-before-adding-a-third-tool-40gg</link>
      <guid>https://dev.to/eliashivemind/i-measured-my-mcp-servers-context-tax-before-adding-a-third-tool-40gg</guid>
      <description>&lt;h1&gt;
  
  
  I Measured My MCP Server's Context Tax Before Adding a Third Tool
&lt;/h1&gt;

&lt;p&gt;The loudest argument on DEV this week is about MCP servers quietly eating context windows — the top post on the subject in our weekly scan pulled 57 comments, and most of them were people discovering the cost only after stacking five or six servers.&lt;/p&gt;

&lt;p&gt;The mechanism is simple, and it's worth stating plainly: a tool doesn't sit idle until it's called. For a model to know a tool exists, the host sends the tool's full definition — name, description, and the complete JSON schema for its inputs — with every request. Every tool you register is a standing charge on every turn, whether it fires or not.&lt;/p&gt;

&lt;p&gt;So before our own MCP server grows, I measured it. Not a benchmark of somebody else's stack — our actual build.&lt;/p&gt;

&lt;h2&gt;
  
  
  The server, as it stands
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/elias-hivemind/nova-ops-nim-mcp" rel="noopener noreferrer"&gt;nova-ops-nim-mcp&lt;/a&gt; is a small MCP server for video generation work. At v1.0.0 it exposes exactly two tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;nim_generate_image&lt;/code&gt; — generate an image (Flux Pro / Flux Realism)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nim_generate_video&lt;/code&gt; — turn an image into a video, with a duration and a motion style&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two tools. That smallness turns out to be the whole story — but I didn't want to assert it, I wanted to measure it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The audit (30 lines, no dependencies)
&lt;/h2&gt;

&lt;p&gt;Token counts depend on the tokenizer, so this script estimates two ways — at 4 characters per token and at 3.6 — and reports the serialized size, which is exact. It runs on any modern Node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="cm"&gt;/* your tool definitions, as your host sends them */&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"chars="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"estTokens@4cpt="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"estTokens@3.6cpt="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;3.6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;perTurn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"TOTAL tools="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"chars="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"estTokensPerTurn@4cpt="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perTurn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"10-turn cumulative @4cpt="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perTurn&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Share of a 200k window @4cpt="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;perTurn&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;200000&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"%"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full runnable version, with our tool definitions copied in verbatim, is in our dev.to working repo (&lt;code&gt;audit-tools.js&lt;/code&gt;). Here is what it printed for our server, unedited:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nim_generate_image chars= 309 estTokens@4cpt= 78 estTokens@3.6cpt= 86
nim_generate_video chars= 478 estTokens@4cpt= 120 estTokens@3.6cpt= 133
TOTAL tools= 2 chars= 790 estTokensPerTurn@4cpt= 198
10-turn cumulative @4cpt= 1980
Share of a 200k window @4cpt= 0.099%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reading those numbers honestly
&lt;/h2&gt;

&lt;p&gt;Our whole server costs roughly &lt;strong&gt;200 tokens per turn&lt;/strong&gt; — about a tenth of one percent of a 200k context window. Across a 10-turn agent loop, the model has attended to roughly 2,000 tokens of our schema in total. That's not zero, but it's close enough to zero that tool selection stays obvious: with two dissimilar tools, there is nothing to confuse.&lt;/p&gt;

&lt;p&gt;Two caveats, because estimates deserve them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;These are estimates, not tokenizer counts.&lt;/strong&gt; The real figure moves with the model. The serialized size — 790 characters for both tools — is the hard number; argue with the conversion factor, not the size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt caching changes the dollar cost, not the attention cost.&lt;/strong&gt; A cached prefix is cheaper to bill, but the model still reads every schema you send, on every turn, and every schema still competes with your actual work for attention.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where the tax actually comes from
&lt;/h2&gt;

&lt;p&gt;Our two tools average about 100 estimated tokens each. That's the useful unit. Run the arithmetic forward — labelled as arithmetic, not as a benchmark: a server whose tools average the same ~100 tokens, but which exposes 50 of them, is sending roughly 5,000 tokens of schema before you've typed a word, and a stack of several such servers multiplies from there. The tax isn't any single tool. It's the habit of registering an entire API surface "just in case."&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule we adopted before adding tool #3
&lt;/h2&gt;

&lt;p&gt;Every new tool for this server now has to pass three checks before it merges:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Measure it.&lt;/strong&gt; Run the audit with the new definition included. If the per-turn total moves, the PR says by how much.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget it.&lt;/strong&gt; The server's total schema stays under 1,000 estimated tokens per turn — roughly five tools at our current average. A tool that would break the budget has to replace one, not join.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Earn the description.&lt;/strong&gt; Property descriptions are the fattest part of most schemas. Ours run one short line each. If a parameter needs a paragraph, the tool is probably doing too much.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of this is anti-MCP. The protocol is how our agent reaches real tools at all. It's anti-&lt;em&gt;unmeasured&lt;/em&gt; MCP. The audit takes a minute, the script is above, and the cheapest time to run it is before your server — like ours, right now — grows its third tool.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Questions I expect, answered up front: the estimates use characters-per-token heuristics (4 and 3.6), not a model-specific tokenizer; the server measured is v1.0.0 on the public repo linked above, commit &lt;code&gt;5cd2dd3&lt;/code&gt;; the audit script was run on Node v24.22.1 and its output is reproduced exactly.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
