You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Standard Schema for tool and prompt schemas
8
+
9
+
Tool and prompt registration now accepts any schema library that implements the [Standard Schema spec](https://standardschema.dev/): Zod v4, Valibot, ArkType, and others. `RegisteredTool.inputSchema`, `RegisteredTool.outputSchema`, and `RegisteredPrompt.argsSchema` now use `StandardSchemaWithJSON` (requires both `~standard.validate` and `~standard.jsonSchema`) instead of the Zod-specific `AnySchema` type.
10
+
11
+
**Zod v4 schemas continue to work unchanged** — Zod v4 implements the required interfaces natively.
-`experimental.tasks.getTaskResult()` no longer accepts a `resultSchema` parameter. Returns `GetTaskPayloadResult` (a loose `Result`); cast to the expected type at the call site.
33
+
- Removed unused exports from `@modelcontextprotocol/core`: `SchemaInput`, `schemaToJson`, `parseSchemaAsync`, `getSchemaShape`, `getSchemaDescription`, `isOptionalSchema`, `unwrapOptionalSchema`. Use the new `standardSchemaToJsonSchema` and `validateStandardSchema` instead.
34
+
-`completable()` remains Zod-specific (it relies on Zod's `.shape` introspection).
The variadic `.tool()`, `.prompt()`, `.resource()` methods are removed. Use the `register*` methods with a config object.
211
211
212
-
**IMPORTANT**: v2 requires full Zod schemas — raw shapes like `{ name: z.string() }` are no longer supported. You must wrap with `z.object()`. This applies to `inputSchema`, `outputSchema`, and `argsSchema`.
212
+
**IMPORTANT**: v2 requires schema objects implementing [Standard Schema](https://standardschema.dev/)— raw shapes like `{ name: z.string() }` are no longer supported. Wrap with `z.object()` (Zod v4), or use ArkType's `type({...})`, or Valibot. For raw JSON Schema, wrap with `fromJsonSchema(schema, validator)` from `@modelcontextprotocol/core`. Applies to `inputSchema`, `outputSchema`, and `argsSchema`.
213
213
214
214
### Tools
215
215
@@ -279,13 +279,22 @@ Note: the third argument (`metadata`) is required — pass `{}` if no metadata.
### Zod schemas required (raw shapes no longer supported)
223
+
### Standard Schema objects required (raw shapes no longer supported)
224
224
225
-
v2 requires full Zod schemas for `inputSchema`and `argsSchema`. Raw object shapes are no longer accepted.
225
+
v2 requires schema objects implementing the [Standard Schema spec](https://standardschema.dev/)for `inputSchema`, `outputSchema`, and `argsSchema`. Raw object shapes are no longer accepted. Zod v4, ArkType, and Valibot all implement the spec.
|`getSchemaShape`, `getSchemaDescription`, `isOptionalSchema`, `unwrapOptionalSchema`| No replacement — these are now internal Zod introspection helpers |
279
+
259
280
### Host header validation moved
260
281
261
282
Express-specific middleware (`hostHeaderValidation()`, `localhostHostValidation()`) moved from the server package to `@modelcontextprotocol/express`. The server package now exports framework-agnostic functions instead: `validateHostHeader()`, `localhostAllowedHostnames()`,
0 commit comments