Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/Mcp vs cli vs skills what each costs in context
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

MCP vs CLI vs Skills: What Each Costs in Context

Source: OpenRouter Blog•November 11, 2026 at 02:00 AM

MCP vs CLI vs Skills: What Each Costs in Context

Every tool you give an agent sends its definition to the model on every request, and you pay for it as input tokens. A Model Context Protocol (MCP) server can add tens of thousands of tokens to the context window. The usual alternatives are a command-line tool (CLI) or a skill.

Every tool you give an agent sends its definition to the model on every request, and you pay for it as input tokens. A Model Context Protocol (MCP) server can add tens of thousands of tokens to the context window. The usual alternatives are a command-line tool (CLI) or a skill.

We measured it on one GitHub task with the GitHub MCP server, the gh CLI, and a gh skill, on Claude Haiku 5.5, Claude Sonnet 5.5, GPT-6 Luna, and Gemini 3.8 Flash. On Sonnet 5.5, all three answered correctly, but the input tokens they used were very different. The CLI used 1,421, the skill used 3,315, and the MCP server used 59,417 with its default tools loaded. Here’s where the tokens go and how to cut them with our Tool Search server tool.

TL;DR

  • The GitHub MCP server’s 46 default tools add 19,436 tokens to every request on Claude Sonnet 5.5.

The GitHub MCP server’s 46 default tools add 19,436 tokens to every request on Claude Sonnet 5.5.

  • On Sonnet 5.5, one tool result, GitHub’s release object, cost about 20,400 tokens, more than all 46 definitions.

On Sonnet 5.5, one tool result, GitHub’s release object, cost about 20,400 tokens, more than all 46 definitions.

  • Tool Search cut the up-front cost of 46 tools to under 600 tokens. Over the whole task, it halved the cost on Sonnet 5.5 and raised it on Claude Haiku 5.5.

Tool Search cut the up-front cost of 46 tools to under 600 tokens. Over the whole task, it halved the cost on Sonnet 5.5 and raised it on Claude Haiku 5.5.

What is the difference between MCP, a CLI, and a skill?

All three give a model a capability. They differ in what the model reads before it can use it.

A CLI relies on the model already knowing the tool. A skill teaches the model how to use a tool, and the model loads the full instructions only when a task needs them.

How many tokens does an MCP server add to every request?

The reliable way to count them is to ask the model. Each provider writes tool definitions into the prompt in its own format before counting tokens, which a local tokenizer misses. Send the same request with and without the tools, and the difference in usage.prompt_tokens is what the tools cost on every turn.

Save this as mcp_cost.py. It speaks the 2025-06-18 version of MCP, which the GitHub server accepts.

Pass the server’s start command as arguments, as here for the GitHub MCP server v2.0.2.

The cost grows with each tool you add. On Haiku 5.5, the issues toolset has 10 tools and adds 5,801 tokens. The users toolset has one tool and adds 619.

The model you use changes the count too. The same 46 tools cost 19,436 tokens on Haiku 5.5 but 8,903 on GPT-6 Luna, so measure on the model you plan to run.

Even the provider serving the model can change it. On Gemini 3.8 Flash, the 46 tools cost 8,525 tokens through Google Vertex and 13,010 through Google AI Studio. That’s why the script always sends Gemini requests to Google Vertex.

What does the same task cost with a CLI, a skill, and MCP?

We asked each model, “What is the latest release of the GitHub repository cli/cli, and what are the three most recently opened open issues in that repository with the label bug?” Each approach ran as a tool-calling loop on our Responses API, and we added up usage.input_tokens across requests.

  • CLI. One run_shell tool and the line “The GitHub CLI gh is installed and authenticated.”

CLI. One run_shell tool and the line “The GitHub CLI gh is installed and authenticated.”

  • Skill. The same tool, plus a one-line index pointing at a 1,492-character SKILL.md of gh recipes.

Skill. The same tool, plus a one-line index pointing at a 1,492-character SKILL.md of gh recipes.

  • MCP. The server’s tools, scoped to the 2 the task needs, the default 46, or all 91.

MCP. The server’s tools, scoped to the 2 the task needs, the default 46, or all 91.

