Version Packages (alpha)#175
Open
github-actions[bot] wants to merge 1 commit intomainfrom
Open
Conversation
9bf0e19 to
b798e3c
Compare
df38f93 to
59df763
Compare
5582238 to
b362edf
Compare
89b57bb to
085b09c
Compare
e385700 to
41a64d9
Compare
f341bd3 to
636fae5
Compare
ada79de to
d9110e9
Compare
e956327 to
ee99040
Compare
752fad9 to
894c2e2
Compare
c5aad6d to
e9f4a90
Compare
72ccc3f to
3b6840e
Compare
e6326bb to
53f503a
Compare
940e536 to
c2e832f
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
mainis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonmain.Releases
@modelcontextprotocol/client@2.0.0-alpha.3
Minor Changes
#1974
db83829Thanks @felixweinberger! - Add custom (non-spec)method support: a 3-arg
setRequestHandler(method, schemas, handler)/setNotificationHandler(method, schemas, handler)form for vendor-prefixed methods, and arequest(req, resultSchema)overload (also onctx.mcpReq.send) for typed custom-method results. Spec-methodcalls are unchanged.
Response result-schema validation failure now rejects with
SdkError(InvalidResult)instead of a rawZodError. AddsSdkErrorCode.InvalidResult.#1653
6bec24aThanks @rechedev9! - AddvalidateClientMetadataUrl()utility for early validation of
clientMetadataUrlExports a
validateClientMetadataUrl()function thatOAuthClientProviderimplementations can call in their constructors to fail fast on invalid URL-based client IDs, instead of discovering the error deep in the auth flow.#1887
96db044Thanks @felixweinberger! - ExportisSpecTypeandspecTypeSchemasrecords for runtime validation of any MCP spec type by name.isSpecType.ContentBlock(value)is a type predicate;specTypeSchemas.ContentBlockis aStandardSchemaV1<ContentBlock>validator. Guards are standalone functions, soarr.filter(isSpecType.ContentBlock)works. Also export theSpecTypeNameandSpecTypestypes.#1871
9fc9070Thanks @felixweinberger! - Move stdio transportsto a
./stdiosubpath export. ImportStdioClientTransport,getDefaultEnvironment,DEFAULT_INHERITED_ENV_VARS, andStdioServerParametersfrom@modelcontextprotocol/client/stdio, andStdioServerTransportfrom@modelcontextprotocol/server/stdio. The@modelcontextprotocol/clientroot entry no longer pulls innode:child_process,node:stream, orcross-spawn, fixing bundling for browser and Cloudflare Workers targets; the@modelcontextprotocol/serverroot entry drops itsnode:streamreference. Node.js, Bun, andDeno consumers update the import path; runtime behavior is unchanged.
Patch Changes
#1897
434b2f1Thanks @felixweinberger! - Stop bundling@cfworker/json-schemainto the main package barrel. PreviouslyCfWorkerJsonSchemaValidatorwas re-exported from the core internal barrel, so tsdown inlined the@cfworker/json-schemadev dependency into every consumer's bundle even when it was never used. The validator isnow reachable only via the
_shimsconditional (workerd/browser) and the explicit@modelcontextprotocol/{server,client}/validators/cf-workersubpath, so consumers that don't opt into it no longer ship that code. No public API change.#1834
42cb6b2Thanks @felixweinberger! - ExportInMemoryTransportfor in-process testing.#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.#1655
1eb3123Thanks @nielskaspers! - fix(client): append customAccept headers to spec-required defaults in StreamableHTTPClientTransport
Custom Accept headers provided via
requestInit.headersare now appended to the spec-mandated Accept types instead of being overwritten. This ensures the required media types (application/json, text/event-streamfor POST;text/event-streamfor GET SSE) are always presentwhile allowing users to include additional types for proxy/gateway routing.
#1976
55b1f06Thanks @felixweinberger! - refactor: subclassesoverride
_wrapHandlerhook instead of redeclaringsetRequestHandler.#1895
b256546Thanks @felixweinberger! - Fix runtime crash ontools/listwhen a tool'sinputSchemacomes from zod 4.0–4.1. The SDK requires~standard.jsonSchema(StandardJSONSchemaV1, added in zod 4.2.0); previously a missingjsonSchemacrashed atundefined[io].standardSchemaToJsonSchemanow detects zod 4 schemas lackingjsonSchemaand falls back to the SDK-bundledz.toJSONSchema(), emitting a one-time console warning. zod 3 schemas (which the bundled zod 4 converter cannot introspect) and non-zod schema libraries withoutjsonSchemaget a clear error pointing tofromJsonSchema(). Theworkspace zod catalog is also bumped to
^4.2.0.@modelcontextprotocol/express@2.0.0-alpha.3
Minor Changes
7cccc2aThanks @felixweinberger! - Add OAuthResource-Server glue to the Express adapter:
requireBearerAuthmiddleware (token verification + RFC 6750WWW-Authenticatechallenges),mcpAuthMetadataRouter(serves RFC 9728 Protected Resource Metadata and mirrors RFC 8414 AS metadata at the resource origin), thegetOAuthProtectedResourceMetadataUrlhelper, and theOAuthTokenVerifierinterface. These restore the v1src/server/authResource-Server pieces as first-class v2 API so MCP servers can plug into an external Authorization Server with a few lines of Express wiring.Patch Changes
#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.Updated dependencies [
434b2f1,db83829,42cb6b2,df4b6cc,2a7611d,e15a8ef,96db044,9fc9070,55b1f06,b256546]:@modelcontextprotocol/server@2.0.0-alpha.3
Minor Changes
#1974
db83829Thanks @felixweinberger! - Add custom (non-spec)method support: a 3-arg
setRequestHandler(method, schemas, handler)/setNotificationHandler(method, schemas, handler)form for vendor-prefixed methods, and arequest(req, resultSchema)overload (also onctx.mcpReq.send) for typed custom-method results. Spec-methodcalls are unchanged.
Response result-schema validation failure now rejects with
SdkError(InvalidResult)instead of a rawZodError. AddsSdkErrorCode.InvalidResult.#1887
96db044Thanks @felixweinberger! - ExportisSpecTypeandspecTypeSchemasrecords for runtime validation of any MCP spec type by name.isSpecType.ContentBlock(value)is a type predicate;specTypeSchemas.ContentBlockis aStandardSchemaV1<ContentBlock>validator. Guards are standalone functions, soarr.filter(isSpecType.ContentBlock)works. Also export theSpecTypeNameandSpecTypestypes.#1871
9fc9070Thanks @felixweinberger! - Move stdio transportsto a
./stdiosubpath export. ImportStdioClientTransport,getDefaultEnvironment,DEFAULT_INHERITED_ENV_VARS, andStdioServerParametersfrom@modelcontextprotocol/client/stdio, andStdioServerTransportfrom@modelcontextprotocol/server/stdio. The@modelcontextprotocol/clientroot entry no longer pulls innode:child_process,node:stream, orcross-spawn, fixing bundling for browser and Cloudflare Workers targets; the@modelcontextprotocol/serverroot entry drops itsnode:streamreference. Node.js, Bun, andDeno consumers update the import path; runtime behavior is unchanged.
Patch Changes
#1897
434b2f1Thanks @felixweinberger! - Stop bundling@cfworker/json-schemainto the main package barrel. PreviouslyCfWorkerJsonSchemaValidatorwas re-exported from the core internal barrel, so tsdown inlined the@cfworker/json-schemadev dependency into every consumer's bundle even when it was never used. The validator isnow reachable only via the
_shimsconditional (workerd/browser) and the explicit@modelcontextprotocol/{server,client}/validators/cf-workersubpath, so consumers that don't opt into it no longer ship that code. No public API change.#1834
42cb6b2Thanks @felixweinberger! - ExportInMemoryTransportfor in-process testing.#1788
df4b6ccThanks @claygeo! - Prevent stack overflow inStreamableHTTPServerTransport.close() with re-entrant guard
#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.#1901
e15a8efThanks @felixweinberger! -registerTool/registerPromptaccept a raw Zod shape ({ field: z.string() }) forinputSchema/outputSchema/argsSchemain addition to a wrapped Standard Schema. Raw shapes are auto-wrapped withz.object(). The raw-shape overloads are@deprecated; prefer wrappingwith
z.object().Also widens the
completable()constraint fromStandardSchemaWithJSONtoStandardSchemaV1so v1'scompletable(z.string(), fn)continues to work.#1976
55b1f06Thanks @felixweinberger! - refactor: subclassesoverride
_wrapHandlerhook instead of redeclaringsetRequestHandler.#1895
b256546Thanks @felixweinberger! - Fix runtime crash ontools/listwhen a tool'sinputSchemacomes from zod 4.0–4.1. The SDK requires~standard.jsonSchema(StandardJSONSchemaV1, added in zod 4.2.0); previously a missingjsonSchemacrashed atundefined[io].standardSchemaToJsonSchemanow detects zod 4 schemas lackingjsonSchemaand falls back to the SDK-bundledz.toJSONSchema(), emitting a one-time console warning. zod 3 schemas (which the bundled zod 4 converter cannot introspect) and non-zod schema libraries withoutjsonSchemaget a clear error pointing tofromJsonSchema(). Theworkspace zod catalog is also bumped to
^4.2.0.@modelcontextprotocol/fastify@2.0.0-alpha.3
Patch Changes
#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.Updated dependencies [
434b2f1,db83829,42cb6b2,df4b6cc,2a7611d,e15a8ef,96db044,9fc9070,55b1f06,b256546]:@modelcontextprotocol/hono@2.0.0-alpha.3
Patch Changes
#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.Updated dependencies [
434b2f1,db83829,42cb6b2,df4b6cc,2a7611d,e15a8ef,96db044,9fc9070,55b1f06,b256546]:@modelcontextprotocol/node@2.0.0-alpha.3
Patch Changes
#1896
5433f40Thanks @felixweinberger! - Markhonopeerdependency as optional.
@modelcontextprotocol/nodeonly usesgetRequestListenerfrom@hono/node-server(Node HTTP ↔ Web Standard conversion), which does not require thehonoframework at runtime. Consumers no longer need to installhonoto useNodeStreamableHTTPServerTransport. Note:@hono/node-serveritself still declareshonoas a hard peer, so package managers may emit a warning; this is upstream and harmless forgetRequestListener-only usage.#1898
2a7611dThanks @felixweinberger! - Add top-leveltypesfield (and
typesVersionson client/server for their subpath exports) so consumers on legacymoduleResolution: "node"can resolve type declarations. Theexportsmap remains the source of truth fornodenext/bundlerresolution. ThetypesVersionsmap includes entriesfor subpaths added by sibling PRs in this series (
zod-schemas,stdio); those entries are no-ops until the correspondingdist/*.d.mtsfiles exist.Updated dependencies [
434b2f1,db83829,42cb6b2,df4b6cc,2a7611d,e15a8ef,96db044,9fc9070,55b1f06,b256546]:@modelcontextprotocol/core@2.0.0-alpha.2
Minor Changes
#1974
db83829Thanks @felixweinberger! - Add custom (non-spec)method support: a 3-arg
setRequestHandler(method, schemas, handler)/setNotificationHandler(method, schemas, handler)form for vendor-prefixed methods, and arequest(req, resultSchema)overload (also onctx.mcpReq.send) for typed custom-method results. Spec-methodcalls are unchanged.
Response result-schema validation failure now rejects with
SdkError(InvalidResult)instead of a rawZodError. AddsSdkErrorCode.InvalidResult.Patch Changes
#1930
bdfd7f0Thanks @Christian-Sidak! - FixrequestStreamtocall
tasks/resultfor failed tasks instead of yielding a hardcodedProtocolError. When a task reaches thefailedterminal status, the stream now retrieves and yields the actual stored result (matching the behavior forcompletedtasks), as required by the spec.#1901
e15a8efThanks @felixweinberger! -registerTool/registerPromptaccept a raw Zod shape ({ field: z.string() }) forinputSchema/outputSchema/argsSchemain addition to a wrapped Standard Schema. Raw shapes are auto-wrapped withz.object(). The raw-shape overloads are@deprecated; prefer wrappingwith
z.object().Also widens the
completable()constraint fromStandardSchemaWithJSONtoStandardSchemaV1so v1'scompletable(z.string(), fn)continues to work.#1976
55b1f06Thanks @felixweinberger! - refactor: subclassesoverride
_wrapHandlerhook instead of redeclaringsetRequestHandler.#1768
866c08dThanks @felixweinberger! - Allow additional JSONSchema properties in elicitInput's requestedSchema type by adding .catchall(z.unknown()), matching the pattern used by inputSchema. This fixes type incompatibility when using Zod v4's .toJSONSchema() output which includes extra properties like $schema and additionalProperties.
#1895
b256546Thanks @felixweinberger! - Fix runtime crash ontools/listwhen a tool'sinputSchemacomes from zod 4.0–4.1. The SDK requires~standard.jsonSchema(StandardJSONSchemaV1, added in zod 4.2.0); previously a missingjsonSchemacrashed atundefined[io].standardSchemaToJsonSchemanow detects zod 4 schemas lackingjsonSchemaand falls back to the SDK-bundledz.toJSONSchema(), emitting a one-time console warning. zod 3 schemas (which the bundled zod 4 converter cannot introspect) and non-zod schema libraries withoutjsonSchemaget a clear error pointing tofromJsonSchema(). Theworkspace zod catalog is also bumped to
^4.2.0.