# MCP Tasks

> Run a long MCP tool in the background and return to it when it finishes or needs input.

Start a tool on a configured MCP server, continue the conversation while it runs,
and return to the task when it finishes or needs your input. AgentPolyfill
implements the client side of [SEP-2663](https://github.com/modelcontextprotocol/ext-tasks/blob/cc9aaac1047a9440b07486e38f37060bbebeef4c/seps/2663-tasks-extension.md)
for MCP revision 2026-07-28. The server also needs to advertise the extension.

The Codex, Pi, OpenCode, Hermes and T3 Code with Pi integrations, and Copilot
CLI’s opt-in fallback, return to the session when a task finishes or needs
input. Muse Code and Grok Bot start, check and cancel allowlisted jobs; ask
for the status to get the result. [A2A delegation](https://agentpolyfill.com/guide/a2a.md) uses the same Tasks
client.

## Install

### Claude Code

No plugin is needed. Claude Code supports MCP Tasks itself in eligible
profiles. [Anthropic’s requirements and UI limits](https://code.claude.com/docs/en/mcp#mcp-tasks-in-vs-code-and-the-desktop-app).

### Codex

```sh
codex plugin marketplace add idosal/AgentPolyfill
codex plugin add mcp-tasks@agent-polyfill
```

Requires Codex 0.172+ and Node 20+. For a local checkout, pass its path to
`codex plugin marketplace add`. [Codex setup, limits and walkthrough](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/codex).

### Pi

Install the AgentPolyfill Pi package, or install Tasks on its own from a clone.

```sh
pi install git:github.com/idosal/AgentPolyfill
# From a checkout, just Tasks
pi install ./polyfills/tasks/pi/extension
```

Requires Pi 1.6+ and Node 22+. [Pi setup, limits and walkthrough](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/pi).

### T3 Code with Pi

Install the Pi Tasks extension in the Pi profile that T3 Code uses and choose Pi
as the thread’s provider. T3 displays start approvals and task questions in its
composer. Keep the session open to receive the result in the same thread.
[T3 setup, limits and walkthrough](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/t3).

### GitHub Copilot CLI

Experimental CLI 1.0.115 and 1.0.116 start and poll tasks natively. The plugin
stays idle unless you set `MCP_TASKS_FALLBACK=1` in a profile that needs it.

```sh
copilot plugin marketplace add idosal/AgentPolyfill
copilot plugin install mcp-tasks@agent-polyfill
copilot --experimental
```

Requires Copilot CLI 1.0.115+ and Node 20+. [Copilot setup, limits and walkthrough of the fallback](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/copilot).

### OpenCode

Tasks isn't installed with `opencode plugin add`. For OpenCode 2.4.1+, add the
absolute path of `polyfills/tasks/opencode/plugin` from your clone to the
`plugins` array in OpenCode's configuration:

```json
{
  "plugins": ["/path/to/AgentPolyfill/polyfills/tasks/opencode/plugin"]
}
```

Open the project in the terminal or in OpenCode Desktop. In the global
configuration, Desktop loads it for every project.

- **Terminal (2.4.1):** checked with a declined start, an approved start, a
  wake and a typed answer that reached the server.
- **Desktop (2.4.2):** checked with a declined start, an approved start, the
  input notification, a typed JSON answer and the result in the original
  thread. Desktop loads the plugin through its experimental GUI plugin entry
  point, and only a focused window showing that session can answer.

[OpenCode setup, limits and walkthroughs](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/opencode).

### Hermes

Copy the contents of `polyfills/tasks/hermes/plugin/` into
`$HERMES_HOME/plugins/mcp-tasks/`, add `mcp-tasks` to `plugins.enabled`, and
name its allowed servers:

```yaml
plugins:
  entries:
    mcp-tasks:
      settings:
        servers: [jobs]
      allow_gateway_injection: true
```

Restart the gateway with Node 22 on its `PATH`. In the gateway, use
`/mcp-tasks servers` to discover servers. Its viewer shows the complete start
request and asks you to confirm typed task answers. Checked in Hermes 0.23.4.
[Hermes setup, limits and walkthrough](https://github.com/idosal/AgentPolyfill/tree/main/polyfills/tasks/hermes).

### Muse Code

Install `mcp-task-monitor` as in [Getting started](https://agentpolyfill.com/guide/getting-started.md#muse-code).
Tasks starts with an empty allowlist. List each server and the jobs you allow
in `plugins/data/mcp-task-monitor/sources.json`. For example:

```json
{
  "sources": { "jobs": "https://jobs.example/mcp" },
  "tools": { "jobs": ["slow_report"] }
}
```

In a new session, each allowed job appears as a tool. Ask Muse to run it, keep
the handle, and check the result. Muse doesn't answer a job’s questions, and
isn’t woken when a job finishes. Handles last for the plugin’s process, at
most one hour. Checked in Muse Code 1.4.25: a job on an independent FastMCP server
returned 85. [Muse job recording](https://github.com/idosal/AgentPolyfill/blob/8ee83e69/docs/media/demos/muse-grok/muse-tasks.mp4)
· [Muse Tasks setup](https://github.com/idosal/AgentPolyfill/blob/main/docs/muse-grok.md#run-a-task).

### Grok Bot

Run the bundled Tasks server with an allowlist, in the same JSON form as for
Muse Code, and add it as a custom connector in **Connect apps**. Each
connector is shared across the account. For Remote HTTPS, set
`AGENTPOLYFILL_TOKEN` to a long random token from your service manager’s
secret store, then run:

```sh
PORT=8788 node polyfills/tasks/muse/plugin/dist/server.mjs --http --config /absolute/path/tasks.json
```

Put HTTPS in front of the loopback listener. In Grok, choose **Connect apps →
Add a custom connector → Remote HTTPS**, enter the URL ending in `/mcp`, and
add the header `Authorization: Bearer <token>`. For a public publisher, a
**Command** connector on the Bot’s computer is also documented.

Ask for a job and its receipt, then ask again for its status. The connector
can start, check and cancel jobs it started. It doesn’t answer a job’s
questions, and Grok isn’t woken when a job finishes. Checked in Grok Bot
1.3.0 with Remote HTTPS: the Bot returned 85 and the publisher’s job receipt.
[Grok job recording](https://github.com/idosal/AgentPolyfill/blob/8ee83e69/docs/media/demos/muse-grok/grok-tasks.mp4)
· [Grok Tasks setup](https://github.com/idosal/AgentPolyfill/blob/main/docs/muse-grok.md#set-up-grok-bot).

In a separate test of interactive Tasks, Grok Bot advertised MCP form elicitation.
The connector sent two questions. Grok returned `decline` for both, and neither
question appeared in the chat. Answering a running job’s questions inside
Grok Bot remains unverified.

## Try it

Ask which of your MCP servers can run tasks. If a server offers a task-capable
tool, ask the agent to start it and review the server, tool and arguments in
the approval dialog. You can check its status or cancel it with the task ID.
In Muse Code and Grok Bot, ask for one of your allowlisted jobs instead.

The plugin makes a separate connection to each eligible MCP server. That
connection cannot reuse your host's OAuth sign-in.

[Remaining Tasks hosts](https://github.com/idosal/AgentPolyfill/blob/main/polyfills/tasks/host-coverage.md)
records the checks in each host, including VS Code’s Copilot Chat and
Antigravity, which have no AgentPolyfill Tasks integration.

---

This page on the web: https://agentpolyfill.com/guide/tasks
