Skip to content

Support client input in MCP toolkit and resource handlers - #10443

Open
nmnmcc wants to merge 4 commits into
Effect-TS:mainfrom
nmnmcc:codex/mcp-core-roundtrips
Open

nmnmcc wants to merge 4 commits into
Effect-TS:mainfrom
nmnmcc:codex/mcp-core-roundtrips

Conversation

@nmnmcc

@nmnmcc nmnmcc commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

MCP workflows may need a confirmation, root listing, or other client input before finishing. This lets Toolkit and resource handlers participate through explicit toolkit(toolkit, { handlers }) and registerToolkit overloads, with inferred handler requirements. Resource, template, and prompt helpers can return McpSchema.InputRequired.

Modern clients receive input_required and retry the operation through multi round-trip requests. Legacy clients answer supported reverse requests inside the original middleware lifetime, preserving authentication, cancellation, deadlines, and finalizers. Defaults allow 16 rounds and 60 seconds per reverse request. Unsupported inputs and legacy state-only continuations fail before sending the round.

MissingRequiredClientCapability preserves its requirement data, returning modern HTTP 400 before the response starts or legacy InvalidParams. On main, ordinary one-argument Toolkit encoding remains unchanged, including business values resembling MCP control results. The state protection PR also preserves next-minor's separate support for explicitly declared InputRequired failures.

.changeset/mcp-handler-input.md declares an effect patch for these compatible additions. State protection is a separate minor change; whole-round sampling-history validation is covered by #10447.

Regression coverage: the explicit handler previously returned complete instead of input_required; resource helpers failed internally, and capability errors returned HTTP 200. Tests cover those paths, ordinary Toolkit compatibility, legacy/modern transports, and inferred handler/service types.

Dependencies: #10441. The upstream diff includes these prerequisites; Focused comparison.

Verification

Target: Effect-TS/effect:main. Validated head: 5501b3f84c5d55936fc617be2053e2f74592c191.

  • Passed: pnpm check, pnpm check-tsc, lint, JSDoc checks, full Tstyche/doctest suites, circular checks, AI-doc generation, package build with stripInternal: true, and distribution-type checks.
  • Full configured Node suite: Test Files 616 passed | 1 skipped (617); Tests 17461 passed | 15 expected fail | 108 skipped (17584).
  • Node 26.12.1 / pnpm 11.20.0; four Node workers and two doctest workers. Database integration tests enabled; MSSQL disabled as in CI; opt-in cluster suite excluded. Hosted CI results are separate.
  • Tests/doctests used --run with explicit files. Generated docs were unchanged; temporary build configuration was restored.

@changeset-bot

changeset-bot Bot commented Nov 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5501b3f

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

This PR includes changesets to release 33 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

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

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.55 KB 39.55 KB 0.00 KB (0.00%)
basic.ts 7.31 KB 7.31 KB 0.00 KB (0.00%)
batching.ts 11.13 KB 11.13 KB 0.00 KB (0.00%)
brand.ts 6.97 KB 6.97 KB 0.00 KB (0.00%)
cache.ts 11.61 KB 11.61 KB 0.00 KB (0.00%)
config.ts 22.98 KB 22.98 KB 0.00 KB (0.00%)
differ.ts 22.13 KB 22.13 KB 0.00 KB (0.00%)
http-client.ts 27.14 KB 27.14 KB 0.00 KB (0.00%)
http-router.ts 37.05 KB 37.05 KB 0.00 KB (0.00%)
logger.ts 12.07 KB 12.07 KB 0.00 KB (0.00%)
metric.ts 9.54 KB 9.54 KB 0.00 KB (0.00%)
optic.ts 7.17 KB 7.17 KB 0.00 KB (0.00%)
pubsub.ts 16.08 KB 16.08 KB 0.00 KB (0.00%)
queue.ts 12.96 KB 12.96 KB 0.00 KB (0.00%)
schedule.ts 11.86 KB 11.86 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.23 KB 14.23 KB 0.00 KB (0.00%)
schema-binary.ts 42.17 KB 42.17 KB 0.00 KB (0.00%)
schema-class.ts 21.87 KB 21.87 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 29.83 KB 29.83 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.14 KB 28.14 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.44 KB 15.44 KB 0.00 KB (0.00%)
schema-string.ts 12.43 KB 12.43 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.35 KB 16.35 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.09 KB 39.09 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.28 KB 26.28 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.20 KB 21.20 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.30 KB 21.30 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.31 KB 26.31 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.37 KB 21.37 KB 0.00 KB (0.00%)
schema.ts 20.97 KB 20.97 KB 0.00 KB (0.00%)
stm.ts 14.27 KB 14.27 KB 0.00 KB (0.00%)
stream.ts 10.44 KB 10.44 KB 0.00 KB (0.00%)

@nmnmcc nmnmcc changed the title Support MCP input requests from toolkit and resource handlers Support client input in MCP toolkit and resource handlers Nov 7, 2026

This branch is waiting to be deployed

1 waiting deployment
fork — 5501b3f8 Waiting Nov 7, 2026 by nmnmcc via approval-gate #25354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant