Migration guide fixes and editor-visible deprecation for the 1.x handler form - #771
Merged
Conversation
…ler form Guide: name @modelcontextprotocol/express in the server-author row, say the two SDKs share no types rather than "do not interoperate" (they speak the same wire protocol), note zod 4.0/4.1 lack ~standard.jsonSchema, list the full 1.x-shaped extra, cover tool callbacks in the handler-context bullet, document that the double-registration guard now covers the base Protocol's notifications/progress and notifications/cancelled handlers, mention ResourceNotFoundError, add the Express row to the import map, and add a "What stays the same" section. The @deprecated tag on the legacy setRequestHandler / setNotificationHandler overload sat on the parameter inside an intersection type, which TypeScript does not report. The overload now comes from LegacyRequestHandlerSetter / LegacyNotificationHandlerSetter, named types with a documented call signature, so editors flag the 1.x call and not the 2.x forms. README links to the quickstart use the lowercase slug typedoc emits.
Contributor
PreviewPreview deployments for this PR have been cleaned up. |
@modelcontextprotocol/ext-apps
@modelcontextprotocol/server-basic-preact
@modelcontextprotocol/server-basic-react
@modelcontextprotocol/server-basic-solid
@modelcontextprotocol/server-basic-svelte
@modelcontextprotocol/server-basic-vanillajs
@modelcontextprotocol/server-basic-vue
@modelcontextprotocol/server-budget-allocator
@modelcontextprotocol/server-cohort-heatmap
@modelcontextprotocol/server-customer-segmentation
@modelcontextprotocol/server-debug
@modelcontextprotocol/server-lazy-auth
@modelcontextprotocol/server-map
@modelcontextprotocol/server-pdf
@modelcontextprotocol/server-scenario-modeler
@modelcontextprotocol/server-shadertoy
@modelcontextprotocol/server-sheet-music
@modelcontextprotocol/server-system-monitor
@modelcontextprotocol/server-threejs
@modelcontextprotocol/server-transcript
@modelcontextprotocol/server-video-resource
@modelcontextprotocol/server-wiki-explorer
commit: |
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.
Pre-release pass over
docs/migrate-to-2.md: every claim in the guide was checked against the built package (each "after" snippet typechecked, each "gone" form confirmed to fail, each deprecated form confirmed to compile and warn once, each wire delta matched to a test assertion). 48 of 52 claims held as written; this PR fixes the three that were imprecise, adds the seven things the guide did not mention, and fixes one code issue the check surfaced.Guide changes:
@modelcontextprotocol/express(createMcpExpressApp) explicitly; "express" alone was ambiguous.~standard.jsonSchemabefore 4.2.0), not only zod 3.registerAppToolandapp.registerToolcallbacks,sessionId, andauthInfo→http?.authInfo.extralist is complete (sendRequest,sendNotification,authInfo) and names the exportedLegacyRequestHandlerExtra.Protocol'snotifications/progressandnotifications/cancelledhandlers, which 1.7.5 let you replace silently (SDK 2.0 fixups: lockfile, peers, handler guards, docs, wire-compat tests #768 extended the guard; this is the one behaviour change nothing documented).ResourceNotFoundErrornote under errors; Express row in the checklist import map; a short "What stays the same" section for 1.7.x readers.Code change: the
@deprecatedtag on the legacysetRequestHandler(Schema, handler)overload sat on the parameter inside an intersection type, which TypeScript never reports, so editors did not flag the 1.x form (the raw-shaperegisterAppTooloverload was flagged correctly). The overload now comes fromLegacyRequestHandlerSetter/LegacyNotificationHandlerSetter, named types with a documented call signature; a language-service probe confirms the 1.x call is reported as deprecated on bothAppandAppBridgeand the 2.x forms are not. Runtime behaviour is unchanged (245 tests).Also normalises the three README quickstart links to the lowercase
quickstart.htmlslug typedoc emits; the capitalised one only resolves today because the docs deploy keeps old files.