Skip to content

Conversation

@yamadashy
Copy link
Contributor

@yamadashy yamadashy commented Nov 27, 2025

Use StreamableHTTPError instead of plain Error in send() method to expose HTTP status code via error.code.

Fixes: #1176

Use StreamableHTTPError instead of plain Error when throwing HTTP errors
in the send() method. This allows clients to programmatically access the
HTTP status code via error.code, which is required for implementing
proper SSE fallback behavior per MCP spec (only fallback for 400/404/405).

Fixes modelcontextprotocol#1176
@yamadashy yamadashy requested a review from a team as a code owner November 27, 2025 02:13
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1178

commit: 71adf3e

Copy link
Contributor

@mattzcarey mattzcarey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@felixweinberger felixweinberger merged commit 6b90e1a into modelcontextprotocol:main Nov 28, 2025
6 checks passed
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.

send() should use StreamableHTTPError instead of plain Error for HTTP errors

3 participants