Re-verified against the TypeScript reference at its current main: the
missing-capability shape is now a -32021 protocol error on both servers
on 2026-07-28 connections (README fidelity note updated), the TS entry's
protected HTTP wiring is matched by the SDK's streamable HTTP defaults
(noted in server.py), and 2026-era watchers are pointed at the client's
listen() driver. Also renames the module-level task store so the
add_tasks parameter no longer shadows it, folds the brainstorm outcome
union into one alias, types the log threshold as LoggingLevel, and
makes comments and docstrings ASCII-only.
Rewrite clear_done, prioritize, and brainstorm_tasks from hand-rolled
InputRequiredResult state machines onto Resolve dependencies, now that
Sample landed alongside Elicit: the framework carries the rounds on
2026-07-28 connections and push-style requests on pre-2026 ones, seals
the multi-round state, validates answers against the form schemas, and
gates on client capabilities. This deletes the example's local legacy
fulfilment driver, literal schema dicts, and JSON step state.
The elicitation forms render byte-identical to the TypeScript
reference's literals; the count-form theme field advertises its default
via json_schema_extra while staying nullable, so an omitted answer
still falls back to the tool argument like the reference. Resolver
outcomes, not board recounts, drive the empty-board paths so concurrent
mutations cannot desync the resolver from the tool body.
A Python port of the TypeScript SDK's examples/todos-server: a small
project todo board where every server-side MCP feature has a real job —
CRUD tools, structured output, resources and a task template, prompts
with completions, sampling- and elicitation-backed interactive tools
written once as input_required state machines with a legacy fulfilment
driver, progress, request-tied logging, and per-resource subscriptions —
served to both protocol revisions over stdio and Streamable HTTP.
Python's $ with re.match also matches just before a single trailing newline, so tool-name validation accepted "name\n" and UriTemplate.parse accepted varnames like "foo\n". Switch both checks to re.fullmatch.
Closes#3084