Mount the deprecated 2024-11-05 HTTP+SSE two-endpoint transport
(basic/transports §HTTP with SSE) onto router, so a legacy-only client can
still negotiate it against a D MCP server. Called by mountMcp when
opts.legacyHttpSse is set, but also usable directly to host ONLY the legacy
transport. It mounts:
- GET opts.legacySsePath: opens a text/event-stream; the FIRST event is
the endpoint event whose data is opts.legacyMessagePath ("When a
client connects, the server MUST send an endpoint event containing a URI
for the client to use for sending messages"); the stream is then held open
and every server message is delivered as an SSE message event;
- POST opts.legacyMessagePath: accepts a single JSON-RPC message, replies
202 Accepted with no body, and pushes any JSON-RPC response back onto the
open GET stream as a message event ("Server messages are sent as SSE
message events, with the message content encoded as JSON in the event
data"). Origin/auth guards mirror the modern endpoint.
Mount the deprecated 2024-11-05 HTTP+SSE two-endpoint transport (basic/transports §HTTP with SSE) onto router, so a legacy-only client can still negotiate it against a D MCP server. Called by mountMcp when opts.legacyHttpSse is set, but also usable directly to host ONLY the legacy transport. It mounts: - GET opts.legacySsePath: opens a text/event-stream; the FIRST event is the endpoint event whose data is opts.legacyMessagePath ("When a client connects, the server MUST send an endpoint event containing a URI for the client to use for sending messages"); the stream is then held open and every server message is delivered as an SSE message event; - POST opts.legacyMessagePath: accepts a single JSON-RPC message, replies 202 Accepted with no body, and pushes any JSON-RPC response back onto the open GET stream as a message event ("Server messages are sent as SSE message events, with the message content encoded as JSON in the event data"). Origin/auth guards mirror the modern endpoint.