Title: Pass InputRequiredResult through the MCPServer prompt and resource pipelines by maxisbey · Pull Request #3020 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Pass InputRequiredResult through the MCPServer prompt and resource pipelines by maxisbey · Pull Request #3020 · modelcontextprotocol/python-sdk
X Title: Pass InputRequiredResult through the MCPServer prompt and resource pipelines by maxisbey · Pull Request #3020 · modelcontextprotocol/python-sdk
Description: Motivation and Context input-required-result-non-tool-request was the last waived server conformance scenario: at 2026-07-28 a server MAY answer prompts/get and resources/read with an InputRequiredResult (SEP-2322 multi-round-trip requests), but only the tools/call pipeline passed one through from MCPServer — the prompt pipeline silently coerced it into a text message and the resource pipeline had no path for it. The low-level Server, the per-version result surfaces, and the client auto-loop (#2998) already supported all three methods, so this closes the gap at the one remaining tier, mirroring the tools pass-through from #2974: Prompt.render / MCPServer.get_prompt pass an InputRequiredResult returned by an @mcp.prompt() function through unchanged; the retry's answers arrive on ctx.input_responses, with ctx.request_state carrying the echoed state. ResourceTemplate.create_resource / MCPServer.read_resource do the same for @mcp.resource() template functions. Static resource functions can never read the retry (they take no Context), so FunctionResource.read now rejects an InputRequiredResult loudly instead of JSON-dumping it as resource text. Context.read_resource stays a pure content reader: an InputRequiredResult from a template raises a clear RuntimeError there. A handler that wants to receive and forward one as its own result calls MCPServer.read_resource(uri, context) directly, which carries the union. Era handling needed zero new code: the per-version result surfaces already reject the frame toward pre-2026 sessions with -32603, exactly as for tools. The everything-server gains the test_input_required_result_prompt fixture the scenario drives, and the waiver is removed from both expected-failures files — both server conformance baselines are now empty. How Has This Been Tested? The target scenario passes locally at the pinned harness (2/2 checks; previously failed round 1). All three CI server conformance legs run locally at the pin with the emptied baselines: active 42/42, draft 71/71, 2026-07-28 100/100 — zero failures, no stale entries. Full suite at 100% branch coverage. New tests cover the prompt/resource round trips through an in-memory Client, the seam pass-throughs (identity), both ctx.read_resource arcs, the static-resource rejection, and the legacy-session -32603 posture for both methods. mkdocs build --strict passes with the new docs section and runnable example. Coverage note: the scenario exercises prompts/get only — no conformance scenario currently drives resources/read returning InputRequiredResult, so the resource side is proven by the SDK test suite alone. Worth adding a scenario in the conformance repo. Breaking Changes Type-level, documented in docs/migration.md: MCPServer.get_prompt() / read_resource() (and Prompt.render() / ResourceTemplate.create_resource()) now return ... | InputRequiredResult; direct callers narrow with isinstance. ctx.read_resource() is unchanged — it still returns content, and now raises a clear RuntimeError if the resource requests input (forward via MCPServer.read_resource(uri, context) instead). Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context Part of #2891. With this change, .github/actions/conformance/expected-failures.yml and expected-failures.2026-07-28.yml are both fully empty — every scenario in the pinned conformance harness passes against the SDK with no waivers. AI Disclaimer
Open Graph Description: Motivation and Context input-required-result-non-tool-request was the last waived server conformance scenario: at 2026-07-28 a server MAY answer prompts/get and resources/read with an InputRequired...
X Description: Motivation and Context input-required-result-non-tool-request was the last waived server conformance scenario: at 2026-07-28 a server MAY answer prompts/get and resources/read with an InputRequired...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3020
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:891010e5-62db-529b-0484-0457907b1337 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A760:214CC0:C86589:108A96A:6A5B0855 |
| html-safe-nonce | 860dafa8ff04c8c2b6097a97adab6904ad917d478dd0a8f87b3745a1ec2ea129 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzYwOjIxNENDMDpDODY1ODk6MTA4QTk2QTo2QTVCMDg1NSIsInZpc2l0b3JfaWQiOiI2MjU0Njg2MTYzOTkzMDM2ODg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 020c068a9520d1765fdc009ddf84cf19b56e5d37bd195987b34f5ab07f7d6261 |
| hovercard-subject-tag | pull_request:3956504654 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/3020/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Motivation and Context input-required-result-non-tool-request was the last waived server conformance scenario: at 2026-07-28 a server MAY answer prompts/get and resources/read with an InputRequired... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width