mcp_transcoder: add sse server response support. #45374
Open
CI (Envoy) / Mobile/Release validation
skipped
Jun 3, 2026 in 0s
Check was skipped
This check was not triggered in this CI run
Details
Request (pr/45374/main@73132c3)
@guoyilin42
73132c3 #45374
merge main@af5b6f3
mcp_transcoder: add sse server response support.
Commit Message: mcp_transcoder: add sse server response support.
Additional Description:
This PR introduces Server-Sent Events (SSE) server response support to the MCP JSON REST bridge filter. When the upstream server responds with atext/event-streamcontent type, the filter will now parse the stream and wrap each extracted complete event payload into a distinct text content item within the JSON-RPCcontentarray on the fly.Key Changes:
- Added
SseResponseExtractor: Introducedsse_response_extractor.ccand its header to process incoming chunks of an SSE stream and return completed event payloads.- Updated
McpJsonRestBridgeFilter: Modified the encoding path to check for thetext/event-streamcontent type. It now delegates chunk processing to the new SSE extractor and formats the results into the JSON-RPC streaming envelope.- Testing: Added unit tests in
sse_response_extractor_test.ccto verify the handling of single/multiple events, multiline data, incomplete chunked events, and CRLF line endings. Also addedToolsCallSseStreamingTranscodingto integration tests.Risk Level: Low
Testing: Unit and Integration tests.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Environment
Request variables
| Key | Value |
|---|---|
| ref | 10f0fa3 |
| sha | 73132c3 |
| pr | 45374 |
| base-sha | af5b6f3 |
| actor | |
| message | mcp_transcoder: add sse server response support.... |
| started | 1780444809.176085 |
| target-branch | main |
| trusted | false |
Build image
Container image/s (as used in this CI run)
| Key | Value |
|---|---|
| default | docker.io/envoyproxy/envoy-build:v0.1.5 |
| mobile | docker.io/envoyproxy/envoy-build:mobile-v0.1.5 |
Version
Envoy version (as used in this CI run)
| Key | Value |
|---|---|
| major | 1 |
| minor | 39 |
| patch | 0 |
| dev | true |
Loading