MCP servers are the hot new plumbing for Claude Code. Drop in a GitHub server and your agent can open pull requests. Add a filesystem server and it reads your repo structure. The demos look magical. What nobody demos is the receipt.

The cost is not in the API calls the tools make. It is in the tools themselves.

Every time you register an MCP server, you are not just adding a capability. You are adding a block of text to your context window, and that block gets billed on every single turn. Whether the agent uses the tool or not, you pay for its existence. The meter starts running the moment the server connects.

Paying Rent on Tools You Never Touch

Here is the mechanic that gets glossed over. Each tool definition in an MCP server ships with a name, a description, and a JSON schema telling the model what arguments the tool expects. That entire payload gets injected into the system context at the start of every turn. The model needs to see the full catalog so it can decide whether to call a tool, but you are the one footing the bill for that visibility.

The overhead per tool is not trivial. In practice, a single tool definition consumes between 80 and 150 tokens. That means a modest server exposing ten tools quietly eats 800 to 1,500 tokens before you have typed a single sentence. You are not paying for compute. You are paying for the privilege of having the option.

I ran the numbers across a standard 20-turn session to see exactly how this compounds.

With no MCP servers loaded, the overhead is zero. The context window contains only your conversation.

Load a custom minimal server with three tightly scoped tools, and the tax is 180 tokens per turn. Across 20 turns, that is 3,600 tokens gone. Not a disaster, but real money.

The popular filesystem server, which exposes seven tools, pushes that to 640 tokens per turn. Over the same session, you have burned 12,800 tokens just maintaining the connection. You have not read a file yet. You have not listed a directory. You have merely kept the server on the menu.

Then there is the GitHub server. With 26 tools registered, it dumps 3,100 tokens into every turn. After 20 back-and-forth messages, the overhead totals 62,000 tokens. At Sonnet 4 pricing, that is $0.19 in pure context tax. You paid nineteen cents for overhead before the agent even considered creating an issue.

That figure feels small in isolation. It is not.

The Overnight Agent Problem

Where this stings is in long-running autonomous loops. If you are using Claude Code as an agent that iterates on its own, that per-turn tax multiplies brutally. An agent running overnight across 2,000 turns with the GitHub server loaded does not pay 62,000 tokens in overhead. It pays 6.2 million.

That is $18.60 spent on literally nothing productive. The agent might have slept through the night without touching a single GitHub tool. It might have worked entirely inside local files. You still get charged for all 26 GitHub tool definitions on every one of those 2,000 turns because they were registered in the session.

The critical point to internalize is that you pay for registered tools, not called tools. The model does not check which tools it actually uses and then discount your bill. If the server is connected, its full manifest is re-introduced into context each cycle. This is a per-turn tax on potential, not on action.

For developers running iterative coding agents, test harnesses, or batch review jobs, this is a silent budget killer. A human conversation of 20 turns is light. An agentic loop of 200 or 2,000 turns is where the math turns punitive.

How to Keep Costs Under Control

MCP is genuinely useful. You should use it. But treat it like a utility you switch on for the job at hand, not a permanent fixture you bolt onto every session.

Scope Configs to the Project and Task

Do not load every server into your global Claude Code configuration by default. Build project-scoped MCP configs that match the work you are actually doing. If you are refactoring a local module, you probably need the filesystem server and nothing else. If you are triaging issues, load the GitHub server for that specific task and disconnect it when you switch back to local development.

Think of it like leaving apps open on your phone. One or two is fine. Twenty running in the background drains the battery for no reason.

Prefer Servers with Fewer Tools

Non tutti i server MCP sono progettati con la stessa disciplina. Alcuni espongono un'interfaccia snella di due o tre azioni mirate. Altri offrono un catalogo vastissimo di 25 o 30 strumenti, molti dei quali non utilizzerai mai. Un server con tre strumenti potrebbe costarti 180 token per turno. Uno con 26 strumenti può costarne 3.100. Si tratta di un aumento dell'overhead di 17 volte per un divario di funzionalità che potrebbe non interessarti.

Prima di installare un server, esamina il suo manifesto degli strumenti. Se registra una dozzina di operazioni sovrapposte e ne serve solo una, valuta se puoi ridurne la configurazione, fare un fork o scrivere un wrapper più leggero. Ogni definizione di strumento che riesci a eliminare rappresenta un risparmio di token diretto e permanente in ogni turno futuro.

Ridurre le descrizioni degli strumenti

L'intervallo da 80 a 150 token per strumento non è una legge di natura. È una funzione di quanto siano verbiose le descrizioni e gli schemi. Una descrizione ingombrante da 400 token consuma cinque volte il contesto di una descrizione da 80 token, e quella penalità quintuplicata si applica a ogni singolo turno.

Analizza i server su cui fai affidamento. Se la descrizione di uno strumento sembra un testo pubblicitario, riscrivila. Elimina gli aggettivi. Elimina gli esempi che non chiariscono lo schema. Rendi il JSON più compatto. Il modello deve capire cosa fa lo strumento, ma non ha bisogno di un paragrafo di introduzione. Tratta le definizioni degli strumenti come codice: più sono brevi e chiare, meglio è.

Il punto fondamentale

MCP estende ciò che Claude Code può raggiungere. Non estende la tua finestra di contesto gratuitamente. L'overhead è deterministico, ricorrente e del tutto slegato dal fatto che gli strumenti vengano effettivamente utilizzati.

Carica solo i server richiesti dal tuo compito attuale. Scollegali quando hai finito. Controlla il numero di strumenti e la lunghezza delle descrizioni come faresti con qualsiasi altra dipendenza. La regola è semplice: se lo strumento non aggiunge valore in questa sessione specifica, non dovrebbe aggiungere token al tuo conto.

Misurazioni e metodologia della fonte: I added MCP servers to Claude Code — here’s what they cost in tokens

Unisciti alla community di apprendimento AI di GyaanSetu per ulteriori approfondimenti ingegneristici: t.me/GyaanSetuAi