FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(server): accept Standard Schemas in inputRequired.elicit by mattzcarey · Pull Request #2369 · modelcontextprotocol/typescript-sdk · GitHub

feat(server): accept Standard Schemas in inputRequired.elicit - #2369

Merged
felixweinberger merged 16 commits into
mainfrom
feat/elicitation-standard-schema
Jul 9, 2026
Merged

feat(server): accept Standard Schemas in inputRequired.elicit#2369
felixweinberger merged 16 commits into
mainfrom
feat/elicitation-standard-schema

Conversation

mattzcarey commented Jun 25, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes #662.

Summary

  • allow inputRequired.elicit() to accept a Standard Schema/Zod object as requestedSchema
  • convert that schema to MCP's restricted form-elicitation JSON Schema
  • reuse the same schema with acceptedContent() to validate and type the response on handler re-entry
  • keep deprecated Server.elicitInput() and ctx.mcpReq.elicitInput() unchanged
  • reject converted validation constraints that MCP form elicitation cannot express instead of weakening them silently
  • preserve the raw JSON Schema input path unchanged

The modern write-once handler works on 2026-07-28 natively and on 2025-era connections through the existing legacy input_required shim.

Release

  • @modelcontextprotocol/core-internal: minor
  • @modelcontextprotocol/server: minor
  • no client package change

Verification

  • core-internal tests: 1,327 passed
  • server tests: 439 passed
  • modern input_required integration coverage
  • 2025 legacy-shim integration coverage
  • core-internal/server typechecks
  • examples typecheck
  • client/server builds
  • dist declaration smoke with skipLibCheck: false
  • snippet sync check
  • pre-push full build, typecheck, and lint

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

changeset-bot Bot commented Jun 25, 2026
edited
Loading

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ea34a7d

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

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/core-internal Minor
@modelcontextprotocol/server 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 Bot commented Jun 25, 2026
edited
Loading

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: ea34a7d

Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/server.ts Outdated
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

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

SGTM

Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/server.ts Outdated
mattzcarey force-pushed the feat/elicitation-standard-schema branch from 918c601 to a300f51 Compare July 1, 2026 09:18
Comment thread packages/server/src/server/server.ts Outdated
Comment thread packages/server/src/server/server.ts Outdated
mattzcarey force-pushed the feat/elicitation-standard-schema branch from 7908e11 to 15e6243 Compare July 6, 2026 18:36
mattzcarey force-pushed the feat/elicitation-standard-schema branch from 15e6243 to 12eb9e5 Compare July 6, 2026 19:01
mattzcarey enabled auto-merge (squash) July 6, 2026 19:02

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Mostly wondering if we should be updating the elicitInput API given we want people to use inputRequired for MRTR going forward.

Comment thread packages/server/src/server/server.ts Outdated
mattzcarey disabled auto-merge July 7, 2026 08:32
mattzcarey force-pushed the feat/elicitation-standard-schema branch from 12eb9e5 to 481c112 Compare July 7, 2026 08:55
mattzcarey changed the title feat(server): accept Standard Schemas for elicitation feat(server): accept Standard Schemas in inputRequired.elicit Jul 7, 2026
felixweinberger merged commit 24be404 into main Jul 9, 2026
20 checks passed
felixweinberger deleted the feat/elicitation-standard-schema branch July 9, 2026 10:04
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Zod schema with Elicitation?

2 participants


Back | FazBrowse Home | New Git URL