ExMCP.Plugs.ProtocolVersion (ex_mcp v0.9.2)
View SourcePlug for validating and extracting the MCP-Protocol-Version header.
This plug ensures that incoming HTTP requests include a valid protocol version header as required by the MCP 2025-06-18 specification.
Behavior
- If no header is present, defaults to "2025-06-18" (per spec)
- If an unsupported version is provided, returns 400 Bad Request
- Adds the validated version to conn.assigns[:mcp_version]
Usage
plug ExMCP.Plugs.ProtocolVersion