Part 9 of 14 · 1 min read
How to build it so it holds up
Rules for an MCP host, each with the reason it matters.
- One client per server, owned by the host, because a client that talked to two servers would be exactly the "server can see into another server" failure the specification rules out.
- Never put the whole conversation into a tool argument, because a server only sees what you hand it, and the moment you hand it everything you have broken the isolation the architecture gives you for free.
- Prefix tool names with the server id, because names are unique only within one server, and two servers offering the same name will otherwise collide.
- Convert tools to ordinary function schemas before showing the model, because the model should never need to know it is talking to MCP at all, only to a function list.
- Treat descriptions, annotations and results from servers as untrusted, because they are text written by someone else's code, and the hint-trust experiment shows exactly what believing them costs.
- Ask a person only for the irreversible or costly, because that is the only place a person adds anything a scope, cap or quota check could not already provide in code.
- Support both protocol eras in a client, because a legacy-only client simply cannot talk to a modern-only server, and the reverse is just as true.
- Return tool errors the model can act on, and keep protocol errors for protocol problems, because only one of the two kinds of error is something the model is in a position to fix.
- Use explicit handles for state, checked against the caller, because a stateless protocol has nowhere else to keep a shopping basket or a reading list.