You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimal version: branch in makeMcpExecute — task-required tools drain callToolStream to the terminal message; the terminal result is the same CallToolResult shape we already normalize (structuredContent / mcpContentToTanstack). Stop excluding them from discovery.
Optional second step: surface taskStatus updates through ToolExecutionContext.emitCustomEvent so UIs can render long-running tool progress in the transcript.
The tasks API lives under client.experimental.* ("may change without notice"). Wiring the core execution path of a brand-new package to unstable SDK surface means a routine SDK bump could break tool execution. The v1 exclusion only depends on stable spec types (Tool.execution.taskSupport).
Design questions to settle
Should taskSupport: 'optional' tools also route through tasks (the SDK server does auto-polling for optional), or stay on plain callTool?
On chat-run abort: drop the stream, or also call cancelTask?
Expose getTask / listTasks / cancelTask on the MCPClient surface?
Surface taskCreated/taskStatus as custom events in the chat stream (devtools/UI rendering)?
How to pin/guard against experimental API drift across SDK versions (peer-dep range, runtime feature detection)?
Context
#700 ships
@tanstack/ai-mcpwith plaincallTool()execution. The MCP spec's experimental tasks feature lets servers mark tools withexecution.taskSupport: 'required' | 'optional' | 'forbidden'. Task-required tools reject plaintools/callwith-32600("requires task-based execution") — e.g.simulate-research-queryon recent@modelcontextprotocol/server-everything.Current v1 behavior (since the task-required-tool fix on #700):
tools()auto-discovery excludes task-required tools (they could never succeed; offering them gives the model a guaranteed-failure tool).tools([toolDefinition(...)])throwsMCPTaskRequiredToolError.Proposal
Support task-based execution so these tools become usable instead of skipped. The SDK API is a clean fit for our execute proxy:
Minimal version: branch in
makeMcpExecute— task-required tools draincallToolStreamto the terminal message; the terminalresultis the sameCallToolResultshape we already normalize (structuredContent/mcpContentToTanstack). Stop excluding them from discovery.Optional second step: surface
taskStatusupdates throughToolExecutionContext.emitCustomEventso UIs can render long-running tool progress in the transcript.Why it was deferred from #700
The tasks API lives under
client.experimental.*("may change without notice"). Wiring the core execution path of a brand-new package to unstable SDK surface means a routine SDK bump could break tool execution. The v1 exclusion only depends on stable spec types (Tool.execution.taskSupport).Design questions to settle
taskSupport: 'optional'tools also route through tasks (the SDK server does auto-polling for optional), or stay on plaincallTool?cancelTask?getTask/listTasks/cancelTaskon theMCPClientsurface?taskCreated/taskStatusas custom events in the chat stream (devtools/UI rendering)?experimentalAPI drift across SDK versions (peer-dep range, runtime feature detection)?References
MCPTaskRequiredToolErrorintroduced in feat: host-side MCP client (@tanstack/ai-mcp) #700 (packages/ai-mcp/src/tools.tsrequiresTaskExecution(),packages/ai-mcp/src/client.tsdefs path)@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts(ExperimentalClientTasks.callToolStream)npx -y @modelcontextprotocol/server-everything→simulate-research-query🤖 Generated with Claude Code