We ran each combination three times on October 20, 2026, and show medians. Haiku 5.5 counts a prompt exactly as Sonnet 5.5 does, but it took extra turns in some runs, so we show Sonnet’s steadier tokens and billed cost.

Every run in this table answered correctly. The failures came with Tool Search, covered below. On Sonnet 5.5, the default MCP server used 42 times the CLI’s input tokens and cost 17 times as much, $127 against $7.50 per 1,000 tasks. Output tokens cost five times as much as input on Sonnet 5.5, and the CLI run’s 463 output tokens were $0.0046 of its $0.0075.

The skill cost more than the bare CLI because the file stays in the conversation once the model reads it. For a CLI tool the model knows well, a skill is optional. For your own CLI, the skill is how the model learns the commands.

Why do MCP tool results cost as much as the definitions?

get_latest_release returned GitHub’s full release object, 42,182 characters, and 87% of it described the 22 download files. The model needed the tag and date, which is all gh release view returned.

That object stays in the context window and is resent with every later request, and on Sonnet 5.5 it added about 20,400 tokens. Scoping the server to two tools cut the first request from 19,487 tokens to 1,406. The whole task still cost 23,228.

The table shows two fixes. First, expose only the tools the agent needs, with —tools=get_latest_release,list_issues or —toolsets=issues,repos. Second, shrink results in your client before the model sees them. A 4,000-character cap brought the scoped route to 5,357 tokens with every run correct, because GitHub puts the tag and date near the top.

The cap worked only because of where the fields happened to sit. Combined with Tool Search, the cap left Gemini 3.8 Flash and Haiku 5.5 with one correct answer in three runs each, and Gemini once hit our 12-request limit while retrying.

Keep whole fields instead, as —json does for the CLI. The GitHub server’s list_issues takes a fields argument, and asking for only number, title, and creation date cut its result from 8,336 characters to 714. Without it, the model decides the size. In four of six runs with 46 or 91 tools loaded, GPT-6 Luna asked for 100 issues with their full text and got 281,963 characters back.

Does Tool Search fix MCP’s context problem?

Tool Search removes most of the cost of tool definitions. You mark tools defer_loading: true and add {“type”: “openrouter:tool_search”}. We withhold the deferred definitions and send the search tool, plus any tools you left loaded. The model searches tool names and descriptions with a regular expression and calls a match on its next turn. It’s in beta and works with any model and provider on the Responses and Messages APIs.

With all 46 GitHub tools deferred, the cost before any search was 578 tokens on the Claude models, 144 on GPT-6 Luna, and 130 on Gemini 3.8 Flash.

This script sends one question with all 46 tools loaded, then deferred. Save it next to mcp_cost.py, since it reuses list_mcp_tools.

To try it on your agent, mark your MCP tools defer_loading: true, add {“type”: “openrouter:tool_search”}, and compare usage.input_tokens before and after.

The Tool Search rows vary with how the model searches. In five separate runs of this script, Haiku 5.5 used 2,134 to 13,225 tokens, rising with each search. GPT-6 Luna wrote phrases instead of patterns, made three to six searches, and once gave up without calling the tool. Our docs suggest keeping your three to five most-used tools loaded.

Over the whole task, the result depended on the model.

GPT-6 Luna’s loaded figure includes the 100-issue request described above.

On Sonnet 5.5, 91 deferred tools cost 1,281 tokens more than 46, where loading all 91 cost about 42,000 more. Tool Search doesn’t shrink tool results, and the release object still filled most of Sonnet’s second request.

Haiku 5.5 cost more with 46 deferred tools than with all loaded. In all three runs it asked list_issues for a field the tool doesn’t offer, then retried three or four times with arguments of the wrong type, such as labels as a string instead of an array. With all tools loaded, Haiku made the same mistake in two of three runs and fixed it on its next call. Cap the requests in your loop, and check tool errors when a run’s cost jumps.

Tool Search reveals tools by widening tool_choice, so a request that also forces a tool call fails.

400 `tool_choice` conflicts with `openrouter:tool_search`. Deferred tools are revealed through `tool_choice`, so it must be omitted or set to `{“type”: “allowed_tools”, …}`. Remove `tool_choice`, or drop `defer_loading` from your tools to use it as-is.

