Feature Request: Support MCP Task Mode (SEP-1686) for Background Tool Execution

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Jan 16, 2026 · closed Apr 7, 2026

Feature Request: Support MCP Task Mode (SEP-1686) for Background Tool Execution

Summary

Add client-side support for SEP-1686 Tasks, enabling MCP tools to run in background mode similar to how Bash commands support run_in_background.

Problem

Currently, MCP tool calls in Claude Code are synchronous and blocking. When Claude calls a long-running MCP tool (e.g., executing a Jupyter notebook cell that trains a model for 10 minutes), the entire conversation blocks until completion.

This is inconsistent with how Bash commands work - they support run_in_background: true which returns immediately and notifies when complete. MCP tools have no equivalent mechanism, even though the protocol now supports it.

Use Case: Research Workflows with Jupyter/IPython

I use an MCP server (scribe-notebook) that provides Jupyter kernel execution. Common workflow:

  1. Claude executes a cell that runs an experiment (5-30 minutes)
  2. Currently: Claude is blocked, I wait, context is wasted
  3. Desired: Claude continues working on other tasks, gets notified when cell completes

This pattern applies to any MCP server wrapping long-running operations:

  • ML training/inference
  • CI/CD pipelines
  • Database migrations
  • Browser automation
  • External API workflows

Solution: Implement SEP-1686 Client Support

SEP-1686 ("Tasks") is an accepted MCP specification that adds:

  1. Task-augmented mode: Client requests a task ID instead of blocking
  2. Progress notifications: Server streams status updates
  3. Result retrieval: Client fetches results when ready

FastMCP 2.14+ already implements server-side support via @mcp.tool(task=True):

@mcp.tool(task=True)
async def execute_code(session_id: str, code: str, progress: Progress = Progress()):
    await progress.set_message("Executing cell...")
    result = await run_cell(session_id, code)
    await progress.set_message("Done")
    return result

The server is ready - Claude Code just needs to:

  1. Send progressToken in tool requests to opt into task mode
  2. Handle task IDs returned instead of blocking
  3. Display progress notifications (like Bash background tasks do)
  4. Allow continuing conversation while task runs

Proposed UX

Similar to Bash background commands:

Claude: I'll execute this training cell in the background.
[MCP tool running in background with ID: abc123]

Claude: While that runs, let me review your test file...

[Task notification: abc123 completed]

Claude: The training finished. Let me check the results...

Why This Matters

  1. Consistency: Bash has run_in_background, MCP tools should too
  2. Efficiency: Don't waste context window on blocking waits
  3. Protocol alignment: SEP-1686 is accepted, servers are implementing it
  4. Research workflows: Long-running experiments are common in ML/research

Related Issues

  • #1478 - MCP Notification-Driven Auto-Resume (closed as not planned, but predates SEP-1686)
  • #1759 - Implementing background tasks via MCP servers
  • #8712 - Background execution of MCP tools

References

View original on GitHub ↗

9 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8712
  2. https://github.com/anthropics/claude-code/issues/1759
  3. https://github.com/anthropics/claude-code/issues/1478

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

MaxKless · 6 months ago

Any input here?
Tasks are a great feature of MCP and claude code should stick as close to being a reference client as possible, right?

phas02 · 6 months ago

We would love to see this too. Tasks are perfect for a great User Experience during long running tasks, like running local data pipelines with sensitive data, or whatever takes longer than 30 seconds to run.

phas02 · 6 months ago

Analyzed what's needed — the MCP TypeScript SDK bundled into cli.js already has full SEP-1686 support (callToolStream(), getTask(), getTaskResult(), polling loop, all schemas). The application layer just never calls it. Implementation analysis with scope assessment and UX proposal modeled on the existing run_in_background pattern: https://gist.github.com/phas02/53c4c7f355916f880d2b26a2df661bfc

JVenberg · 5 months ago

Worth noting there's a much simpler approach that could work alongside SEP-1686 — and it wouldn't require any protocol or server changes.

The Bash tool already has run_in_background. Claude Code intercepts that param before execution, backgrounds the command, and notifies when it's done. The shell never sees the parameter. The same pattern could be applied to MCP tools:

  • Claude Code injects a virtual run_in_background into MCP tool schemas
  • When the model sets it to true, Claude Code strips it from the input before forwarding to the MCP server
  • The call gets dispatched in the background, server processes it normally without knowing anything changed
  • Claude gets notified when the response comes back, same as background Bash

This would work with every existing MCP server without any changes. I hit this building a Splunk MCP server where queries scan hundreds of millions of events and take 5-10 min. Right now the workarounds are all bad — async job/poll patterns in the server, background agents that can't get permissions, or just shelling out with curl.

SEP-1686 is the better long-term solution since it enables progress streaming from the server, but client-side backgrounding could ship now and cover the common case

KevinT3Hu · 5 months ago

Surprises me that Claude Code does not support this since I always considered Claude Code to be the reference MCP client implementation

github-actions[bot] · 4 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

Butanium · 4 months ago

🤌🤌🤌🤌

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.