Wymcp.ProtocolVersion (Wymcp v0.8.7)

View Source

Single source of truth for MCP protocol version support.

wymcp speaks the modern era of MCP only — exactly 2026-07-28, with its per-request protocol fields, no negotiation and no sessions. Every earlier revision is answered -32022 by Wymcp.Plugs.ProtocolFields, naming this one. This module also owns the two protocol-field names — protocol_version_field/0 and client_capabilities_field/0 — so Wymcp.Plugs.ProtocolFields and Wymcp.Plugs.HeaderBinding read one copy of each wire literal.

Summary

Functions

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

The params._meta key carrying the protocol version (protocol fields).

Every version wymcp serves — the list server/discover advertises as supportedVersions and the -32022 error carries as data.supported.

Functions

client_capabilities_field()

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

Examples

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

protocol_version_field()

The params._meta key carrying the protocol version (protocol fields).

Both plugs that traffic in the protocol fields read this accessor: Wymcp.Plugs.ProtocolFields enforces the value, and Wymcp.Plugs.HeaderBinding compares the enforced value against the MCP-Protocol-Version header that mirrors it. 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 refuse a compliant client instead of failing loudly.

Examples

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

supported?(version)

supported_versions()

Every version wymcp serves — the list server/discover advertises as supportedVersions and the -32022 error carries as data.supported.

Examples

iex> Wymcp.ProtocolVersion.supported_versions()
["2026-07-28"]