fix: softFail noisy 'Not Acceptable' Accept-header errors from SDK#837
Merged
Conversation
WebStandardStreamableHTTPServerTransport.handlePost/GetRequest throws when
the client's Accept header is missing one of the required MIME types
(application/json and/or text/event-stream). The SDK forwards it to
onerror, but the transport has already responded with HTTP 406 \u2014 nothing
for us to do server-side. This is pure client misconfiguration noise,
so route it through the same softFail branch as the other known
client-disconnect patterns to avoid Mezmo error alerts.
Refactor the regex into an array \u00b7 join('|') so the line stays under the
160-char max-len cap as patterns are added.
jirispilka
approved these changes
May 13, 2026
jirispilka
approved these changes
May 13, 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.
Context
WebStandardStreamableHTTPServerTransportthrowsNot Acceptable: Client must accept ...from bothhandlePostRequestandhandleGetRequestwhen the client'sAcceptheader is missing one of the required MIME types (application/json,text/event-stream). The SDK already responds HTTP 406 to the caller, then forwards the error toonerror— where we currently log it as[MCP Error]and trip Mezmo alerts. Same class of client-misconfiguration noise we already soft-fail via #787 / #795.Solution
Add the SDK error prefix
Not Acceptable: Client must acceptto the existing soft-fail filter insetupErrorHandling(). The prefix covers both variants the SDK emits (GET-path "must accept text/event-stream" and POST-path "must accept both application/json and text/event-stream").Worth your attention
Array.join('|')builder — the previous one-liner was already brushing the 160-charmax-lencap; a 5th alternation would break it. Each pattern now lives on its own line aligned with the comment block above.