Uh oh!
There was an error while loading. Please reload this page.
feat(sdk): @modelcontextprotocol/sdk meta-package with v1 deep-import subpaths - #1913
feat(sdk): @modelcontextprotocol/sdk meta-package with v1 deep-import subpaths#1913felixweinberger wants to merge 10 commits into
Conversation
🦋 Changeset detectedLatest commit: 6f398c0 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/server-auth-legacy@modelcontextprotocol/express@modelcontextprotocol/fastify@modelcontextprotocol/hono@modelcontextprotocol/nodecommit: |
4eeafa1 to
5018344Compare33a3b30 to
522e770Comparefelixweinberger
commented
Apr 16, 2026
@claude review |
47a96d5 to
dfc33ccCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9cdd4b2 to
30b3ecdCompare9145c02 to
5798b1aCompare30b3ecd to
1f1f722Comparefelixweinberger
commented
Apr 16, 2026
@claude review |
1f1f722 to
aa25cbcComparefelixweinberger
commented
Apr 16, 2026
@claude review |
a84e5bf to
361201eCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
361201e to
87d4f17Comparefelixweinberger
commented
Apr 16, 2026
@claude review |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d0bc434 to
a856a3bCompare08e958d to
44a1d41Comparefelixweinberger
commented
Apr 17, 2026
@claude review |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
44a1d41 to
bf3af27Comparebf3af27 to
c673ae7Comparefelixweinberger
commented
Apr 17, 2026
@claude review |
Uh oh!
There was an error while loading. Please reload this page.
2e18a44 to
55f4068Compareb9e6b2d to
e07c470Compare34f89ec to
4b69caaCompare…-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.
…root; optional express/hono peers - All five server/auth/* subpaths now re-export from @modelcontextprotocol/server-auth-legacy so OAuth error subclasses share the same OAuthError identity that the legacy router and requireBearerAuth check with instanceof. Previously errors.ts defined local subclasses extending core's OAuthError and bearerAuth.ts re-exported /express, causing instanceof to fail (HTTP 500 instead of 400/401). - Drop @modelcontextprotocol/express dependency (no longer imported). - Forward express and hono as optional peerDependencies so consumers who do not use the auth or hono-adapter subpaths get no unmet-peer warnings. - Add top-level types field for legacy moduleResolution: node. - Revert 87d4f17's stdio re-exports from the root barrel; stdio remains subpath-only to match the underlying client/server packages.
…server/zod-compat subpath
…StartSSEOptions to subpaths
…nstead of closed .tool() variadic (C2/#1900)
40587aa to
65a1e5cCompare4b69caa to
6f398c0Compare
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).