Repository navigation
Description
Summary
Add first-class server support for MCP protocol version 2026-07-28 through a new McpProtocol.v2026_07_28 adapter.
Unlike v2025-11-25, this is a new protocol era rather than an incremental schema revision. It replaces the initialization/session lifecycle with stateless, per-request negotiation and changes how discovery, reverse interaction, notifications, and Streamable HTTP routing work.
The existing adapters must retain their current session-based behavior.
Protocol changes
Stateless requests
2026-07-28 removes:
initializeandnotifications/initialized- protocol-managed sessions
Mcp-Session-Id
Each request instead carries its protocol version, client capabilities, and optional client identity in _meta. The selected adapter must therefore be resolved from the raw request before its dated payload is decoded.
Streamable HTTP also mirrors routing information through headers such as MCP-Protocol-Version, Mcp-Method, and Mcp-Name. Header/body mismatches return HTTP 400 with MCP error -32020.
Discovery and results
Servers must implement server/discover, advertising:
- supported protocol versions
- server capabilities
- optional instructions
- cache metadata
Every successful modern result includes a resultType. Completed results use "complete"; operations requiring client input return "input_required" with keyed input requests and optional opaque requestState.
Server identity is carried in result _meta.
Multi-round-trip requests
General server-to-client JSON-RPC requests are removed. Elicitation, sampling, and roots interaction now use an InputRequiredResult. The client fulfils those requests and retries the original operation with inputResponses and the byte-exact requestState.
This requires a canonical result boundary that can represent either:
- a completed tool, resource, or prompt result; or
- an input-required result.
The dated adapter owns the corresponding wire projection. Direct McpReverseClient operations must report that they are unsupported for modern requests.
Subscriptions
Unsolicited list-change and resource-update notifications are replaced by subscriptions/listen.
Modern notifications must only be sent through an active subscription and must include the corresponding subscription identifier. Legacy adapters retain their existing session-oriented notification behavior.
Schema differences
The new dated schema must cover:
- required request metadata and result discrimination
server/discover- multi-round-trip request and result types
subscriptions/listen- cache metadata
- modern errors
-32020,-32021, and-32022 - full JSON Schema 2020-12 tool schemas
- unrestricted tool output schemas and structured content
-32602for missing resources
Required architecture changes
The existing ProtocolAdapter boundary already owns dated RPC groups, codecs, projections, error mapping, and cancellation normalization. The surrounding runtime still assumes every client has completed initialization and owns a session.
Introduce an adapter-owned lifecycle strategy supporting:
- legacy initialize-and-pin selection;
- modern per-request selection;
- request metadata and HTTP header validation;
- session requirements;
- request-scoped client context;
- result-envelope projection;
- transport-specific cancellation; and
- subscription delivery.
Modern requests must not synthesize an initialization payload or consult the legacy session maps.
flowchart TD
A["Incoming request"] --> B["Inspect raw envelope"]
B --> C{"Protocol era"}
C -->|"initialize"| D["Select legacy adapter"]
D --> E["Decode initialize"]
E --> F["Create and pin session"]
F --> G["Decode later requests with pinned adapter"]
C -->|"version in request _meta"| H["Select 2026-07-28 adapter"]
H --> I["Validate body and HTTP headers"]
I --> J["Create request-scoped profile"]
G --> K["Invoke McpCore"]
J --> K
K --> L{"Canonical result"}
L -->|"Complete"| M["Encode resultType: complete"]
L -->|"Needs input"| N["Encode resultType: input_required"]
N --> O["Client retries with responses and requestState"]
O --> A
McpCore should continue owning version-neutral registrations and semantic operations. It should not own dated metadata keys, HTTP headers, resultType, or protocol error numbers.
Acceptance criteria
Protocol adapter
- Add
mcpSchema/v2026_07_28.tsandmcpProtocol/v2026_07_28.ts. - Export
McpProtocol.v2026_07_28. - Update
ProtocolAdapter,ProtocolVersion, typetests, and Changesets. - Implement the final
v2026-07-28RPC vocabulary and wire schemas.
Routing and lifecycle
- Select modern requests from raw per-request metadata before payload decoding.
- Preserve initialize-and-session selection for legacy adapters.
- Serve modern requests without
initializationorMcp-Session-Id. - Derive capabilities and optional client identity independently for each modern request.
- Support legacy and modern clients on the same configured endpoint.
- Return
-32022with requested and supported versions for unsupported revisions.
Discovery and wire behavior
- Implement
server/discover. - Add required request metadata and successful-result discrimination.
- Stamp modern results with server identity metadata.
- Validate modern HTTP routing headers and return HTTP 400 with
-32020on mismatch. - Do not create or require modern protocol sessions.
- Preserve existing legacy HTTP behavior.
Multi-round-trip requests
- Add a canonical input-required outcome.
- Support elicitation, sampling, and roots input requests.
- Re-enter operations with keyed
inputResponses. - Round-trip opaque
requestStatebyte-for-byte. - Reject direct reverse-client operations for modern requests.
Subscriptions
- Implement
subscriptions/listen. - Deliver modern change notifications only through active subscriptions.
- Include subscription identifiers on delivered notifications.
- Preserve legacy notification and resource-subscription behavior.
Schema and conformance
- Support the final JSON Schema 2020-12 tool schema rules.
- Preserve arbitrary JSON structured content.
- Map missing resources to
-32602. - Add a
v2026_07_28.test.tsconformance entrypoint. - Cover discovery, stateless routing, headers, result discrimination, MRTR, subscriptions, and modern errors.
- Add mixed-era tests with
v2025_11_25andv2026_07_28. - Verify malformed modern requests cannot fall through to a legacy adapter.
Out of scope
- Tasks extension runtime and persistence
- MCP Apps
- client-side MRTR fulfilment
- distributed subscription infrastructure
- removal of legacy sessions
- removal of deprecated roots, sampling, or logging APIs
Tasks and MCP Apps should remain separately composable extensions.
Related work
- Multi-protocol McpServer for supporting upcoming 2026-07-28 spec #6617
- feat: add MCP protocol adapters #6625
- fix: mcp conformance and add test suite #6693
- Support MCP protocol version 2025-11-25 (v4) #6706
- feat: add mcp core for protocol versions #6829
- add first-class support for tasks extension #6834
Activity
[-]Support MCP protocol version 2026-06-28 (v4)[/-][+]Support MCP protocol version 2026-07-28 (v4)[/+]lloydrichards commentedon Aug 5, 2026
Some thoughts on the transport runtime:
In this way there is clear seperation between each part, while the adaptor still owns it all.
The physical binding carries bytes; the runtime owns lifecycle; the adapter owns the dated wire contract; McpCore owns semantics.
IMax153 commentedon Aug 9, 2026
I think this strategy seems reasonable, as long as the protocol era for the newer protocols supports additional protocols being added over time. It seems extendable, I'm just making the point.
I also like the runtime abstraction, but I recommend
stateful/statelessfor naming.lloydrichards commentedon Aug 14, 2026
Have been hacking away at this today and starting to make some shape of the
RuntimeDescriptor. There are a few hiccups with things like theMcpServerClientthat needed to be lifted a bit into a new runtime-neutral context, but I've tried not to expose too much internals.Working now on the MRTR and subscription features, but since these both touch the
McpSchema(+RpcMessage) i'm gonna slow down a bit and give it some thought over the weekend.which is to say that i'll hopefully have a working version of this soon and would love some help in reviewing my decisions when the PR is ready 🙏
lloydrichards commentedon Aug 14, 2026
I think I found a bit of a gap with
Rpcand itsstream: true. Effect RPC produces something like:{ "id": 42, "chunk": true, "result": [] }But MCP needs a real notifications:
{ "method": "notifications/tools/list_changed", "params": { "_meta": { "io.modelcontextprotocol/subscriptionId": 42 } } }I want to check before I try implement this in Rpc but I think i need a typed server notification message and a way for an
RPCserver transport to send that notification using opt-in HTTP streaming mode. I'm not seeing anything about this in other issues (but similar mentioned issue in #6274).I can probably hack something together that'll work for Mcp, but I'm not sure I want to widen to scope to making sure the
Rpcis spec compliant with the streamable transport.lloydrichards commentedon Aug 15, 2026
In the end the runtime abstraction wasn't too tricky to pull off, needed to shift a bit around, but seems to work across both the new stateless and ol' sesssion lifecycles. The part that was more tricky in the end was the MRTR and subscription modeling as this required touching the
McpSchema.ToolandRpcServer. Have done my best to break everything out into an easy-to-follow commit history, but the PR still ended up being net +4k loc 😬Right now it feel like all of this is needed in order to achieve the complete 2026-07-28 protocol but it would be very useful to get a second pair of eyes on this incase we want to break this up a bit or try a different angle.
guillempuche commentedon Aug 16, 2026
Thanks Lloyd for pushing the MCP area in Effect!
lloydrichards commentedon Aug 17, 2026
@IMax153 I've gone and built out a whole conformance testing platform with the latest rc and the
@modelcontextprotocoltools.https://github.com/lloydrichards/proj_effect-mcp-conformance
I'm gonna use this to flesh out some gaps/issues that are still in each of the protocols that have a little more to do with
RpcthenMcp. This should also help in the future (or ad the conformance cli tool advances) to deterministicly test everything for regressions:I'll try strengthen the the MCP Conformance suite as well, but this repo is working more like e2e test suite