Repository navigation
Conversation
Formalizes pluggable transports at the SDK layer rather than expanding the core spec. Splits transport support into two layers: a Transport interface and conformance harness in SDK core (Tier 1 requirement), and concrete transport implementations distributed as independent packages or formalized SEP-2133 Extensions. Relaxes the JSON-RPC wire-format requirement for custom transports in exchange for a bidirectional JSON-RPC mapping that enables generic translating proxies.
db639fb to
50ea008
Compare
21882c4 to
2d90abe
Compare
markdroth
left a comment
There was a problem hiding this comment.
Thanks for writing this up, Kurtis!
I like the overall direction here, but I think the proposal is a bit too strict about what custom transports will support. I think we need to loosen the requirements there to allow custom transports to innovate or to decide not to support certain parts of the MCP spec.
Happy to chat further about this.
| MUST expose it ([SEP-1730](./1730-sdks-tiering-system.md)). | ||
| - Concrete **transport implementations** (WebSocket, gRPC, SSH, …) live | ||
| outside SDK core as separate packages. Most ship simply as third-party | ||
| packages that consume the §4 interface; only the most widely-adopted |
There was a problem hiding this comment.
I assume that §4 should be a link to section 4 below? Maybe use a hyperlink here instead?
Same thing in various places that use the § notation.
| > **MAY** use any on-the-wire encoding. A custom transport **MAY** | ||
| > transcode JSON-RPC messages into a different serialization (e.g., | ||
| > Protobuf, CBOR, a custom binary framing) provided every MCP method, | ||
| > parameter, result, notification, and error is faithfully | ||
| > round-tripped and no MCP semantics are lost or added. |
There was a problem hiding this comment.
I think this may be a little too strong. I think we want the ability for custom transports to innovate a bit, or to decide that they aren't going to support certain protocol features.
As an example, the gRPC transport will probably want to not support progress notifications for anything except tasks.
| (e.g., `id` when JSON-RPC allows string/number/null but the custom | ||
| encoding uses a fixed type; binary payloads in fields typed as | ||
| strings; error codes and error data). |
There was a problem hiding this comment.
This is another example of where I think this proposal is a bit too strict. As an example, the gRPC transport doesn't have a request ID at all, nor does it need one. This means that it's not really feasible for us to translate this field.
I would argue that within a pluggable transport framework, the request ID should be added by the JSON-RPC-based transports and not exposed as part of the general JSON-RPC format for MCP, so that the request ID is not even relevant to this translation in the first place. (Note that with all of the statelessness changes we're making for the June spec, the request ID will technically no longer be useful even in the streamable HTTP transport -- it will actually be necessary only for the stdio transport.)
There was a problem hiding this comment.
Related: The gRPC transport will also not support the notifications/cancelled method, which I think is the only thing that actually depends on the JSON-RPC request ID. (That method is also basically useless in the streamable HTTP transport once all of the statelessness changes are in place.)
| mapping **MUST**: | ||
|
|
||
| 1. Cover every MCP method, notification, result, and error the transport | ||
| supports, including `initialize` and shutdown. |
There was a problem hiding this comment.
We're getting rid of initialize in one of the other SEPs, so should just assume it's already gone here?
Note that the gRPC transport does not support initialize, because it's inherently stateless, so this isn't something we're going to be able to provide a mapping for.
| 4. Is transport-agnostic in shape: the interface **MUST NOT** leak | ||
| stdio-specific or Streamable-HTTP-specific concepts (e.g., `stderr`, | ||
| HTTP status codes) into its public surface. |
There was a problem hiding this comment.
I think we may want to spell out the desired API semantics a bit more clearly here, but I also don't want to be too prescriptive, so I'm not sure exactly how to phrase it.
As an example of the kind of issue I'm concerned about here, one of the issues that we've been discussing in the context of the python SDK is that on the server side, we need an API that inherently matches up responses to the corresponding requests without relying on something like a request ID.
There was a problem hiding this comment.
Given that the JSON-RPC request ID is now essentially a transport-specific detail, it would also be nice to mandate that the request ID should not be part of the transport API, nor should it be exposed outside of that API.
|
|
||
| ## Reference Implementation | ||
|
|
||
| TODO — to be completed before this SEP reaches `Final`. Planned scope: |
There was a problem hiding this comment.
i believe we need a "prototype implementation":
https://modelcontextprotocol.io/community/sep-guidelines#prototype-requirements
| conformance test harness — lives in SDK **core**. Every Tier 1 MCP SDK | ||
| MUST expose it ([SEP-1730](./1730-sdks-tiering-system.md)). |
There was a problem hiding this comment.
These will both be a significant burden on tier 1 SDK maintainers, which is quite different from how we've handled extensions so far. For instance, we don't require Tier 1 SDK's to implement any extensions today (or even "experimental" features).
These will also both be fairly difficult to enforce. Since each implementation and each test harness will be language specific, it means this will need to be qualitatively evaluated at tiering time as to whether they've actually done the extension points "properly".
I'd prefer we treat this more like an extension. E.g. the gRPC transport can ship conformance tests in the official suite that SDK's can connect to as an optional test they can report on passing or not.
|
Hi @kurtisvg and team, I’ve already shipped a production-grade pluggable gRPC transport that aligns closely with the spirit (and much of the letter) of this proposal: It deliberately makes the same pragmatic trade-offs discussed in the reviews here (no request ID on the wire for the protobuf path, stateless by design, etc.) while still providing full MCP semantics and a clean JSON-RPC mapping option. Happy to: Thanks for driving this! |
|
|
||
| SDKs that have already shipped a **stable major version** at the time | ||
| this SEP is accepted **MAY** retain Tier 1 status without implementing | ||
| §4.1 and §4.2 until their next major version bump. This is a one-time |
There was a problem hiding this comment.
Given that we're likely going to have to release a 2.0 anyway to the other breaking changes coming to the protocol at the end of June, I don't think this buys anything for at least the C# SDK.
At the same time, looking at section 4.1 "The Transport interface", I think the current ITransport and IClientTransport interfaces in the C# SDK already meet all the requirements.
That is, unless the push back is really about just having things like "JsonRpc" in type names, but I think the pluggable transports would be overreaching by quite a bit if it started demanding certain names for types/methods/functions across SDKs.
@markdroth suggested the following additional requirement ion section 4.1.
Given that the JSON-RPC request ID is now essentially a transport-specific detail, it would also be nice to mandate that the request ID should not be part of the transport API, nor should it be exposed outside of that API.
This is the type of overly prescriptive language that I would not want in the pluggable transport language.
The focus of this should be to unblock scenarios mentioned in the "Motivation" section. If we can achieve those goals, I think that should be considered a success.
I think it would be wrong to mandate that "The Transport interface" be made completely incompatible with old revisions of the protocol. If there's a transport design that can optionally expose JSON-RPC request IDs for transport implementations that can implement them and wan to by easily-proxyable to the older more JSON-RPC focused iterations of the protocol, we should not use the specification to bully SDK maintainers into making this impossible or difficult.
What I think would be helpful is a reference implementation for a transport interface that everyone agrees meets the ideals set out in section 4.1, "The Transport interface". I expect people will want this in either TypeScript or Python first.
I'm open to creating a new transport interface with less JSON-RPCisms, but I want to know what I'm getting for this. If I can unblock all the scenarios mentioned in the "Motivation" section by extending the existing ITransport and IClientTransport interfaces we shipped in version 1.0 of the C# SDK, I want to be given an opportunity to do that.
|
This was reviewed by the Core Maintainers and the decision was to Defer. |
|
Just a quick update, this SEP is going to try to be broken down into 3 discrete parts before re-voting:
Here is also a slide deck I presented on this topic as Amsterdam's MCPCon: |
Summary
Adds a draft SEP proposing pluggable transports at the SDK layer as the
alternative to expanding the core transport set. The proposal splits
transport support into two layers:
Transportinterface plusa reusable conformance test harness.
the most widely-adopted eligible for promotion to official SEP-2133
Extensions. Neither tier factors into SDK conformance tiering.
It also relaxes the current
MUST ... preserve the JSON-RPC message formatrequirement for custom transports, in exchange for a bidirectional
JSON-RPC mapping that makes generic translating proxies tractable.
Key design choices
the only Standard transports. Every core addition compounds spec
complexity and SDK maintainer burden; this SEP argues for a firm
default of "no" and a supported extension point instead.
of Extensions negotiating over
initialize, and aligns with SEP-2133'scarve-out of Extensions from SDK conformance tiering.
status until their next major version bump; new SDKs comply from their
first stable release.
Related proposals this addresses