FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Reject unsupported subscription streams by SamMorrowDrums · Pull Request #3073 · github/github-mcp-server · GitHub

Reject unsupported subscription streams - #3073

Merged
SamMorrowDrums merged 2 commits into
mainfrom
sammorrowdrums-reject-subscription-listen
Aug 17, 2026
Merged

Reject unsupported subscription streams#3073
SamMorrowDrums merged 2 commits into
mainfrom
sammorrowdrums-reject-subscription-listen

Conversation

Copy link
Copy Markdown
Collaborator

Summary

Reject subscriptions/listen requests 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, accepting subscriptions/listen would leave clients on a stream that cannot deliver useful events.

N/A — no linked issue.

What changed

  • Detect subscriptions/listen using the required Mcp-Method header.
  • Return the spec-defined HTTP 404 and JSON-RPC -32601 response while preserving header/body mismatch validation.
  • Cover matching, missing, and mismatched method headers.

MCP impact

  • Tool schema or behavior changed

MCP transport behavior changes for subscriptions/listen; no tool schemas changed.

Prompts tested (tool changes only)

  • N/A — no tools changed.

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

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
SamMorrowDrums requested a review from a team as a code owner August 14, 2026 16:09
Copilot AI balanced review requested due to automatic review settings August 14, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Rejects unsupported subscriptions/listen requests to prevent idle SSE streams.

Changes:

  • Adds the Mcp-Method header 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

Document why header validation precedes the unsupported-method rejection and use named SDK error constants in tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 06d5dda1-4086-4996-8d18-152e45e611b0
SamMorrowDrums merged commit 3085e59 into main Aug 17, 2026
19 checks passed
SamMorrowDrums deleted the sammorrowdrums-reject-subscription-listen branch August 17, 2026 11:42
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL