
Most MCP servers start the same way. You write eight or ten tools, connect Claude, and it works on the first try. Nothing in that first week tells you what the server will be like at 100 tools, or at 1,000.
What happens is that it gets worse in ways that are hard to see from the inside. Answers take longer and cost more, and every so often the model calls the wrong tool. The advice you find first is to put a search layer in front of everything. That is the right design for a server with 2,000 tools and a waste of effort for one with 40.
The right fix depends on how big the server is. This post follows one server as it grows, an invoicing app that starts with a handful of tools and ends with thousands. It covers what holds at every size first, then what to change at each one, with what the teams running the biggest servers report.
The tool list is what grows
When a client connects, it asks the server which tools it has. For every tool it gets back a name, a description and a schema for the inputs. In most clients all of that text goes into the model's context before the user has typed anything, and it is sent again with every request.

At ten tools nobody notices. At about 750 tokens a tool, 50 tools take a fifth of a 200,000 token window, 200 tools take three quarters of it, and 500 do not fit at all.
A long list costs more than tokens. The more tools a model has to choose from, the more often it picks the wrong one. When that tool only reads, the user sees something they did not ask for. When it writes, an invoice is created or a refund goes out that nobody asked for, and neither can be taken back.
So scaling is two jobs. One is keeping the list short. The other is making sure a wrong call cannot do damage. The safety work comes first here, because it is the same at 5 tools and at 5,000.
The MCP server holds no tools
The easy path is to write the tools inside the MCP server. It works until the product gets its own assistant, which needs the same tools and cannot reach them there. So they get written a second time in the backend. Two copies drift, and one day the same invoice comes to one total in the app and a different one in Claude.
The fix is to define each tool once, in the backend you already have, in one catalogue. The MCP server becomes a thin layer. It checks the login, asks the backend which tools exist and forwards each call.

That costs one extra hop, and it buys three things. A new tool reaches every client without a deploy of the MCP server. A tool does the same thing wherever it is called, so an invoice comes to the same total everywhere. And the MCP server has no business logic, no database and no service credential in it.
The last one matters for security. The user's token arrives at the MCP server, is checked there and is passed to the backend unchanged. The backend checks it again from scratch and never trusts the MCP server to say who the user is. That makes two independent checks on one credential, and nothing in the MCP server worth stealing.
Every tool says whether it can change things
A client has to decide when to ask the user for permission. If a server tells it nothing, MCP treats every tool as destructive, and a careful client asks before each call, lookups included. People who are asked about everything stop reading and click Allow.

The protocol has hints for this, and the server sets them per tool. A lookup such as find_client gets readOnlyHint: true, so it runs without a prompt. A write such as create_invoice gets destructiveHint: true and idempotentHint: false. The first makes a client ask before the call. The second stops it retrying a call that already went through.
These are hints, and a client is free to ignore them. They make the experience better. Safety comes from the next step.
A write never saves on the first call
Suppose the model misreads the user and builds an invoice for the wrong amount. No annotation catches that, because the call itself is allowed.

What catches it is a second call. The first call to a write tool saves nothing. It builds a preview for the user to read and returns a token with it. The token is a signature of the exact details, made with a secret that stays on the server:
SECRET = b"change-me" # a server-side secret, never sent to the model
def token_for(details: dict) -> str:
payload = json.dumps(details, sort_keys=True).encode()
return hmac.new(SECRET, payload, hashlib.sha256).hexdigest()[:16]
@mcp.tool(annotations=WRITE)
def create_invoice(client_id: str, amount: float, confirm_token: Optional[str] = None) -> dict:
"""Call once to get a preview and a confirm_token. Call again with the same details plus the token to save."""
details = {"client_id": client_id, "amount": amount}
if confirm_token != token_for(details):
return {"status": "preview", "preview": f"Invoice for {client_id}: {amount:,.2f}",
"confirm_token": token_for(details)}
return {"status": "saved", "invoice_id": save_invoice(details)}
The save call sends the same details again, with the token. If the model changes the amount after the user said yes, the signature no longer matches and the call turns back into a preview.
The server also has nothing to remember between the two calls. Every call starts from an empty state, which matters once you run more than one copy of the server. The protocol has gone the same way: the 2026-07-28 MCP specification removed sessions.
An error tells the model what to fix
Models make small mistakes with arguments all the time. They send text where a number was expected, or misspell a field. What they do next depends on what comes back. A thrown error reaches the model as a transport failure, and a bare "invalid input" gives it nothing to go on, so it usually sends the same call again.

The fix is to check every call against the tool's schema before the tool runs, and to answer with one line per problem. A call that sends order_id as a number and misspells amount comes back with three lines: the type that was expected, the field that is missing, and the field the tool does not take.
The model reads those lines and repairs the call on its next try. The user is asked only when there is a real choice to make, such as a value outside a fixed list. The MCP specification asks for the same thing, errors that "contain actionable feedback".
The tool list is fetched once every five minutes
The MCP server gets the tool list from the backend, and that list only changes when the backend is deployed. Fetching it on every connection is a backend call that almost never learns anything. It also ties the two services together: if the backend is down at that moment, the user sees a connector with nothing in it.
So the list is held in memory for a few minutes:
TTL = 300 # seconds
_cached = None # (tools, fetched_at)
def tools(now=time.time):
global _cached
if _cached and now() - _cached[1] < TTL:
return _cached[0]
try:
_cached = (fetch_tools_from_backend(), now())
except Exception:
if not _cached:
raise # nothing to fall back on
return _cached[0] # fresh, or a few minutes stale
The branch to notice is the failure one. A refresh that fails serves the previous list, because a list that is five minutes stale still works and an empty one makes the whole connector look broken. The price is that a new tool can take five minutes to appear.
Return the tools in the same order every time as well. Model providers cache tool definitions, and on the Claude API changing any of them "invalidates the entire cache". The 2026-07-28 specification adds a ttlMs hint to list results, so a client can hold the list too.
What to change as the list grows
Everything above holds at any size. What follows depends on how many tools you have.
Under 50 tools, shrink what each tool costs
Say the invoicing server has reached about 40 tools. The list is short enough to send whole, so the work is to cut what each tool costs. Start with the schemas. Frameworks generate them from function signatures and pad them with things the model has no use for: a title that repeats the input's name, a default: null, and an anyOf wrapper around every optional input.
NAMED = ("properties", "$defs") # their keys are input names, never schema words
def slim(node):
if isinstance(node, list):
return [slim(v) for v in node]
if not isinstance(node, dict):
return node
out = {}
for key, value in node.items():
if key == "title" or (key == "default" and value is None):
continue
out[key] = ({name: slim(v) for name, v in value.items()}
if key in NAMED and isinstance(value, dict) else slim(value))
options = [o for o in out.get("anyOf", []) if o != {"type": "null"}]
if "anyOf" in out and len(options) == 1:
del out["anyOf"]
out = {**options[0], **out}
return out
On three sample tools this took the schemas from 982 characters to 457, a little under half, and that saving is repeated on every model call.
Then look at the list itself. Most servers that feel too big have one tool per API endpoint, and many of those are the same action pointed at different things. Block did this to its Linear server and went from more than 30 tools to 2 (source). The one rule is to keep a tool separate when its risk is different. Looking up an invoice and refunding one should not share a tool.
Past 50 tools, load them in groups
Past about 50 tools, merging runs out. The server now covers invoices, clients, payments and reports, and nobody uses all of it at once. A support agent needs two of those four areas.
So every tool goes in a group, and only the groups a user needs are loaded. Tools that are not loaded cost nothing and cannot be called by mistake. GitHub's MCP server works this way, with toolsets and a read-only switch (source).
Choose the groups when the server is set up, or from what the user is allowed to do. Do not let the model switch groups on in the middle of a conversation. The current specification rules that out: the tool list "MUST NOT vary per-connection".
Past 200 tools, put search in front
At a few hundred tools even one group is too long. This is where the search layer makes sense. The model stops seeing your tools. It sees three or four fixed ones that search the catalogue, describe one tool and call it, and everything else stays on the server.

Block's Square server puts more than 200 API endpoints behind 3 tools this way (source). Cloudflare's API has over 2,500 endpoints, and its server exposes two tools, search() and execute(). Cloudflare says an equivalent plain server "would consume 1.17 million tokens", against "around 1,000 tokens" for this one (source).
A gateway has costs, and they are the reason to wait this long. Every action takes two or three calls where it used to take one. Speakeasy measured 2 to 3 times more tool calls with its own gateway (source). The client can no longer check arguments, because all it sees is a generic call tool, so the server has to, and the clear errors from earlier stop being optional. A single call tool would also hide the difference between a lookup and a refund, so keep a read version and a write version.
Measure before you build
You do not have to guess which size you are. Connect your server in Claude Code and run /context. It shows how many tokens your tools take, and the MCP docs suggest keeping that within 1% to 5% of the model's context window (source).
If you are inside that range, the base is all you need: tools in the backend, reads and writes marked, saves in two calls, errors the model can act on, and a cached list. If you are over it, take the one step for your size and measure again.