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

Resolved 💬 9 comments Opened Jan 16, 2026 by Butanium 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 ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