Repository navigation
[mcp-2026] Hide tasks on 2026 wire until tasks/update exists #25
Description
Context
PR #21 registered a Tasks surface that does not match 2026-07-28 (SEP-2663 needs tasks/get + tasks/update + tasks/cancel).
Today (nitrostack/core/app.py _register_task_handlers):
- Registers
tasks/list,tasks/get,tasks/cancel,tasks/result - Sets
server.has_task_support = Trueunconditionally - Discover advertises
io.modelcontextprotocol/tasksonly if a tool hastask_supportoptional/required (_advertise_tasks_extension) — so low-level capabilities and discover can disagree - No
tasks/update tasks/resultandtasks/listare inMODERN_METHOD_CONTRACTSand only rejected when era ismodern;autostill serves themcore/task.pyTaskStatusincludesexpired;tasks/types.pyterminal set iscompleted|failed|cancelledTaskStatusRouterinnitrostack/tasks/notify.pyhas no production callersInFlightRegistryisregister/discardontools/call; nothing handlesnotifications/cancelledso cancel is deadcreate_taskids aretask_+ 12 hex charsInMemoryTaskStoreis an unlocked dictcheck_task_access(context=None)returns (isolation bypass if HTTP forgetsrequest_ctx)ttl_ms_to_secondsusesmax(1, int(ttl_ms/1000))(500ms → 1s)- Tool
task_support == "required"raisesINVALID_REQUEST, not-32021
Official Python mcp SDK skipped Tasks. Default for this issue: hide tasks on the 2026 wire. Do not implement full tasks/update unless product explicitly asks in this issue’s comments.
Handoff: #21 (comment)
Goal (Hide)
Auto/modern:
- Do not advertise tasks extension
- Do not register
tasks/* tools/callwithparams.task→ error (-32021or invalid-params: server does not support tasks), notCreateTaskResult
Keep TaskManager / @tool(task_support=...) for in-process and era legacy if those tests still need them.
Probe
rg -n "add_request_handler\(\"tasks/|has_task_support|_advertise_tasks_extension|tasks/update" nitrostack
rg -n "TaskStatusRouter|notify_task_status" nitrostack
rg -n "InFlightRegistry|_in_flight" nitrostackRead:
nitrostack/core/app.py—_register_task_handlers,_call_tooltask branch,_advertise_tasks_extensionnitrostack/core/mcp_server.py—has_task_support→caps.tasksincluding listnitrostack/protocol/method_contract.py— tasks rowsnitrostack/core/task.pyvsnitrostack/tasks/types.pynitrostack/tasks/notify.py,nitrostack/tasks/authorization.py,nitrostack/tasks/memory.pytests/test_mcp20_tasks.py,tests/test_tasks.py,tests/test_mcp20_task_authorization.py
Implementation (Hide — do this)
has_task_support = Falseon auto/modern. Do not set True unconditionally.- Do not register
tasks/list,tasks/result,tasks/get,tasks/cancelon auto/modern. - Discover:
advertise_tasks=Falseon auto/modern (even if tools havetask_supportflags). _call_tool: if era is auto/modern andtask_metadatais present →-32021(once WP2 adds the code) or-32602with a clear message. Do not spawnTaskManagerbackground work for HTTP 2026.- Remove
tasks/result/tasks/listfrom any “live modern methods” table (WP2 owns the table; coordinate). notify.py: delete if still unhooked, or leave unused only if Hide makes it obviously dead — prefer delete to avoid a fake fan-out.InFlightRegistry: if cancel is still unwired, delete register/discard on the 2026 path or wirenotifications/cancelled. Do not leave a registry tests poke that HTTP never cancels.
Legacy era: you may keep existing task handlers if tests/test_tasks.py depends on them. Do not expand 2025 task list onto 2026.
Do not do “Finish” in this issue
Finish would mean tasks/get + tasks/update + tasks/cancel, no list/result on modern, one status enum, store lock, UUID ids, access context always passed, notify hooked, -32021 for capability mismatches. That is a separate product epic. If you start Finish, you must complete it — do not ship half.
Test / verify
pytest tests/test_mcp20_tasks.py tests/test_tasks.py tests/test_mcp20_task_store.py tests/test_mcp20_task_authorization.py -qThose files likely expect 2026 task RPCs. Update them to match Hide:
- HTTP
TestClient, era modern/auto:tasks/get/tasks/list/tasks/result→-32601 - Discover capabilities: no
io.modelcontextprotocol/tasks tools/callwithtask: {}on modern → not a task result- Keep in-process
TaskManagerunit tests if the class remains
Add one test that get_capabilities does not include tasks for a modern/auto app.
Review
- No new task persistence backend.
- Discover and
has_task_supportagree (both off on 2026). - No silent
CreateTaskResulton modern.
Success
- Auto/modern: no
tasks/*handlers, no tasks extension in discover - Auto/modern: task-augmented
tools/calldoes not return TaskData -
has_task_supportnot unconditionally True - Unhooked
TaskStatusRouternot advertised as live - Updated tests pass; do not keep tests that require ping-era sidecar task intercept
Related
Depends on WP0 (who handles /mcp) and WP2 (-32021, method table). Do not block on a full Tasks spec implementation.
Activity