跳到正文
DEV Community· Vladimir Beskorovainyi·· 19 小時前AI 評分66

Claude Code 的 19 個 MCP 伺服器提供 738 個工具,作者一個月只調用 39 個

MCP Tools: I Have 738 Connected and Called 39 in a Month

AI 導讀

作者盤點 Claude Code 中 19 個 MCP 伺服器提供的 738 個工具,發現 30 天內只呼叫過 39 個,這些伺服器的工具呼叫佔全部工具呼叫的 0.9%。MCP 每次對話預先佔用 16,500 個 token,另有 524,700 個工具定義延後載入;工具最多的伺服器並非預先成本最高者。作者計劃停用 12 個零調用伺服器,估計每次對話至少可釋出 9,300 個 token。

正文

I counted every tool my 19 MCP servers offer in Claude Code and every tool called in 30 days. Twelve servers were never called, and one of them cost more up front than the other 18 together.

An MCP tool is one action that an MCP server offers to an AI assistant: search the mailbox, list deployments, create a design. My Claude Code setup offers 738 of them from 19 servers. In the last 30 days it called 39.

What a tool is

A server describes each tool with a name, a description in plain language, and a schema that says which arguments the tool takes. A minimal definition looks like this:

{
  "name": "search_messages",
  "description": "Search the mailbox and return matching messages.",
  "inputSchema": {
    "type": "object",
    "properties": { "query": { "type": "string" } },
    "required": ["query"]
  }
}

The assistant never sees the server's code. The definition is the whole interface. It is text, and the model can use a tool only after that text is loaded into the context window. That is why the number of tools matters.

Real definitions are longer than this one. On my machine the median is 406 tokens and the largest takes 9,700.

What 738 definitions weigh

Claude Code has a command, /context, that estimates what occupies the window, rounded to 100 tokens above 1,000. I ran it in a fresh session in an empty folder on November 21, 2026.

Tokens
Fresh session, all 19 servers connected 43,300
Fresh session, MCP switched off 26,800
MCP total up front 16,500
of which tools loaded up front 9,300
of which server instructions 7,200
Tool definitions deferred until needed 524,700

MCP costs me 16,500 tokens in every conversation. That is 38% of everything in the session before my first question. It is not the only line on the bill: my installed skills take another 10,000.

All 738 definitions together weigh about 534,000 tokens, 724 per tool on average. In my earlier article on MCP I estimated this at between 200,000 and 680,000. The measurement lands in the upper half of that range.

The session works because the client defers almost all of that text and fetches a definition only when the model asks for the tool. Claude Code calls this tool search and, according to its documentation, enables it by default. Other tools are adjusting to it. On November 16, 2026, Sourcegraph wrote in its changelog that its default MCP endpoint now offers every tool, because most popular coding agents discover and load tools on demand.

What I called

Claude Code keeps a journal of every session on disk. I wrote a script that reads those journals and counts tool calls by name. It covers 30 days, October 22 to November 21, 2026, and 19,271 tool calls of all kinds.

Count
Tools offered by the 19 servers 738
Tools called at least once 39
Calls to these servers 176
Share of all tool calls 0.9%
Servers never called 12 of 19
Tools on those 12 servers 284
Definition text on those 12 servers 169,000 tokens

The other 99% of calls went to the client's built-in tools, such as reading files and running commands, and to the browser extension that ships with the client. That extension is an MCP server too: I called 13 of its tools, 1,721 times. I left it out of the 738 because I did not choose it. A server I have since removed took another 35 calls.

Five tools account for about half of the 176 calls. The busiest is a mailbox search with 29.

The seven servers I did use look the same: a few tools called, most ignored.

Server Tools offered Definition tokens Tools called Calls
Hosting platform 280 218,000 15 55
Notes 15 3,800 6 36
Design tool 45 51,800 6 31
Mail 31 30,800 2 30
Code hosting 46 20,200 6 12
Analytics 9 9,500 3 11
Presentations 28 31,000 1 1

The 39 tools I called hold 36,000 tokens of definitions, under 7% of the total.

What switching servers off gives back

Under my earlier article a reader asked what I would get back by disabling the server with the most tools. I answered with an estimate of 5,000 tokens. Then I measured, by denying servers in the client one at a time, and the answer depends on which server you switch off.

Fresh session Tokens up front Deferred definitions
All 19 servers 43,300 524,700
Without the hosting server, 280 tools 43,200 301,500
Without the meeting-notes server, 21 tools 34,700 515,900
Without the 12 servers I never called 34,000 363,100

