Skip to content

Blog

For tools you own, build a CLI before an MCP server

Every MCP server loads all its tools into context before the agent starts. Keep MCP for external services and give your own tools a CLI, scripts or skills, which cost a fraction of the context.

Written by

Coding agent setup

Published: 9 December 2025 Updated: 2 min read

Your MCP server just consumed 10,000 tokens, and your agent has not done a single thing yet. That is 5% of its context window, gone.

Stack three more servers and you have burned 20% of your agent’s working memory before it starts working. That margin matters when you are trying to build production agents.

Hardly anyone measures this. Teams keep adding MCP servers because it is convenient.

The hidden cost of loading every tool

MCP servers load all their tools at startup, unused ones included. A server has 13 tools and you use 2? All 13 sit in context. That is waste.

The problem is a context tax paid for convenience. For external tools such as Jira, Slack or databases, it is worth paying. For custom tools you own, there is a better way.

MCP is the right choice for external integrations

MCP is fantastic for external integrations: standardized, open source, no lock-in. For third-party services, use MCP. For custom tools you build yourself, you are overpaying.

Three alternatives for tools you own

  1. CLI. The agent reads a readme and the CLI file. It works for you, your team and your agents, a universal interface. Trade-off: manual activation.
  2. Scripts. A readme maps conditions to self-contained scripts, and the agent loads a script only when its condition matches. That is progressive disclosure. Trade-off: more setup, some duplication.
  3. Skills. Bundle the scripts in a Skills directory. Progressive disclosure with automatic triggering. Context savings: the largest of the three. Trade-off: lock-in to Claude Code.

How to decide

  • External tools (Jira, databases, APIs): use MCP.
  • Custom tools you build: build a CLI first.

Why a CLI? It works for three audiences: you, your team and your agents. MCP only works for agents. If you later need standardization, wrap the CLI in MCP.

The context math

MCP servers load every tool definition before the agent starts. CLIs, scripts and skills load only what a task uses. Measure your context spend.

In practice:

  • MCP: Jira, databases, Slack, GitHub, third-party APIs. External tools.
  • CLI or skills: custom tools, internal tools, your APIs, your pipelines. Code you own.

Measured teams pull ahead

The teams that measure context spend will have agents that run for hours and handle complexity. The teams with MCP sprawl will hit context limits and task failures.

Audit your MCP usage. Separate external tools (keep MCP) from custom ones (migrate to a CLI or skills). Build CLI-first, and the context goes back to actual work.

Are your agents context-starved by your tool architecture, or have you architected for efficiency?

Further reading

  1. Agents should write code to call MCP tools, not call them directly In Anthropic's example, direct MCP tool calls took 150,000 tokens and an agent writing code to call the same tools took 2,000. Code execution is the way to use MCP. 2 min readShort post
  2. Slash commands, MCP, sub-agents and skills form a hierarchy Teams build the same workflow three ways because they treat Claude Code's four overlapping features as equals. They form layers: prompts at the base, MCP and sub-agents beside each other, skills composing the rest. 2 min readShort post
  3. Shallow agents fail at step 20, deep agents plan and remember The prompt, tool, result loop works for 5 to 15 steps and collapses on real work. Deep agents add explicit planning, delegation to sub-agents, persistent memory and heavy context engineering. 2 min readShort post

All 14 posts on Coding agent setup

ClientsClient work

Scaling needs named owners

Coding agents scale across teams when named people own the platform, the team practice, the guardrails, and the measurement. Rollout & scale is where that ownership is built and handed to internal owners, in your stack.

Training on this topic: Agentic Engineering for Developers and QA
See Rollout & scale

Want to check one team first? The self-check: twelve yes or no questions, three minutes, instant result, no account. Take the self-check