fix: enable JSON response mode on MCP transport#58
Merged
volod-vana merged 1 commit intovana-com:mainfrom Mar 2, 2026
Merged
Conversation
The default SSE streaming mode is unreliable when the request passes
through a proxy chain (e.g. Anthropic → Cloudflare → FRP tunnel →
local server). Proxies can buffer, truncate, or close the SSE
connection before the tool result event arrives, causing Claude to
receive `{"error": "Error occurred during tool execution"}` despite
the server returning HTTP 200.
Setting `enableJsonResponse: true` makes each MCP response a single
atomic `application/json` reply instead of a long-lived SSE stream,
which is reliable through any number of intermediary proxies.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
noreff
approved these changes
Mar 2, 2026
volod-vana
approved these changes
Mar 2, 2026
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.
Summary
enableJsonResponse: trueonWebStandardStreamableHTTPServerTransportin the MCP routeProblem
The default SSE streaming mode sends HTTP 200 immediately, then writes tool results asynchronously as SSE events. When proxies sit between the MCP client and server, they can buffer, truncate, or close the SSE connection before the result event arrives. This causes Claude to receive
{"error": "Error occurred during tool execution"}even though the server processed the request successfully.Fix
Setting
enableJsonResponse: truemakes each MCP response a single atomicapplication/jsonreply instead of a long-lived SSE stream. This is reliable through any number of intermediary proxies.Test plan
list_filestool call via Claude returns results instead of error🤖 Generated with Claude Code