Either a ready-made McpServer instance or a factory called
once per connection. A factory is what serves both protocol eras from the same definitions;
an instance is served through a factory that always returns it.
Optionaloptions: { logger?: Logger }
Set up stdio transport for MCP server: connects the server to stdin/stdout for local CLI usage.
serveStdioowns the era decision for the connection - the opening exchange (aninitializerequest pins 2025-era, aserver/discoverprobe pins 2026-07-28) selects which instance fromfactoryserves the connection's lifetime. Never passlegacy: 'reject'here: dropping 2025-era stdio clients (Claude Desktop, Claude Code) is not this package's call.