The largest server holds 42% of the deferred text and costs me a few hundred tokens at most while none of its tools is called. The report rounds to 100 tokens, and the difference is one or two of those steps. My estimate was far too high.

The expensive one is a server with 21 tools. Five of them load in full before my first question, 8,600 tokens together, and I did not call that server once in 30 days. The documentation describes one way this happens: a server can mark a tool to load up front. I have not confirmed that this is the cause here.

So the count of tools told me little. One server with 21 tools costs me roughly thirty times more per conversation than one with 280, or more, and I could not see that from the settings page.

This holds only for clients that defer definitions. In a client that loads everything, the 280-tool server alone would add about 218,000 tokens to every conversation.

A note on method. A server that has not finished connecting is missing from the report, so the totals move between runs. I kept only the runs in which every expected server was listed. A deny rule also leaves the server instructions in place, so a real disconnect gives back somewhat more than these numbers.

What I am changing

I am disconnecting the 12 servers with no calls. Together they give back at least 9,300 tokens per conversation, almost all of it from the meeting-notes server, and each of them holds access to an account I was not using through it. I can reconnect any of them in a minute.

There is a second reason. Ten of my servers offer tools whose names start with "search", 25 tools in all. Three servers offer an image-generation tool, two of them under the same name. A reader suggested that with enough tools the model begins to choose a similar tool in place of the right one. I have not measured wrong picks on my data, so I cannot confirm it. Fewer overlapping tools should not make it worse.

Which servers let you limit their tools

A reader told me that pinning the tools in the server URL was his biggest single cut: a server that sent about a dozen tools went down to two or three. I promised to check which of my 19 servers allow that, starting with the largest. I read the documentation of each one on November 21, 2026.

What the documentation offers Servers
A list of tools set in a header, the URL or an environment variable 2
Another control: one project, a dashboard, read-only mode, or account-level switches 4
No option that I could find 6
No server option, only per-tool switches in the client 7

The protocol has no filter of its own: a client can only ask a server for its whole list. So every server that offers one has invented it. Two of mine take such a list directly. GitHub's remote server takes a list of toolsets or tools in a header, or one toolset in the URL path, and the NotebookLM server I run reads lists of enabled and disabled tools from environment variables.

My largest server, the one with 280 tools, has no such list. Its documentation describes a URL scoped to a single project. I found no way to list the tools I want.

That leaves the client. Claude Code can deny a whole server or a single tool, and the documentation says a denied tool is removed from the model's context. I tested it on the 280-tool server.

Deny rule Tools left on that server
None 280
One tool, spelled correctly 279
The whole server 0
One tool, one letter wrong 280
The server name, one letter wrong 280

The misspelled rules did nothing, and I saw no warning. The documentation explains why: its check for rules that match no tool skips names containing an underscore, and every MCP tool name has one. Another reader had reported the same behaviour on two servers he audited: a misspelled name in the filter was accepted without a word, and on one of them he counted that every tool was still served. I have not reproduced his cases, so I do not name them. I have now reproduced the pattern in my own client. After any filter, list the tools again and count them.

Do this on your setup

  1. Run /context in a fresh session. Read three rows: MCP tools, MCP server instructions, and MCP tools (deferred). In a client that defers nothing, that last number would load into every conversation.
  2. Block one server at a time and run it again. The servers that move the up-front number are the expensive ones.
  3. Count your calls. Claude Code keeps its journals in ~/.claude/projects. This script prints every MCP tool you have called, busiest first:
import collections, glob, json, os

calls = collections.Counter()
seen = set()
for path in glob.glob(os.path.expanduser("~/.claude/projects/**/*.jsonl"), recursive=True):
    for line in open(path, errors="replace"):
        if '"tool_use"' not in line:
            continue
        message = json.loads(line).get("message") or {}
        content = message.get("content")
        for block in content if isinstance(content, list) else []:
            if isinstance(block, dict) and block.get("type") == "tool_use" and block.get("id") not in seen:
                seen.add(block.get("id"))
                calls[block["name"]] += 1

for name, count in calls.most_common():
    if name.startswith("mcp__"):
        print(count, name)

It counts each call once, across every journal on disk. Compare the output with the list of servers you have connected, and disconnect the ones that are missing from it.

Sources


Vladimir Beskorovainyi, Enterprise AI Architect & CTO, author of the Amazon bestseller "Enterprise AI: The KATA Way", founder of Besk Tech (besk.tech)

來源:DEV Community · dev.to