-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Inspector Version
- 0.19.0
Describe the bug
When a tool is invoked as a task (with "Run as task" checked), the Run button on the Tools Tab is disabled for the entire duration of the task's polling cycle. This prevents users from running any other tool (whether as a normal call or as another task) while a task is in progress.
This behavior contradicts the MCP specification's intent for tasks. According to the [Tasks specification (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks), tasks are specifically designed to enable concurrent operations:
When a task is created in response to a
tools/callrequest, host applications may wish to return control to the model while the task is executing. This allows the model to continue processing other requests or perform additional work while waiting for the task to complete.
The specification's [Task-Augmented Tool Call With Elicitation flow](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks#task-augmented-tool-call-with-elicitation) also explicitly illustrates this pattern:
Note over LLM,C: Client continues processing other requests while task executes in background
LLM->>C: Request other operation
C->>LLM: Other operation result
The current implementation in ToolsTab.tsx sets isPollingTask to true during polling and uses it to disable the Run button, effectively serializing all tool operations. This makes it impossible to test real-world task use cases such as:
- Running a long-lived monitoring task (e.g.,
watch) while executing other diagnostic tools - Launching multiple concurrent tasks
- Interleaving normal tool calls with background tasks
Root Cause
In [PR #1013](#1013) ("Add Tasks support"), the following design choices cause this behavior:
- In
App.tsx, thecallToolfunction enters a blocking polling loop (whileloop withawait) that keepsisPollingTask = trueuntil the task reaches a terminal status. - In
ToolsTab.tsx, the Run button's disabled condition includesisPollingTask, preventing any tool execution during polling. - The polling state is global (single
isPollingTaskboolean), so even switching to a different tool won't allow execution.
To Reproduce
-
Connect to an MCP server that supports tasks
-
Go to the Tools tab
-
Select a tool, check "Run as task", and click "Run Tool"
-
While the task is running (status:
working, button shows "Polling Task..."), try to:- Select a different tool and click "Run Tool" → button is disabled
- Or try to run the same tool again → button is disabled
-
You must wait until the task completes, fails, or is cancelled before running any other tool
Expected behavior
According to the MCP specification, the Inspector (as a requestor/client) should allow users to:
- Run other normal tool calls while a task is being polled in the background
- Launch multiple concurrent tasks since the protocol supports this via unique task IDs
- Continue interacting with the Tools tab normally — the polling should happen asynchronously without blocking the UI
The polling loop should run in the background (e.g., managed independently per task), and the Run button should remain enabled for other operations. Task status and results could be tracked independently, perhaps with visual indicators showing which tasks are currently in progress.
Suggested approach
- Decouple the polling loop from the
callToolfunction — manage task polling independently (e.g., per-task polling via aMap<taskId, pollingState>) - Remove the
isPollingTaskcondition from the Run button's disabled logic - Allow the tool result area to show either the latest normal tool result or a task's live status, with the ability to switch between active tasks
- Consider showing a list/badge of active tasks on the Tools tab so users can monitor multiple concurrent tasks
Screenshots
Task running — Run button is disabled, showing "Polling Task..." with no way to execute other tools:
Environment
- OS: macOS
- Browser: Chrome
- Transport: Streamable HTTP
- Connection Type: Via Proxy
