Plug for validating and extracting the MCP-Protocol-Version header.
This plug ensures that incoming HTTP requests carry a protocol version the server actually supports.
Behavior
- If no header is present, the configured default
(also returned by
ExMCP.protocol_version/0) is assumed - If an unsupported version is provided, returns 400 Bad Request
- Adds the validated version to conn.assigns[:mcp_version]
The supported list and default come from ExMCP's canonical internal version registry, so clients, server transports, and this plug cannot drift.
Usage
plug ExMCP.Plugs.ProtocolVersion