{"slug": "what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them", "title": "What an MCP server's tool list costs: we counted the tokens of 34,374 of them", "summary": "The HISTOR project counted the token cost of tool lists across 34,374 MCP servers, finding a median of roughly 1,300 tokens per server but a mean three times higher, with the largest package list reaching 304,780 tokens — more than a 200,000-token context window. The team reported that the heaviest lists are driven by oversized individual tool definitions rather than tool count, and released a free counter that measures a pasted tools/list or a named server using the o200k_base tokenizer.", "body_md": "Under our survey of 12,915 MCP servers, a reader did the arithmetic we had not: 182,157 tool definitions over 7,656 servers is about 24 tools each, and a client resends every one of them with each model request. Count the tokens of a typical list, the comment said, and that becomes a cost.\n\nHISTOR, our public log of MCP servers, keeps the current tool list of every server it observes. So instead of one typical list we counted all of them: 18,204 npm and PyPI packages and 16,170 remote servers, as of 19 October 2026.\n\nA list is counted the way a client puts it into a model request: for each tool its `name`, `description` and `input_schema`, as compact JSON. The tokenizer is `o200k_base` (tiktoken 0.12). Every server with at least one tool counts once, with the list HISTOR last observed.\n\n|  | Packages | Remote servers | \n|---|---|---|\n| Servers | 18,204 | 16,170 | \n| Tool definitions | 337,449 | 232,427 | \n| Tools per server: median / mean | 8 / 18.5 | 7 / 14.4 | \n| **Tokens per server: median** | **1,272** | **1,328** | \n| mean | 3,812 | 3,412 | \n| 90th percentile | 8,361 | 7,425 | \n| 99th percentile | 39,612 | 22,294 | \n| largest | 304,780 | 547,935 | \n| Tokens per tool: median | 129 | 231 | \n| Servers over 10,000 tokens | 1,447 | 618 | \n| Servers over 100,000 tokens | 31 | 9 | \n\nThree things stand out.\n\n**The mean is three times the median.** A typical server is cheap. A few hundred servers with hundreds or thousands of tools carry most of the tokens. The \"about 24 tools\" from the survey was the mean over the packages that answered on 13 October; over today's larger set the mean is 18.5 and the median 8.\n\n**The heaviest lists are not the ones with the most tools.** The largest remote list is 547,935 tokens for 71 tools, about 7,700 tokens per tool. Another remote server lists 15 tools in 175,588 tokens. What makes a list heavy is the size of each definition more than the number of tools: at thousands of tokens per tool, a description or an input schema is a document of its own.\n\n**Some do not fit at all.** 304,780 tokens is more than a 200,000-token context window. A client that connects that package has no room left for the question.\n\nThe list rides along with every request, so its cost is tokens × price × requests. Per 1,000 requests at list prices on 19 October 2026:\n\n| One server's list | Tokens | $0.10 per million (a small model) | $2 per million (a mid-size model) | The mid-size model reading it from a prompt cache | \n|---|---|---|---|---|\n| median package | 1,272 | $0.13 | $2.54 | $0.13 | \n| mean package | 3,812 | $0.38 | $7.62 | $0.38 | \n| 90th percentile | 8,361 | $0.84 | $16.72 | $0.84 | \n| 99th percentile | 39,612 | $3.96 | $79.22 | $3.96 | \n\nA client with five median servers sends about 6,400 tokens of tool definitions before the user types a word.\n\n`action` argument. The median tool is 129 tokens in a package and 231 on a remote server; at 7,700 tokens per tool, something else is going on.\nWe put the counter on a free page: [modelmarket.dev/tools/tool-list-cost](https://modelmarket.dev/tools/tool-list-cost?utm_source=devto&utm_medium=article&utm_campaign=tool-list-cost). Paste a `tools/list`, or name a server HISTOR observes (an https endpoint, `npm:<package>`, `pypi:<package>` or a registry name). You get its tokens, where it sits among the 34,374, the money per 1,000 requests, the heaviest tools, and a line for your README:\n\n```\n![tool list](https://img.shields.io/endpoint?url=https%3A%2F%2Fmodelmarket.dev%2Ftools%2Fbadge%2Ftool-list-cost%3Fserver%3Dnpm%253Ayour-package)\n```\n\nThe page counts with the same tokenizer as the numbers above. We checked it against tiktoken on 120 of HISTOR's tool lists, 2.6 million tokens, with no difference. A pasted list is counted in memory and not kept; a lookup asks HISTOR and never contacts the server.\n\nThe method, in five languages, is [docs/tool-list-cost.md](https://github.com/alexar76/histor/blob/main/docs/tool-list-cost.md) in alexar76/histor, with the script that counted (`scripts/tool_list_tokens.py`, export query in its docstring) and the summary without server names (`docs/tool-list-tokens-2026-10-19.json`).\n\n*We build HISTOR and WARDEN. The numbers are a snapshot of 19 October 2026; the log keeps moving. No server is named here. Thanks to Paul Irolla for the question.*", "url": "https://wpnews.pro/news/what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them", "canonical_source": "https://dev.to/alexar76/what-an-mcp-servers-tool-list-costs-we-counted-the-tokens-of-34374-of-them-3011", "published_at": "2026-10-19 17:35:04+00:00", "updated_at": "2026-10-19 17:44:37.284888+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "large-language-models", "ai-infrastructure"], "entities": ["HISTOR", "Model Market", "alexar76/histor", "npm", "PyPI", "tiktoken"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them", "markdown": "https://wpnews.pro/news/what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them.md", "text": "https://wpnews.pro/news/what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them.txt", "jsonld": "https://wpnews.pro/news/what-an-mcp-server-s-tool-list-costs-we-counted-the-tokens-of-34374-of-them.jsonld"}}