Chat Completions doesn’t accept openrouter:tool_search and returns a 400, so move that agent to the Responses or Messages API first.

MCP vs CLI vs skills: which should you use?

Use a CLI when one exists and your agent can run commands. When it can’t, use MCP, scoped and with small results.

If your agent has no shell, our Shell server tool gives any model a sandboxed one. In our Agent SDK, MCP Tools connects remote MCP servers, and the skills loader example adds a skill’s instructions only after the model asks for it.

We tested one server on one task, so run mcp_cost.py on yours before you decide.

Frequently asked questions

What is a CLI in an AI agent context?

A CLI (command-line interface) is a program you run with typed commands. An agent gets a shell tool and writes the commands itself. In our tests, the gh CLI used 1,421 input tokens on a GitHub task, against 59,417 for the GitHub MCP server.

What is the difference between an MCP server and a connector?

An MCP server exposes tools over the Model Context Protocol. A connector is what an app such as Claude calls its link to a remote MCP server. Our Agent SDK can connect remote MCP servers through MCP Tools.

Are skills replacing MCP?

No. A skill is instructions, usually for a CLI, that load only when a task needs them. MCP gives typed tools with their own auth and works without a shell. On OpenRouter, Tool Search lets you keep MCP and load each tool only when needed.

Does prompt caching fix MCP’s token cost?

It lowers the price of those tokens but doesn’t remove them. As of October 2026, on OpenRouter, cached input costs a tenth of the normal rate on Claude Haiku 5.5 and GPT-6 Luna, per our live model prices, and still fills the context window.

How many MCP tools is too many?

Our Tool Search docs suggest deferring tools once definitions pass roughly 10,000 tokens or about 10 tools. The GitHub MCP server’s 46 default tools came to 19,436 tokens on Claude.

Next steps

  • Tool Search covers every option, including max_results.

Tool Search covers every option, including max_results.

  • Build a Reliable Tool-Calling Agent Loop shows the kind of loop our runs used, with an iteration cap.

Build a Reliable Tool-Calling Agent Loop shows the kind of loop our runs used, with an iteration cap.

  • OpenRouter Prompt Caching explains what cached tokens cost.

OpenRouter Prompt Caching explains what cached tokens cost.

← All articles

What this article says

More in AI & Machine Learning

All →
Donating KubeRay to the CNCF
Anyscale

Donating KubeRay to the CNCF

Cogent and OpenAI build cyber defense factories for enterprises
OpenAI

Cogent and OpenAI build cyber defense factories for enterprises

ChatGPT Plus for veterans and servicemembers
OpenAI

ChatGPT Plus for veterans and servicemembers

BotPsy: On-Device Personal Assistant with a Sub-Billion-Parameter Agentic Language Model
Hugging Face

BotPsy: On-Device Personal Assistant with a Sub-Billion-Parameter Agentic Language Model

OpenAI, Anthropic face new oversight as New York’s AI safety law takes effectПресса
OpenAI

OpenAI, Anthropic face new oversight as New York’s AI safety law takes effect

How AI Helps Recyclers Turn Mixed Waste Into Reusable Material
NVIDIA

How AI Helps Recyclers Turn Mixed Waste Into Reusable Material

More from OpenRouter

LLM Quantization: What fp8 and fp4 Do to Quality and Price
OpenRouter

LLM Quantization: What fp8 and fp4 Do to Quality and Price

LLM API Rate Limits: How to Fix OpenAI and Claude 429 Errors
OpenRouter

LLM API Rate Limits: How to Fix OpenAI and Claude 429 Errors

How to Get Structured Output from Any LLM: JSON Schema, Tool Calls, or a Decision Model
OpenRouter

How to Get Structured Output from Any LLM: JSON Schema, Tool Calls, or a Decision Model

How to Build a Voice AI Agent
OpenRouter

How to Build a Voice AI Agent

Best OCR Model for Scanned Documents, Measured
OpenRouter

Best OCR Model for Scanned Documents, Measured

How Sentry Capped Runaway AI Bills Without Restricting Access
OpenRouter

How Sentry Capped Runaway AI Bills Without Restricting Access