Summary
MCP revision 2026-07-28
is live and makes the protocol stateless: protocol-level sessions and the initialize handshake
are gone. Anvil implements its own MCP client and currently speaks 2025-11-25, so it needs an
explicit compatibility migration.
This is the Anvil counterpart to BrokkAi/mjolnir#521. Mjolnir is moving its MCP servers forward;
Anvil must be able to connect to those servers without breaking configured servers that still use
older revisions.
Where we are today
src/mcp.rs:19 hard-codes:
const PROTOCOL_VERSION: &str = "2025-11-25";
All three client transports use the old lifecycle:
- stdio sends
initialize, then notifications/initialized, then tools/list
(src/mcp.rs:666-689)
- Streamable HTTP does the same and stores
Mcp-Session-Id
(src/mcp.rs:735-779)
- legacy HTTP+SSE opens a GET event stream, waits for an
endpoint event, then performs the same
handshake (src/mcp.rs:785-850)
The HTTP request path sends and captures Mcp-Session-Id (src/mcp.rs:1351-1397). A 404 is
treated as an expired session and triggers a fresh initialize plus one retry
(src/mcp.rs:976-1010, src/mcp.rs:1478-1524).
Anvil does not use rmcp; this is a migration of our custom client implementation, not a
dependency bump.
What the new revision changes for us
- Sessions are gone.
Mcp-Session-Id is removed from Streamable HTTP. The
HttpSessionNotFound error path, stored HTTP session ID, and reinitialize-on-404 workaround
become legacy-only behavior.
- No
initialize/notifications/initialized handshake. Each request carries protocol
version and client capabilities in _meta
(io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities).
server/discover is mandatory. Use it to discover supported versions, capabilities, and
server identity before selecting the request format.
- Streamable HTTP POSTs require
Mcp-Method and Mcp-Name. Our request and notification
helpers need to set them consistently.
- All results carry
resultType (complete or input_required). Multi-round-trip requests
replace server-initiated requests.
- List/read results are cacheable. Parse
ttlMs and cacheScope on tools/list and decide
whether/how Anvil should cache or refresh tool definitions.
- GET and
resources/subscribe are replaced by subscriptions/listen. SSE resumability is
removed; interrupted requests must be re-issued. The configured legacy sse transport remains
useful only for older servers.
- Removed methods and renumbered errors.
ping, logging/setLevel, and
notifications/roots/list_changed are removed; protocol errors now include the new header,
capability, and version codes.
Main risk: mixed-version servers
Anvil connects to both its bundled Bifrost server and arbitrary user-configured MCP servers. They
will not all adopt 2026-07-28 at once. The client needs version-aware behavior rather than a
hard cutover:
- discover and use
2026-07-28 where supported
- preserve the current initialize/session flow for older servers
- produce a clear error when no mutually supported revision exists
- keep stdio, Streamable HTTP, and legacy SSE compatibility explicit and tested
The bundled Bifrost version and its supported MCP revisions should be checked as part of this work.
Work
Notes
The exact wire details should be verified against the final 2026-07-28 specification during
implementation. This issue intentionally describes Anvil's current client surface and the required
compatibility outcome; it does not assume an MCP SDK migration.
Summary
MCP revision
2026-07-28is live and makes the protocol stateless: protocol-level sessions and the
initializehandshakeare gone. Anvil implements its own MCP client and currently speaks
2025-11-25, so it needs anexplicit compatibility migration.
This is the Anvil counterpart to BrokkAi/mjolnir#521. Mjolnir is moving its MCP servers forward;
Anvil must be able to connect to those servers without breaking configured servers that still use
older revisions.
Where we are today
src/mcp.rs:19hard-codes:All three client transports use the old lifecycle:
initialize, thennotifications/initialized, thentools/list(
src/mcp.rs:666-689)Mcp-Session-Id(
src/mcp.rs:735-779)endpointevent, then performs the samehandshake (
src/mcp.rs:785-850)The HTTP request path sends and captures
Mcp-Session-Id(src/mcp.rs:1351-1397). A 404 istreated as an expired session and triggers a fresh
initializeplus one retry(
src/mcp.rs:976-1010,src/mcp.rs:1478-1524).Anvil does not use
rmcp; this is a migration of our custom client implementation, not adependency bump.
What the new revision changes for us
Mcp-Session-Idis removed from Streamable HTTP. TheHttpSessionNotFounderror path, stored HTTP session ID, and reinitialize-on-404 workaroundbecome legacy-only behavior.
initialize/notifications/initializedhandshake. Each request carries protocolversion and client capabilities in
_meta(
io.modelcontextprotocol/protocolVersion,io.modelcontextprotocol/clientCapabilities).server/discoveris mandatory. Use it to discover supported versions, capabilities, andserver identity before selecting the request format.
Mcp-MethodandMcp-Name. Our request and notificationhelpers need to set them consistently.
resultType(completeorinput_required). Multi-round-trip requestsreplace server-initiated requests.
ttlMsandcacheScopeontools/listand decidewhether/how Anvil should cache or refresh tool definitions.
resources/subscribeare replaced bysubscriptions/listen. SSE resumability isremoved; interrupted requests must be re-issued. The configured legacy
ssetransport remainsuseful only for older servers.
ping,logging/setLevel, andnotifications/roots/list_changedare removed; protocol errors now include the new header,capability, and version codes.
Main risk: mixed-version servers
Anvil connects to both its bundled Bifrost server and arbitrary user-configured MCP servers. They
will not all adopt
2026-07-28at once. The client needs version-aware behavior rather than ahard cutover:
2026-07-28where supportedThe bundled Bifrost version and its supported MCP revisions should be checked as part of this work.
Work
server/discoverand version selection for MCP connections.2026-07-28per-request_metafields and required HTTP headers.Mcp-Session-Id, and 404 reinitialization legacy-version-only.2026-07-28does not send the removed handshake.resultType; supportinput_required/multi-round-trip behavior.tools/listand define refresh semantics.request.
older MCP server.
_meta, fallback, andunsupported-version errors.
cargo testandcargo clippy --all-targets -- -D warnings.Notes
The exact wire details should be verified against the final
2026-07-28specification duringimplementation. This issue intentionally describes Anvil's current client surface and the required
compatibility outcome; it does not assume an MCP SDK migration.