Skip to content

deps: rmcp 3.x / MCP 2026-07-28 — the HTTP session gate is built on what becomes the legacy path #511

Description

@xxx

glass is on rmcp 2.2.0, whose ProtocolVersion::LATEST is 2025-11-25. rmcp
3.x is out and implements MCP 2026-07-28. That revision is mostly a rewrite of
the plumbing rather than a feature release, and one of its changes lands directly
on code glass owns.

What changes underneath

2026-07-28 removes protocol-level sessions: no Mcp-Session-Id header, no
initialize / notifications/initialized handshake (each request carries its
protocol version and client capabilities in _meta), a new mandatory
server/discover RPC, subscriptions/listen in place of the HTTP GET stream and
resources/subscribe, and no SSE resumability (Last-Event-ID). Every result
gains a required resultType discriminator.

crates/glass-mcp/src/serve/session_gate.rs — the single-live-session gate with
last-client-wins takeover — is built entirely on rmcp's LocalSessionManager,
SessionId and the Mcp-Session-Id header. In rmcp 3.x that path is renamed to
what it now is: with_stateful_mode() becomes with_legacy_session_mode(), and
requests negotiating 2026-07-28 are always stateless. The gate does not break —
the legacy path stays — but it stops being the main road, and a client that
speaks only 2026-07-28 gets no session id for the gate to key on. The takeover
semantics that make serve --http reconnect work need a different key (or need to
move out of the transport layer).

Note this is a transport-level concern only. glass's implicit session — one app
under control, tools targeting it without a handle argument — is server-side state
and is unaffected. Worth recording that the new spec explicitly steers servers the
other way (server-minted handles passed as ordinary tool arguments); glass's choice
is deliberate and costs an argument on every call to reverse.

Migration cost (from the rmcp 3.0.0 migration guide)

  • call_tool and friends return response enums instead of single result types;
    existing results convert with .into().
  • The unified Meta type splits into MetaObject / RequestMetaObject /
    NotificationMetaObject.
  • Protocol union enums become #[non_exhaustive] — exhaustive matches need a
    wildcard arm.
  • StreamableHttpService requires a ServerHandler rather than a generic
    Service<RoleServer>.
  • Snapshot tests must expect "resultType": "complete".
  • rmcp 3.x declares rust-version = "1.88". No blocker here — glass is on
    nightly-2026-06-01.

What the upgrade unlocks

  • Cache hints (ttlMs / cacheScope) on tools/list. glass's tool list is static
    per build, so a long TTL with cacheScope: "private" is an honest claim.
  • Multi-round-trip requests, the replacement shape for elicitation: a handler can
    return InputRequiredResult to ask the user something mid-call. Plausible fits
    are the macOS accessibility grant during onboarding and a confirmation before
    teardown kills an adopted window — both currently handled by returning text that
    asks the agent to ask. Client support is the open question and the wire shape
    just changed, so this is watch-not-build for now.

Non-actions worth recording

  • Roots, Sampling and Logging are all deprecated in 2026-07-28. glass uses none
    of them, so there is nothing to unwind.
  • glass already returns bad tool input as a tool-execution error rather than a
    protocol error, which is what 2025-11-25 asked for.
  • tools/list ordering is already deterministic: rmcp's ToolRouter stores routes
    in a HashMap, but list_all() sorts by name before returning, and the
    generated list_tools calls it. The 2026-07-28 SHOULD for deterministic order
    is satisfied as-is.

No urgency implied — 2025-11-25 remains negotiable and rmcp 2.2 already knows
2026-07-28 as a version constant. This is here so the session-gate coupling is
recorded before someone bumps the dependency and meets it by surprise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions