fix(server): reject requests before initialization - #2122
Conversation
🦋 Changeset detectedLatest commit: 18fd2a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
3668618 to
554a24b
Compare
554a24b to
9f795ad
Compare
|
Rebased onto current main, added the server patch changeset, and force-pushed 9f795ad. Local validation: changeset status shows @modelcontextprotocol/server patch; server server.test.ts passed with 2 tests; server typecheck and lint passed; git diff --check passed. Pre-push typecheck, build, and lint also passed. |
9f795ad to
ae8908c
Compare
|
Rebased on current The current diff keeps the main branch's negotiated-protocol-version work and adds only the initialization lifecycle gate plus the regression test for rejecting requests before Validated locally:
The pre-push hook also completed the repo-wide build, typecheck, and lint steps successfully. |
ae8908c to
ba4e4d4
Compare
|
Updated the branch to keep The failing e2e jobs were caused by my previous guard treating Validation: The pre-push hook also completed full repo typecheck, build, and lint before the force-push. |
|
Rebased onto current Focused validation after the rebase: Result: server |
1bcf63c to
be8c0d1
Compare
be8c0d1 to
7fc93c2
Compare
…quests # Conflicts: # packages/server/src/server/server.ts
Modern-era instances never see initialize; they are bound modern at the entry point, so a private initialize flag rejected all of their traffic. The negotiated revision is undefined exactly between connect and initialize on legacy instances, which is the window this guard exists for.
Summary
Refs modelcontextprotocol/servers#4195.
Validation