What you are designing
An MCP interface is the set of things your application offers to an AI model, described clearly enough that the model can use them without a human explaining.
The Model Context Protocol (MCP) is an open standard for connecting AI applications to outside systems. Three roles are involved. The host is the AI app a person uses, such as Claude or an IDE assistant. The host runs a client that speaks the protocol. Your application exposes a server, which is the part you design.
Think of it as a user interface whose user is a language model. A person reads labels and layouts. A model reads names, descriptions and schemas. If those are vague, the model picks the wrong tool or fills arguments badly, the same way a person misuses a confusing screen.
The three things a server can offer
Tools
Functions the model can call: search, create, send, update. Each has a name, a description and a typed input schema.
Use for actions and lookups the model chooses during a task.
Resources
Read-only data addressed by a URI, such as a file, a record or a reference table. The host attaches it as context.
Use for reference material a user or host picks.
Prompts
Reusable templates the user invokes by name, often as a slash command, with a few arguments.
Use for repeatable workflows a person starts on purpose.
Check yourself: which primitive fits?
Email invoice #1042 to the customer.
The company's chart of accounts, attached as background for a conversation.
A “month-end close review” routine the user starts from a menu, giving a month.
How to define it
Start from the jobs people want done, then work down to names, descriptions and schemas. Do not start from your API endpoints.
- List the workflows. Write five to ten sentences a real user would say to an assistant. “Find overdue invoices for Acme and send a reminder.”
- Walk each workflow. Note every piece of data the model must read and every action it must take. Those become candidate capabilities.
- Merge and trim. Combine steps that always go together into one tool. Drop anything no workflow needs.
- Pick the primitive for each: tool, resource or prompt.
- Write the contract for each tool: name, description, inputs, outputs, errors and behaviour hints.
- Test with a model. Run the workflow sentences against the server and read the transcripts. Fix what the model misreads.
Anatomy of a tool
Select any underlined part to see what it is for.
{
: "search_invoices",
: "Search invoices",
: "Find invoices by customer, status or
date range. Use this first when the user refers to
an invoice without giving its ID. Returns up to
`limit` matches, newest first.",
: {
"type": "object",
"properties": {
"customer_name": { "type": "string",
: "Full or partial name" },
"status": { "type": "string",
: ["draft", "sent", "overdue", "paid"] },
"limit": { "type": "integer", : 20,
"maximum": 50 }
},
: []
},
: { "type": "object", ... },
: {
"readOnlyHint": true,
"openWorldHint": false
}
}
name
What comes back
A tool result carries content (text the model reads) and, when you declare an outputSchema, a matching structuredContent object. Send both so older clients still work.
There are two kinds of failure. A protocol error means the request itself was wrong, for example an unknown tool name. A tool execution error means the tool ran and failed, for example “customer not found”. Return those as a normal result with isError: true and a message that says what to try next, because the model can read it and recover.
The model calls send_invoice with an invoice that is still a draft. What should the server do?
Constraints to design around
Each constraint below changes a design decision. The line at the bottom of each card says which one.
The model's context is small and shared
Every tool definition is sent to the model on each turn, and every result is added to the conversation. Both spend the same budget as the user's actual task.
So: fewer tools, tight descriptions, filtered and paginated results.
The protocol is stateless
Since revision 2026-07-28 there is no handshake and no session. Any request can reach any server instance.
So: never rely on “the previous call”. If a flow needs state, return a handle and take it back as an argument.
The caller is not fully trusted
The model can be steered by text it reads, including data your own tools return. Arguments can be wrong or hostile.
So: validate every input, check permissions on every call from the access token, and never from an argument.
Auth is the user's, scoped down
Remote servers use OAuth. The server acts for one signed-in user and must respect that user's permissions and tenant.
So: decide scopes early, split read from write, and keep tenants isolated in every query.
Some actions cannot be undone
Hosts decide whether to ask the user before a call, partly from your annotations. Annotations are hints, so the server must still be safe without them.
So: mark read-only and destructive tools honestly, prefer drafts and soft deletes, and make writes safe to retry.
Clients differ
Hosts vary in which features they support, how long they wait and how much output they accept.
So: make tools carry the value, keep results well under a few thousand tokens, and avoid depending on optional features.
Transport shapes deployment
stdio runs the server as a local process on the user's machine. Streamable HTTP runs it as a remote service. The older HTTP+SSE transport is deprecated.
So: a SaaS product wants Streamable HTTP with OAuth. A developer tool on local files wants stdio.
Slow work needs a different shape
A tool call is one request and one response. Work that takes minutes does not fit, and the Tasks extension exists for it.
So: keep calls fast, or split into start and check tools that pass a job handle, or adopt Tasks if your clients support it.
The interface is a contract
Hosts cache tool lists, and people build habits and automations on tool names.
So: add optional parameters freely, but treat renames and removals as breaking changes with notice.
See the context budget move
A rough model using about four characters per token. Definitions are paid on every turn. Results pile up across a task.
A wizard needs three calls: pick a client, pick a period, confirm. How should the server remember the choices between calls?
Best practices
Ten habits, each with a before and after. The workbook checks most of them for you.
1. Design for workflows, not endpoints
One tool that completes a job beats three that mirror your REST routes.
get_customer, list_invoices, get_invoice_lines called in sequence for every question.search_invoices that accepts a customer name and returns the fields people ask about.2. Name tools verb_noun, consistently
Use letters, digits, underscores, hyphens or dots, and stay under 64 characters because some clients are strict. Pick one style for the whole server.
get, deleteAppt, invoice-makerget_invoice, cancel_appointment, create_invoice_draft3. Write descriptions like onboarding notes
Say what it does, when to use it, when not to, and what comes back. Two to four sentences.
limit matches, newest first.”4. Make inputs hard to get wrong
Describe every parameter. Use enums for fixed choices, defaults for the common case, and as few required fields as possible. Accept names where people use names, and resolve them yourself.
5. Return less, and make it meaningful
Give the fields the workflows need, with human-readable names beside IDs. Paginate with a limit and a cursor. Say when results were cut off.
6. Turn errors into directions
7. Label behaviour honestly
Set readOnlyHint on lookups. Set destructiveHint on anything that deletes or overwrites. Set idempotentHint when repeating the call changes nothing more. Set openWorldHint to false when the tool only touches your own system.
8. Keep risky actions two-step
Create a draft, then send. Preview, then apply. The model, the host and the user each get a chance to stop a mistake.
9. Keep the surface small
Start with the five to fifteen tools your workflows need. A model choosing among sixty similar tools chooses worse and pays for all sixty on every turn.
10. Evaluate with real prompts
Keep your workflow sentences as a test set. Run them after every change and read what the model did. Most fixes are edits to descriptions.
Check yourself
Which description will a model use best?
Your API has 48 endpoints. What is the best first version of the server?
Further reading
- MCP specification, revision 2026-07-28, the authoritative reference
- Release notes for 2026-07-28, on the stateless redesign and extensions
- Writing effective tools for agents, Anthropic's guide to descriptions and evaluation
- Block's playbook for designing MCP servers, lessons from more than 60 servers
- MCP Inspector, the tool for trying a server by hand
Practice project: rescue the clinic server
Paws & Claws, a small vet clinic, shipped an MCP server by wrapping its database API. The assistant keeps booking the wrong pets. Your job is to fix the interface.
The broken design has five tools with vague names, thin descriptions, a free-form data object, a list with no limit and a delete with no warning. Load it into the workbook and the review panel will list every problem.
Your brief
- Receptionists say three things most: “When is Biscuit's next visit?”, “Book Luna in with Dr Okafor on Thursday afternoon”, and “Cancel Max's appointment tomorrow”.
- Redesign the tools so each sentence takes one or two calls.
- Get the review panel to zero issues with the definitions under 1,500 tokens.
- Open the spec and read it as if you were the coding agent. Would you know what to build?
find_patient, find_open_slots, book_appointment and cancel_appointment. Each accepts names where a receptionist would use names.Then do it for your own application
Clear the workbook, write your workflow sentences first, and only then add tools. If you already have an API, keep its documentation closed until the workflows are written.
Design workbook
Fill this in from top to bottom. The review panel updates as you type, and step 7 turns it into a spec.
Spec for your coding agent
Built from the workbook. Paste it into Claude Code or another coding agent as the task brief.