MCP server design: an API whose client is a model

A trace waterfall of one request: ingest, plan, tools/MCP, workers, persist.

I have built three MCP servers: a public and an admin server with 50+ tools between them for an AI-visibility platform, and one over a content conveyor. The protocol was never the hard part. Good MCP server design is the design of an API whose client is a model – a client that picks endpoints by reading their documentation literally, retries creatively and can’t be trusted to enforce anything you tell it.

Once you see it that way, most decisions follow.

The description is the contract

A human developer reads your API docs once and then learns from the code. A model reads the tool’s name and description on every decision and very little else. A vague description isn’t a documentation bug; it comes back as wrong calls in production.

So each tool gets one job, and the description says what it does, what it needs and what it returns:

export const getRun = {
  name: 'get_run',
  description:
    'Fetch one agent run by id: status, steps with inputs and outputs, and the trace id. ' +
    'Use list_runs to find ids. Read-only.',
  inputSchema: {
    type: 'object',
    properties: { id: { type: 'string', description: 'Run id, e.g. run_01J…' } },
    required: ['id'],
    additionalProperties: false,
  },
  annotations: { readOnlyHint: true },
};

Two tests I apply to every description. If it needs ‘or’, it is probably two tools. And if a model would need to call the tool once just to find out what it returns, the description is missing a sentence.

Fewer tools per client beats more tools per server

The visibility platform has 50+ tools, and I split them across two servers rather than ship one. The public server carries what a customer’s assistant needs; the admin server carries operations, with stricter access. Each client sees a shorter list, so the model has fewer near-duplicates to confuse, and the access boundary is the server boundary instead of a flag on each tool.

The cost is a second server to deploy and version. It is worth it once the list is long enough that you catch the model choosing between two tools that only a human would know apart.

Errors are part of the interface

The MCP tools specification separates protocol errors – an unknown tool, malformed arguments – from tool execution errors, which come back inside the result with isError: true. The distinction matters because the model sees the second kind and can act on it.

That makes error text a prompt. Error 404 teaches the model nothing. No run with id run_01J…; list_runs returns the 20 most recent ids gives it a next step. I write execution errors the way I would write them for a junior engineer on call: what failed, why, and which tool to try instead.

Annotations are hints, not enforcement

The spec gives you labels for intent: readOnlyHint for tools that change nothing, destructiveHint for ones that may. It also says there should always be a person able to deny a tool call, and that clients should confirm sensitive operations. I use both labels on every tool – they help a well-behaved client ask the right question at the right time.

But the schema reference is explicit that annotations are hints and that clients must treat them as untrusted unless they come from a trusted server. The same applies in reverse: your server can’t assume the client honoured them. A destructiveHint doesn’t stop a cancel_run that arrives without a confirmation. Only the service can.

One implementation of the logic

The mistake I see most often is a second copy of the product inside the server: business rules, validation and a database connection of its own. It works on day one and drifts by month two.

The rule I hold to is a thin proxy over the real service – the same endpoints, the same durable runs, the same auth and cost ceiling. On the visibility platform both servers call the platform’s API. The content conveyor has three surfaces – a web cabinet, the MCP server and a WordPress plugin – and all three drive the same engine. The specification puts input validation, access control and rate limiting on the server; a thin proxy meets that by forwarding to an API that already does all three, with no back door around it.

There is a useful side effect. When the MCP server can’t do something because the API doesn’t expose it, the fix goes into the API, and every other client gets it too.

Long work returns a handle

Agent runs take minutes, and a tool call that blocks for minutes is a tool call the client will time out and retry. So a tool that starts work returns a run id straight away; get_run reports progress and cancel_run stops it. With a thin proxy this comes for free: the API already puts the run on a queue and returns its id, so the tool does the same. It is the queue in front of the agents, for the same reason – see multi-agent pipeline architecture – and a keyed start makes a retried call harmless.

Where the thin proxy is wrong

When the model needs a view the API doesn’t have – say, a summary across many runs – it is tempting to assemble it in the server from several calls. I don’t, except as a stopgap. That view is a product feature, it belongs in the API with its own tests, and an MCP server that quietly computes things is where the second copy of the product starts.

The protocol is small by design. The work is exposing a system you already run, honestly, to a client that believes every word you write.