Reject unsupported subscription streams - #3073
Open
SamMorrowDrums wants to merge 1 commit into
Open
Conversation
Use the Mcp-Method header to reject subscriptions/listen with the spec-defined 404 Method Not Found response instead of opening an idle SSE stream. Preserve SDK validation for missing or mismatched headers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 06d5dda1-4086-4996-8d18-152e45e611b0
Contributor
There was a problem hiding this comment.
Pull request overview
Rejects unsupported subscriptions/listen requests to prevent idle SSE streams.
Changes:
- Adds the
Mcp-Methodheader constant. - Returns HTTP 404 with JSON-RPC
-32601. - Tests matching, missing, and mismatched headers.
Show a summary per file
| File | Description |
|---|---|
pkg/http/headers/headers.go |
Defines the MCP method header. |
pkg/http/handler.go |
Rejects unsupported subscription streams. |
pkg/http/handler_test.go |
Verifies rejection and header validation. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
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
Reject
subscriptions/listenrequests instead of opening an idle SSE stream when the HTTP server cannot provide change notifications.Why
The remote server exposes a static MCP catalog and does not emit change notifications. Under MCP
2026-07-28, acceptingsubscriptions/listenwould leave clients on a stream that cannot deliver useful events.N/A — no linked issue.
What changed
subscriptions/listenusing the requiredMcp-Methodheader.404and JSON-RPC-32601response while preserving header/body mismatch validation.MCP impact
MCP transport behavior changes for
subscriptions/listen; no tool schemas changed.Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs