feat(sdk): @modelcontextprotocol/sdk meta-package with v1 deep-import subpaths#1913
Draft
felixweinberger wants to merge 1 commit intofweinberger/v2-bc-d1-basefrom
Draft
feat(sdk): @modelcontextprotocol/sdk meta-package with v1 deep-import subpaths#1913felixweinberger wants to merge 1 commit intofweinberger/v2-bc-d1-basefrom
felixweinberger wants to merge 1 commit intofweinberger/v2-bc-d1-basefrom
Conversation
🦋 Changeset detectedLatest commit: 522e770 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
4eeafa1 to
5018344
Compare
…-import subpaths Adds packages/sdk as the primary v2 entry point. Re-exports the full server + client + node surface from a single root barrel (TS2308-safe named re-exports for client/node) and preserves v1 deep-import subpaths (/types.js, /server/mcp.js, /client/index.js, /shared/transport.js, /shared/protocol.js, /server/auth/errors.js with the 17 OAuth error subclasses, etc.). Folds in the C3/C6 schema-arg shims: the sdk-exported Server and Client are thin subclasses that additionally accept the deprecated v1 calling conventions setRequestHandler(ZodSchema, h), setNotificationHandler( ZodSchema, h) and request(req, ResultSchema, opts), extracting the method literal and forwarding to the v2 string-based API with a one-time deprecation warning.
33a3b30 to
522e770
Compare
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.
Part of the v2 backwards-compatibility series — see reviewer guide.
The Layer-2 lever: a meta-package depending on client+server+node+server-auth-legacy that re-exports at v1's ~28 deep-import subpaths (
sdk/types.js,sdk/server/mcp.js, etc.) with extensionless aliases. Permanent primary entry — split packages opt-in for bundle-conscious users.Motivation and Context
The Layer-2 lever: a meta-package depending on client+server+node+server-auth-legacy that re-exports at v1's ~28 deep-import subpaths (
sdk/types.js,sdk/server/mcp.js, etc.) with extensionless aliases. Permanent primary entry — split packages opt-in for bundle-conscious users.v1 vs v2 pattern & evidence
v1 pattern:
v2-native:
Evidence: This is what makes 'bump only' work. Validated: 5 OSS repos at 0 SDK errors with bump-only install.
How Has This Been Tested?
McpServer.tool()+InMemoryTransport+callTool(params, ResultSchema))v2-bc-integrationvalidation branchpnpm typecheck:all && pnpm lint:all && pnpm test:allgreen (sdk 5/5, integration 428/428)Breaking Changes
None — additive
@deprecatedshim. Removed in v3.Types of changes
Checklist
Additional context
Stacks on
fweinberger/v2-bc-d1-base= main + #1891 (A1), #1898 (B4), #1900 (C2), #1901 (C4), #1902 (C5), #1903 (C7), #1904 (C8), #1906 (C10), #1908 (E2), #1909 (E3), #1834 (A4). Re-exports their surface; tests exercise the combined v1 API. As those land onmain, this PR will be retargeted and the diff stays at ~1000 LOC (44 files).typedoc.config.mjs: excludes@modelcontextprotocol/sdkfrom API-doc generation — it's a pure re-export package, and inherited{@link}JSDoc on re-exported symbols can't resolve cross-package module paths (spurious warnings, no doc value added).