Skip to content

feat(server): accept Standard Schemas for elicitation#2369

Open
mattzcarey wants to merge 9 commits into
mainfrom
feat/elicitation-standard-schema
Open

feat(server): accept Standard Schemas for elicitation#2369
mattzcarey wants to merge 9 commits into
mainfrom
feat/elicitation-standard-schema

Conversation

@mattzcarey

Copy link
Copy Markdown
Contributor

Fixes #662.

Allows Server.elicitInput() and ctx.mcpReq.elicitInput() to accept a Standard Schema/Zod object as requestedSchema, converts it to the existing JSON Schema wire shape, and keeps JSON Schema input working unchanged.

Verification:

  • pnpm --filter @modelcontextprotocol/server test -- jsonSchemaValidatorOverride.test.ts
  • pnpm --filter @modelcontextprotocol/core typecheck
  • pnpm --filter @modelcontextprotocol/server typecheck
  • pnpm --filter @modelcontextprotocol/core lint
  • pnpm --filter @modelcontextprotocol/server lint
  • pnpm --filter @modelcontextprotocol/server build
  • pre-push hook: pnpm run typecheck:all, pnpm run build:all, pnpm run lint:all
  • git diff --check

@mattzcarey mattzcarey requested a review from a team as a code owner June 25, 2026 12:46
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 918c601

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@modelcontextprotocol/core-internal Minor
@modelcontextprotocol/server Minor
@modelcontextprotocol/client Minor
@modelcontextprotocol/express Major
@modelcontextprotocol/fastify Major
@modelcontextprotocol/hono Major
@modelcontextprotocol/node Major

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2369

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2369

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2369

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2369

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2369

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2369

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2369

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2369

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2369

commit: 918c601

Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/core-internal/src/shared/protocol.ts
Comment thread packages/core-internal/src/shared/protocol.ts
Comment thread packages/server/src/server/server.ts Outdated
Comment thread examples/server/src/serverGuide.examples.ts
@mattzcarey mattzcarey force-pushed the feat/elicitation-standard-schema branch from 01f43f4 to f732d6f Compare June 25, 2026 13:51
Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/server.ts Outdated
Comment thread examples/server/src/elicitationFormExample.ts

@felixweinberger felixweinberger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/elicitation.ts
Comment thread .changeset/standard-schema-elicitation.md
Comment thread examples/server/src/elicitationFormExample.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Zod schema with Elicitation?

2 participants