Article: Bash wrappers ate more tokens than the seven-schema Model Context Protocol (MCP) in a 12-question run, showing the shell isn’t the cheap shortcut many engineers think. Token usage translates directly into cost for large-language-model (LLM) agents that run at scale.

The experiment that flipped the script

A developer measured four ways an LLM agent could fetch vessel data:

  • MCP – seven tool schemas hosted behind the Model Context Protocol.
  • Bash + curl (cold) – a raw shell call with no extra prompting.
  • Bash + curl (warm) – the same shell call plus system prompts that guide safe usage.
  • Dedicated CLI tool – a purpose-built command-line interface.

All four ran through a 12-ask conversation. Token consumption, which drives API bills, came out as follows:

  • MCP: 109,779 tokens
  • Bash + curl (cold): 158,021 tokens
  • Bash + curl (warm): 178,577 tokens

The dedicated CLI tool’s numbers weren’t disclosed, but the two Bash variants already out-spent MCP.

Why the shell cost more than the protocol

Each Bash tool required roughly 2,700 tokens of “harness prompts” – the instructions that tell the agent how to invoke the shell safely, parse output, and handle errors. Those prompts alone exceed the total token weight of all seven MCP schemas combined.

The cost isn’t just the initial call. In production the same agent pre-loaded 11 MCP servers at startup, consuming 19,800 tokens before the first user query arrived. Then, on every turn, the agent re-read every schema from every server, so even a trivial request like “what time is it?” paid the token price of every other tool description.

The hidden drain of eager loading

When an LLM agent eagerly loads every tool server on each turn, the token bill inflates dramatically. The experiment showed that the “real” cost of using Bash isn’t the shell command itself but the surrounding context that must be transmitted to the model every time.

  • Fixed-cost tools (MCP schemas) add a predictable token overhead per turn.
  • Dynamic payloads (curl responses) add a growing debt that scales with conversation length and data size.

Thus, a shell that looks “free” on the surface actually imposes a larger, variable token tax.

What AI engineers should do next

  • Adopt lazy loading. Load a tool server only when its schema is actually needed, and keep it in memory across turns instead of re-reading it each time.
  • Treat tool schemas as a fixed per-turn expense. Plan token budgets around the known size of MCP definitions rather than assuming shell commands are free.
  • Re-evaluate “shell = cheap” assumptions. Profile token usage for each tool path before committing to a design.
  • Keep shaped tools in the loop for small models. Even with limited context windows, well-defined schemas improve reasoning, unit conversion, and error handling.

The bottom line: token economics, not protocol design, dictate cost. Managing when and how tool servers are loaded can shave tens of thousands of tokens from a conversation, directly lowering operational spend.

Source: https://dev.to/clarkbw--/enabling-bash-costs-more-context-than-seven-mcp-tool-schemas-2h82