stateless stdio MCP server anatomy
client process
each request includes
protocolVersion
clientCapabilities
clientInfo (SHOULD)
stdio transport
one JSON object per line
EOF ends process lifetime
no protocol session
no initialize gate
no remembered capabilities
server process
parse -> validate current _meta -> route
unsupported version returns -32022 with requested and supported
tools
list, search, create
deterministic list
resources
list and read
private cache scope
prompts
list and get
stable templates
complete response wrapper
resultType: complete
_meta.io.modelcontextprotocol/serverInfo
cacheable results also include ttlMs + cacheScope
server/discover is a mandatory handler
A dual-era deployment keeps any legacy initialize adapter separate from this modern path.