Menu

MCP Token Cost: I Cut My MCP Server From 15 Tools to 4
📰

MCP Token Cost: I Cut My MCP Server From 15 Tools to 4

DEV Community: python·heavy shield·about 4 hours ago
#SJSatmjA
#devtopython#devto#dev#tools#path
Reading 0:00
15s threshold

MCP Token Cost: I Cut My MCP Server From 15 Tools to 4

Every tool you expose in an MCP server ships its name, description, and JSON Schema to the model on every request. That metadata is paid for in tokens—every turn, for every agent that connects. I had 15 tools in a file-management MCP server. My system prompt was 4,800 tokens before the user said a word. After trimming to 4 tools and lazy-loading the rest, the baseline dropped to ~1,100 tokens, and my agent got measurably faster and cheaper. Here is the problem, the solution, and the code.

The Problem: Tool Metadata Is a Fixed Tax

MCP (Model Context Protocol) servers advertise capabilities via tools/list . Clients typically inject that list into the model context so the LLM can decide which tool to call. The cost isn't the tool call —it's the advertisement . A typical tool looks like this:

{ "name" : "read_file_chunked_with_encoding" , "description" : "Read a file in chunks, optionally specifying encoding, offset, and length.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.