MCP servers
Build MCP servers to the 2026-07-28 specification. No sessions, metadata documents for clients, checked headers, small tool lists, cache hints and tasks.
- Required 2
- Recommended 6
- Optional 1
Required
Check the caller's rights on every handle
AGT-12A handle that one tool returns and another accepts names data, it does not grant access. Check on every call that the caller's token may use it.
Reject MCP requests whose headers disagree with the body
AGT-14Require
MCP-Protocol-Version,Mcp-Methodand, on tool calls, resource reads and prompt requests,Mcp-Name. Refuse any request whose headers differ from its JSON body.
Recommended
Build the MCP server without sessions
AGT-11Answer every MCP request from that request alone. Read the protocol version and client capabilities from its
_meta, and keep state across calls only behind handles passed as tool arguments.Register MCP clients with Client ID Metadata Documents
AGT-13Let MCP clients you have never met use an HTTPS address as their client ID. Fetch the metadata document there and check it, instead of open dynamic registration.
Keep the tool list within a token budget
AGT-15Set a token budget for the whole
tools/listanswer and fail the build when it grows past it. Each tool's description says when to use it and when not to.Report bad arguments as tool results instead of protocol errors
AGT-16Return bad arguments, missing records and business rule failures as a tool result with
isError: true. Keep JSON-RPC errors for unknown tools, malformed requests and server faults.Send cache hints and a stable order with every list
AGT-17Return list results in the same order while the set is unchanged. Give each cacheable result a
ttlMs, and acacheScopeofprivatewhenever it depends on who asks.Sign the state you hand back for a second round
AGT-18When a tool needs more input, return an
input_requiredresult. Sign anyrequestStateyou include, and check the signature on the retry.
Optional
Run long work as tasks
AGT-19When a tool call takes longer than 30 seconds, return a task handle through the MCP Tasks extension. Return it only to clients that declared the extension.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/agents-as-users/mcp-servers">Agent Wranglers agents as users playbook</a>. In code you write, add a comment next to it with the same link.