Skip to content

Fix StreamableHttpTransport JSON-RPC envelope handling#18

Merged
0xeb merged 2 commits intomainfrom
fix/streamable-http-client
Dec 6, 2025
Merged

Fix StreamableHttpTransport JSON-RPC envelope handling#18
0xeb merged 2 commits intomainfrom
fix/streamable-http-client

Conversation

@0xeb
Copy link
Copy Markdown
Owner

@0xeb 0xeb commented Dec 6, 2025

Summary

  • Fix StreamableHttpTransport::request to build proper JSON-RPC request envelope
  • Extract result from JSON-RPC response envelope (matching SseClientTransport behavior)
  • Handle JSON-RPC errors by throwing TransportError

Problem

The StreamableHttpTransport was passing params directly instead of wrapping them in a JSON-RPC envelope ({"jsonrpc":"2.0","method":...,"params":...,"id":...}). It was also returning the full JSON-RPC response instead of extracting the result.

This caused interop failures when C++ StreamableHttpTransport client connected to Python Streamable HTTP servers.

Test plan

  • Run T6 interop test (Python Streamable HTTP server + C++ client) - passes 6/6 tests
  • Run all interop tests (T1-T6) - passes 129/129 tests

…sult

The StreamableHttpTransport::request method was passing the params
directly to the server instead of wrapping them in a JSON-RPC envelope.
It was also returning the full JSON-RPC response instead of extracting
the result.

Fixes:
- Build proper JSON-RPC request with jsonrpc, method, params, and id
- Extract result from JSON-RPC response envelope
- Handle JSON-RPC errors by throwing TransportError
@0xeb 0xeb force-pushed the fix/streamable-http-client branch from 292b8b1 to cdb489a Compare December 6, 2025 04:06
@0xeb 0xeb merged commit f677365 into main Dec 6, 2025
1 check passed
@0xeb 0xeb deleted the fix/streamable-http-client branch December 6, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant