Repository navigation
fix(mcp): fall back to the legacy HTTP+SSE transport - #2530
Merged
Merged
Conversation
Servers still built on the 2024-11-05 HTTP+SSE transport only accept GET on their configured URL, so the streamable initialize POST failed with "mcp server returned 405" and the server could not be used. When initialize is rejected with 400, 404 or 405, the client now follows the MCP backwards-compatibility path: open the event stream, wait for the endpoint event and post messages there. The endpoint must share the configured origin because it receives the configured headers; other statuses never fall back, and a server that speaks neither transport keeps its original error. fixes #2528
Deploying pi-desktop with
|
| Latest commit: |
9a6c43f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ca26203f.pi-desktop.pages.dev |
| Branch Preview URL: | https://fix-mcp-legacy-sse-fallback.pi-desktop.pages.dev |
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.
Servers on the 2024-11-05 HTTP+SSE transport reject the streamable initialize POST with 405 (#2528). Following the MCP backwards-compatibility path, a 400/404/405 on initialize now opens
GET <url>as an event stream, waits for theendpointevent, and posts messages there.Tests:
apps/desktop/test/mcp-legacy-sse.test.mjs(fails on old code), existing MCP suites (88 pass), desktoptsc --noEmit.fixes #2528