MCP Tasks (SEP-2663)
fast-agent supports the modern MCP Tasks extension (io.modelcontextprotocol/tasks, protocol revision 2026-07-28) for long-running tool calls that may detach into the background or request interactive input (input_required).
How it works
- Foreground polling: When
tools/callreturnsresultType: "task",fast-agentpollstasks/getat the server's advisedpollIntervalMs. Polling alone is compliant with SEP-2663 (2026-07-28); no push subscription is needed. - Automatic detach and idle wake (interactive TUI only): On a persistent MCP connection, tasks that finish within
mcp.client.task_foreground_timeout_seconds(default30.0) return their validatedCallToolResultdirectly. Slower tasks detach and return a local handle such astask-1without exposing the server's bearertaskIdto the model. Background polling continues and queues an<mcp-task>update when the task reaches a terminal state or needs input. With wake enabled, that update starts a turn at the idle prompt. PTC (exec_sandbox), ACP, and non-interactive MCP tool calls wait for a terminal outcome rather than detaching on the timeout. - Interactive
input_required: Foreground tool calls,tasks(action="wait"),/tasks wait, and/tasks inputfulfillelicitation/createandsampling/createMessagerequests through the normal callbacks, then sendtasks/update. Time spent handling input does not count against the foreground wait budget. Background polling can detect that input is needed, but never opens prompts or approval links itself.
Configuration
Model tool (tasks)
When any attached server advertises io.modelcontextprotocol/tasks (or tracked tasks exist), the built-in tasks tool is exposed:
tasks(action="list")tasks(action="status", task_id="task-1")tasks(action="wait", task_id="task-1", wait_sec=30)tasks(action="cancel", task_id="task-1")tasks(action="wake", task_id="task-1", wake=true|false)
Inside PTC (exec_sandbox), await tasks(...) is also available.
Slash commands (/tasks)
Available in both the TUI and ACP:
/tasksor/tasks list— list active and recent MCP tasks/tasks status <handle>— refresh and show detailed status/result/tasks wait <handle> [seconds]— wait in the foreground (fulfillsinput_requiredif needed)/tasks input <handle>— fulfill outstandinginput_requiredprompts in the foreground/tasks cancel <handle>— cooperatively cancel a task/tasks wake <handle> [on|off]— toggle automatic idle-prompt wakeups/tasks clear— clear finished tasks from local history
Session persistence
In-flight tasks (and terminal tasks with unconsumed wake updates) are saved in session snapshots and resumed on --resume with their original opaque handles. Forked sessions clear mcp_tasks so forks never contend over live server task IDs.
Try it live (mcp-tasks.fast-agent.ai)
- Open the MCP Tasks playground to create a room. Copy its MCP URL and connect from a terminal. Set
task_foreground_timeout_secondsto2.0infastagent.config.yaml(see above) so the example job detaches before it finishes.
Ask for direct MCP tool calls, not calls through exec_sandbox, to exercise detachment.
- Detach and wake. Ask the agent to call
run_jobwithname="nightly-eval",mode="task",steps=12, andstep_ms=1500, then return to the prompt without waiting. Run/tasksto find the detached handle. With wake on, completion starts a new turn from the idle prompt. - Handle input. Ask the agent to call
deploy_releasewithservice="checkout-api",environment="prod", andapproval_mode="url"(or"form"). If the task detaches and reachesinput_required, use/tasks input task-<n>to handle the request in the foreground. For URL approval, open the link shown to you or use Open approval page in the dashboard. This is a demo: never enter real credentials. - Drive and cancel tasks. Ask the agent to call
open_manual_taskwithtitle="operator-gate". In the dashboard, use Emit progress, Request form, or Complete, then check/tasks status task-<n>in the terminal. Start another task and run/tasks cancel task-<n>while it is working. Cancellation is cooperative; use/tasks statusto check whether the server confirmed it. - Resume. Leave a detached manual task running, exit the TUI, and rerun the command above with
--resume latest(or--resume <session-id>). Use the same room URL and resume before the task expires./tasksshows the original handle; finish the task from the dashboard to see the wake after reconnecting.

