{{ message }}
Repository navigation
Conversation
Signed-off-by: Xiaoping Liao <106010272+kyletser@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What I did
Before interceptors currently marshal the entire Go SDK request. On Streamable HTTP,
RequestExtracontains aCloseSSEStreamfunction field, which makesencoding/jsonreject the request before the interceptor or tool can run. Even an empty non-nilRequestExtratriggers this error.Serialize only
{ "method": "tools/call", "params": ... }, retaining tool arguments and request_metawhile excluding SDK session objects and transport state. This applies to all three interceptor runners because serialization happens before runner dispatch. After-interceptor behavior is unchanged.The lowercase
paramskey matches the existing jq examples. This intentionally replaces the SDK-shaped uppercaseParamskey; the example README now documents that migration and the payload boundary.Regression coverage uses a real HTTP interceptor for passthrough and short-circuit results, with nil, empty and callback-bearing transport extras. A separate end-to-end test initializes a real MCP Streamable HTTP client/server pair and calls a tool through the interceptor. It verifies the tool result and the intercepted payload without Docker or a model provider.
Related issue
Fixes #358. The earlier #360 is closed and unmerged; this change includes transport-level regression coverage and does not depend on that PR.
Verification
run ./...) reported 0 issues, and the CLI build passed.TestReset,TestResetEmptyCatalogs, andTestDockerCatalogProtectionfailed while downloadinghttps://desktop.docker.com/mcp/catalog/v2/catalog.yaml(connection reset by peer). No tests were excluded or weakened. This is not a full-suite pass.json.Marshal(req)makes the real Streamable HTTP regression fail with the reported serialization error; restoring the fix makes the package pass again.