Skip to content

fix(server): keep discover lifecycle bootstrap-neutral - #1248

Open
faisal-shah wants to merge 2 commits into
modelcontextprotocol:mainfrom
faisal-shah:fix/discover-bootstrap
Open

faisal-shah wants to merge 2 commits into
modelcontextprotocol:mainfrom
faisal-shah:fix/discover-bootstrap

Conversation

@faisal-shah

Copy link
Copy Markdown

Summary

  • keep metadata-bearing server/discover requests bootstrap-neutral
  • select the classic lifecycle on a subsequent initialize
  • select the inline lifecycle only on the first valid ordinary metadata-bearing request
  • leave malformed and unsupported bootstrap requests recoverable
  • enqueue the lifecycle-selecting inline request into the normal service loop so bidirectional handlers remain safe

Verification

  • cargo test --package rmcp --features "client transport-io macros schemars"
  • cargo clippy --package rmcp --features "client transport-io macros schemars" --lib --test test_server_initialization --test test_stateless_server_requests --test test_subscriptions -- -D warnings

@faisal-shah
faisal-shah requested a review from a team as a code owner September 7, 2026 07:07
@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-service Service layer changes labels Sep 7, 2026
Comment thread crates/rmcp/src/service/server.rs Outdated
Comment thread crates/rmcp/src/service/server.rs Outdated
Comment thread crates/rmcp/src/service/server.rs Outdated
@tenequm

tenequm commented Oct 2, 2026

Copy link
Copy Markdown

We hit this in production: Claude Code sometimes opens a stdio session with a bare tools/list (no _meta). On 3.5.0 the server answers -32602 and then exits, so the client never falls back to initialize. This PR fixes it for us. Any chance of moving it forward? Happy to help address the review comments.

@DaleSeo
DaleSeo force-pushed the fix/discover-bootstrap branch from ffc6e5c to 68b1f4a Compare October 2, 2026 22:45
@DaleSeo

DaleSeo commented Oct 2, 2026

Copy link
Copy Markdown
Member

@faisal-shah Since a user is hitting this in production, I went ahead and pushed the review fixes.

@tenequm We'll include this fix in the next release.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-service Service layer changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants