Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(server): reject setLevel outside legacy lifecycle - #1563

Merged
connor4312 merged 1 commit into
mainfrom
fix/rmcp-1560-gate-set-level-legacy
Dec 3, 2026
Merged

connor4312 merged 1 commit into
mainfrom
fix/rmcp-1560-gate-set-level-legacy

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Closes #1560

Motivation and Context

Return -32601 for logging/setLevel when the request uses the new lifecycle, just as we do for ping, resources/subscribe, and resources/unsubscribe.

The 2026-07-28 schema removes logging/setLevel. Clients now set the level on each request using _meta["io.modelcontextprotocol/logLevel"]. But ServerHandler::handle_request still called set_level for every protocol version. That meant servers overriding set_level for older clients also responded to 2026-07-28 clients, forcing them to handle the version check themselves.

How Has This Been Tested?

  • Automated unit / integration tests
  • Tested manually
  • Tested in a real application

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Test update (non-breaking change which adds or updates tests)
  • Refactoring (non-breaking change which makes things better)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • CI/build script update (update CI workflow or build scripts)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • I have added automated tests for my change
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@DaleSeo
DaleSeo marked this pull request as ready for review December 3, 2026 16:25
@DaleSeo
DaleSeo requested a review from a team as a code owner December 3, 2026 16:25
@DaleSeo DaleSeo self-assigned this Dec 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T16:26:14.770253Z 83ea928 Draft marked ready
🔒 Security Review ✅ Completed 2026-12-03T16:27:31.403243Z 83ea928 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@connor4312 connor4312 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.

LGTM. This matches the 2026-07-28 spec, which removes logging/setLevel alongside ping, and it uses the same legacy_request guard. Optional follow-up: on the client side, Peer::set_level could fail locally with a clear error when the negotiated version is 2026-07-28 or later, instead of a round trip that returns -32601.

@connor4312
connor4312 merged commit 4b42f41 into main Dec 3, 2026
23 checks passed
@connor4312
connor4312 deleted the fix/rmcp-1560-gate-set-level-legacy branch December 3, 2026 22:46
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.

server: logging/setLevel is still dispatched for 2026-07-28 requests

2 participants