Wymcp.ProtocolVersion (Wymcp v0.1.1)

View Source

Single source of truth for MCP protocol version support.

The legacy era (docs/glossary.md, era) accepts exactly one revision: 2025-11-25. The 2025-03-26 and 2025-06-18 revisions were dropped pre-1.0 — every observed real client requests 2025-11-25, and with one revision there is nothing left to gate per feature (the supports_*? predicates and strip_* helpers this module used to carry are gone with them). The split-endpoint 2024-11-05 revision remains intentionally unsupported: it predates the Streamable HTTP transport — accepting the version string would let initialize succeed while every subsequent request misbehaves. The modern era serves exactly 2026-07-28 (per-request protocol fields — no negotiation, no sessions). This module also owns the two modern protocol-field namesprotocol_version_field/0 and client_capabilities_field/0 — so Wymcp.Plugs.Era and Wymcp.Plugs.ProtocolFields read one copy of each wire literal.

Counter-proposal

When the client requests an unsupported version, the spec requires the server to respond with a version it does support (echoing back the same InitializeResult shape — not a JSON-RPC error). This module does not implement that policy; Wymcp.Methods.Initialize does. latest/0 exists so that call site has a single canonical fallback.

Summary

Functions

The params._meta key carrying the modern era's client capabilities — the sibling of protocol_version_field/0, which carries the rationale.

The params._meta key carrying the modern era's protocol version (docs/glossary.md, protocol fields).

Every version either era serves, modern first — the list server/discover advertises as supportedVersions and the -32022 error carries as data.supported, so a version-rejected client can see its legacy fall-back option in the same answer.

Functions

client_capabilities_field()

The params._meta key carrying the modern era's client capabilities — the sibling of protocol_version_field/0, which carries the rationale.

Examples

iex> Wymcp.ProtocolVersion.client_capabilities_field()
"io.modelcontextprotocol/clientCapabilities"

latest()

modern_supported?(version)

protocol_version_field()

The params._meta key carrying the modern era's protocol version (docs/glossary.md, protocol fields).

Both plugs that traffic in the protocol fields read this accessor: Wymcp.Plugs.Era classifies on the key's presence, Wymcp.Plugs.ProtocolFields enforces the value. The literal lives here rather than in either plug so the reverse-DNS string is typed once — a drift between two hand-typed copies would mis-route a compliant client onto the wrong lane instead of failing loudly.

Examples

iex> Wymcp.ProtocolVersion.protocol_version_field()
"io.modelcontextprotocol/protocolVersion"

supported()

supported?(version)

supported_versions()

Every version either era serves, modern first — the list server/discover advertises as supportedVersions and the -32022 error carries as data.supported, so a version-rejected client can see its legacy fall-back option in the same answer.

Examples

iex> Wymcp.ProtocolVersion.supported_versions()
["2026-07-28", "2025-11-25"]