485 485
486To change or turn off automatic backgrounding:486To change or turn off automatic backgrounding:
487 487
488* Set the [`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) environment variable in milliseconds to change the threshold, or set it to `0` to turn automatic backgrounding off. With `0`, Claude also [waits for MCP tasks](#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive session488* Set the [`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) environment variable in milliseconds to change the threshold, or set it to `0` to turn automatic backgrounding off. With `0`, Claude also [waits for MCP tasks](#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive terminal session
489* Set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) to `1` to turn off automatic backgrounding and [background commands](https://code.claude.com/docs/en/tools-reference.md#background-commands)489* Set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) to `1` to turn off automatic backgrounding and [background commands](https://code.claude.com/docs/en/tools-reference.md#background-commands)
490 490
491Some calls never move to the background:491Some calls never move to the background:
492 492
493* Calls from [subagents](https://code.claude.com/docs/en/sub-agents.md); Claude Code backgrounds only main-conversation calls493* Calls from [subagents](https://code.claude.com/docs/en/sub-agents.md), except an [MCP task in the cloud](#mcp-tasks-in-the-cloud)
494* Calls to IDE servers494* Calls to IDE servers
495* Calls in [non-interactive mode](https://code.claude.com/docs/en/headless.md), unless `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, since a one-shot run can end before the result arrives495* Calls in [non-interactive mode](https://code.claude.com/docs/en/headless.md), unless `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, since a one-shot run can end before the result arrives
496 496
498 498
499### MCP tasks that run on the server499### MCP tasks that run on the server
500 500
501An MCP task is a long job, such as a report export or a build, that an MCP server runs itself using the [MCP tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview). Claude's tool call returns once the server accepts the job, so Claude keeps working unless you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task). When the job ends, the transcript says so and Claude gets the result. Ask Claude for it.501An MCP task is a long job, such as a report export or a build, that an MCP server runs itself using the [MCP tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview). In the main conversation, Claude's tool call returns once the server accepts the job, so Claude keeps working unless you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task). When the job ends, the transcript says so and Claude gets the result. Ask Claude for it.
502 502
503Meanwhile, the footer shows a count such as `1 MCP task`, and Claude Code follows the task by checking its status with the server. A task on a remote server keeps running after you exit. To follow it again, [resume the same session](#exit-clear-or-resume-while-an-mcp-task-runs).503Meanwhile, the footer shows a count such as `1 MCP task`, and Claude Code follows the task by checking its status with the server. A task on a remote server keeps running after you exit. To follow it again, [resume the same session](#exit-clear-or-resume-while-an-mcp-task-runs).
504 504
505> [!NOTE]505> [!NOTE]
506>506>
507> MCP tasks are in public beta and require Claude Code v2.1.304 or later. [What a call needs to become an MCP task](#requirements-for-mcp-tasks) lists the sessions and servers that get them.507> MCP tasks require Claude Code v2.1.304 or later. [What a call needs to become an MCP task](#requirements-for-mcp-tasks) lists the sessions and servers that get them.
508 508
509#### Stop an MCP task or get its result509#### Stop an MCP task or get its result
510 510
516MCP task <server task id> (<server>/<tool>) completed.516MCP task <server task id> (<server>/<tool>) completed.
517```517```
518 518
519The result goes to Claude, not into the transcript, so ask Claude for it. If Claude is idle when the result arrives, Claude starts on it unprompted.519The result goes to Claude, not into the transcript, so ask Claude for it. If Claude is idle when the result arrives, Claude starts on it unprompted. When a [subagent's call](#requirements-for-mcp-tasks) becomes a task in a terminal session, the subagent waits for the result.
520 520
521#### Answer a question from an MCP task521#### Answer a question from an MCP task
522 522
524 524
525Unless you've set Claude to [wait for the result](#make-claude-wait-for-the-result-of-an-mcp-task), press `Esc` in the dialog to answer later. To reopen the question, run `/tasks`, open the task's details, and press `Enter`. Answering later requires Claude Code v2.1.324 or later.525Unless you've set Claude to [wait for the result](#make-claude-wait-for-the-result-of-an-mcp-task), press `Esc` in the dialog to answer later. To reopen the question, run `/tasks`, open the task's details, and press `Enter`. Answering later requires Claude Code v2.1.324 or later.
526 526
527In a [non-interactive](https://code.claude.com/docs/en/headless.md) session, Claude Code asks the server to cancel a task that requests input, without running your [`Elicitation` hooks](https://code.claude.com/docs/en/hooks#elicitation) or calling the Agent SDK's `onElicitation` callback.527Outside an interactive terminal session, check whether you can answer, because some sessions cancel the task:
528
529* **[`claude -p`](https://code.claude.com/docs/en/headless) runs and Agent SDK sessions**: Claude Code asks the server to cancel the task, without running your [`Elicitation` hooks](https://code.claude.com/docs/en/hooks#elicitation) or calling the Agent SDK's `onElicitation` callback
530* **VS Code and local desktop app sessions**: see [MCP tasks in VS Code and the desktop app](#mcp-tasks-in-vs-code-and-desktop)
531* **Cloud sessions and claude.ai chats**: see [Answer an MCP task's question in the cloud](#mcp-task-questions-in-the-cloud)
528 532
529#### Exit, clear, or resume while an MCP task runs533#### Exit, clear, or resume while an MCP task runs
530 534
540 544
541#### What a call needs to become an MCP task545#### What a call needs to become an MCP task
542 546
543A tool call becomes an MCP task only when all of these conditions hold:547For the cloud, see [MCP tasks in cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud). Elsewhere, a tool call becomes an MCP task only when it meets all of these conditions:
544 548
545* The server supports tasks549* The server supports tasks
546* The server is an HTTP, stdio, or claude.ai connector server connected on [protocol revision 2026-07-28](#mcp-client-runtimes). Setting [`MCP_SDK_GENERATION=v1` or `MCP_PROTOCOL_NEGOTIATION=legacy`](https://code.claude.com/docs/en/env-vars) rules that out550* The server is an HTTP, stdio, or claude.ai connector server connected on [protocol revision 2026-07-28](#mcp-client-runtimes). Setting [`MCP_SDK_GENERATION=v1` or `MCP_PROTOCOL_NEGOTIATION=legacy`](https://code.claude.com/docs/en/env-vars) rules that out
547* The session [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), so not on a third-party provider such as Amazon Bedrock, and not with telemetry or flag fetching turned off
548* Anthropic has turned MCP tasks on for your kind of session:551* Anthropic has turned MCP tasks on for your kind of session:
549 * Terminal CLI sessions, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) sessions, and [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) runs have them on v2.1.304 or later552 * Terminal CLI sessions, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) sessions, and [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) runs have them on v2.1.304 or later
550 * [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), including ones you open in the desktop app, have them only if Anthropic has turned them on for your account or organization. You can't turn them on or look up their state in a setting553 * For the VS Code extension and local sessions in the desktop app, see [MCP tasks in VS Code and the desktop app](#mcp-tasks-in-vs-code-and-desktop)
551 * Some other Claude Code surfaces, such as the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) and local sessions in the [desktop app](https://code.claude.com/docs/en/desktop.md), don't have them554* If [feature-flag fetching is off](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example on Amazon Bedrock or with telemetry turned off, you need an interactive terminal session on Claude Code v2.1.317 or later
552* The call comes from the main conversation, not from a [subagent](https://code.claude.com/docs/en/sub-agents.md)555* The call comes from one of these:
556 * The main conversation
557 * A non-[fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation) [subagent](https://code.claude.com/docs/en/sub-agents.md) that the main conversation started, in an interactive terminal session that [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), on v2.1.331 or later. The server can't be one [defined in the subagent's own file](https://code.claude.com/docs/en/sub-agents.md#scope-mcp-servers-to-a-subagent)
553* Either the session is interactive, or an [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) session or a `claude -p` run reading `--input-format stream-json` has:558* Either the session is interactive, or an [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) session or a `claude -p` run reading `--input-format stream-json` has:
554 * [`CLAUDE_AUTO_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) at `1`559 * [`CLAUDE_AUTO_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) at `1`
555 * `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` not `1`560 * `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` not `1`
559 564
560Keep an Agent SDK or stream-json session's input open, because the run [doesn't wait for MCP tasks](https://code.claude.com/docs/en/headless.md#mcp-work-when-a-non-interactive-run-ends) after input closes. A one-shot `claude -p "<prompt>"` run doesn't get MCP tasks.565Keep an Agent SDK or stream-json session's input open, because the run [doesn't wait for MCP tasks](https://code.claude.com/docs/en/headless.md#mcp-work-when-a-non-interactive-run-ends) after input closes. A one-shot `claude -p "<prompt>"` run doesn't get MCP tasks.
561 566
567#### MCP tasks in VS Code and the desktop app
568
569MCP tasks can work in the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) and in local [desktop app](https://code.claude.com/docs/en/desktop.md) sessions. In both, you need Claude Code v2.1.331 or later and a session that [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching).
570
571Use a terminal session in these cases:
572
573* **claude.ai connector in the desktop app**: it gets no tasks in local sessions
574* **Server from `claude_desktop_config.json`**: it gets no tasks either, so [add it to the CLI](#installing-mcp-servers) first
575* **Task that asks questions**: neither app shows a task's question, and Claude Code asks the server to cancel the task unless an [`Elicitation` hook](https://code.claude.com/docs/en/hooks#elicitation) accepts the request
576
577Once the server accepts the job, you can see or stop the task in VS Code's [`/tasks`](https://code.claude.com/docs/en/vs-code#monitor-background-processes) or the desktop app's [**Background tasks** pane](https://code.claude.com/docs/en/desktop.md#watch-background-tasks). If no row appears while Claude waits on the call, or the tool fails, check these causes:
578
579* **`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS` at `0` or `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` at `1`**: remove it, for example from `env` in [`settings.json`](https://code.claude.com/docs/en/settings), and start a new session
580* **Claude Code earlier than v2.1.331**: check the version in [VS Code](https://code.claude.com/docs/en/vs-code.md#install-the-extension) or the [desktop app](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab), then update the extension or app and start a new session. If the latest update still carries an earlier version, use a terminal session until an update brings v2.1.331 or later.
581* **First session after an update**: MCP tasks [can be missing in that session](https://code.claude.com/docs/en/env-vars.md#first-session-after-an-install-or-upgrade), so start another one
582
583If the call still doesn't become a task after these checks, use a terminal session. If it doesn't become one there either, see [What a call needs to become an MCP task](#requirements-for-mcp-tasks).
584
585#### MCP tasks in cloud sessions and claude.ai chats
586
587MCP tasks work in the cloud with [claude.ai connectors](#use-mcp-servers-from-claude-ai) that support them on [protocol revision 2026-07-28](#mcp-client-runtimes). Tool calls can become tasks in these places:
588
589* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) you start yourself in Anthropic-hosted environments
590* New chats in the [unified Claude experience](https://support.claude.com/en/articles/16761823-claude-cowork-and-chat-are-one-claude) on Pro, Max, Ultra, and Team plans
591
592Not every existing chat has tasks. If a tool that works only as a task fails in an existing chat on one of those plans, try a new chat.
593
594Only some accounts get MCP tasks in these other places:
595
596* New chats in the unified Claude experience on Free and Enterprise plans
597* The **Cowork** option, on accounts without the unified experience, where the message box offers a choice of **Chat** or **Cowork**
598* [Recurring work that you schedule](https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-cowork) from a chat or from Cowork
599
600You can't turn MCP tasks on for your account in a setting. If a tool that works only as a task fails in one of those places, run it from a terminal session on a paid plan.
601
602In cloud sessions, servers from `.mcp.json` or a plugin get no tasks, so a tool that works only as a task returns the server's error. Add a remote server as a connector instead.
603
604Expect calls without tasks in cases such as these, and run a tool that needs tasks from a terminal session:
605
606* [Project](https://code.claude.com/docs/en/claude-projects.md) threads
607* Incognito chats
608* Claude Code's [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md)
609
610In cloud sessions and chats that have tasks, a [subagent](https://code.claude.com/docs/en/sub-agents.md)'s call can become a task too. This needs a subagent that the main conversation started and that isn't a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation). The subagent gets the result if the task ends within two minutes. For a longer task, expect Claude to pick up the result in the main conversation.
611
612#### Answer an MCP task's question in the cloud
613
614When a task asks you a question in a cloud session or chat, select **Allow** on the permission prompt, then answer in the form that opens. If the prompt is denied, or if the form closes before you answer, the task keeps waiting, so ask Claude to show the question again.
615
616You can't answer in the **Cowork** option or in recurring work that you schedule. If Claude reports there, or in any other session or chat, that the question cancelled the task, start the task again from an interactive terminal session.
617
618#### Check or stop an MCP task in the cloud
619
620To check on or stop a running MCP task, ask Claude in the cloud session or claude.ai chat that started it, for example `stop the export task`. In a claude.ai chat on a computer, you can also hover over the tool call that started the task and select **Stop** if it appears.
621
622The server may still finish the job after either kind of stop, so ask Claude to check the task afterward. If the job still runs, look for a way to cancel it in the server's other tools or in the service that runs it.
623
624#### Get an MCP task's result in the cloud
625
626If a task's result hasn't arrived in a cloud session or chat, send a message so Claude Code checks the task again. You can leave while a task runs. When it completes or fails, Claude usually picks up the result unprompted, even in a session that stopped for inactivity.
627
628If Claude reports one of these problems with the task, take the step that matches its report:
629
630* **The task was cancelled because it asked you a question**: you [can't answer](#mcp-task-questions-in-the-cloud) in that session or chat, so start the task again from an interactive terminal session
631* **Tracking stopped after failed status checks**: the job can still be running, so ask Claude to check it again. If no result follows, ask Claude to find the outcome with the server's other tools
632* **The server no longer knows the task**: the result may be lost, so ask Claude to find the outcome with the server's other tools before you run the job again
633* **The task reached the seven-day tracking limit**: the job can still be running. In a cloud session, ask Claude to check it again. In a chat, ask Claude to find the outcome with the server's other tools
634
562#### Status messages on an MCP task635#### Status messages on an MCP task
563 636
564These messages, in a task's `/tasks` entry or its closing transcript line, mean Claude Code can't reach the server or the task. While one shows in `/tasks`, the job may still be running: Claude Code leaves it alone and keeps checking. The `300s` and configuration messages stay on the entry even after contact returns.637These messages, in a task's `/tasks` entry or its closing transcript line, mean Claude Code can't reach the server or the task. While one shows in `/tasks`, the job may still be running: Claude Code leaves it alone and keeps checking. The `300s` and configuration messages stay on the entry even after contact returns.
578 651
579#### Time limits on MCP tasks652#### Time limits on MCP tasks
580 653
581By default, a task in the background has no Claude Code time limit. The [tool call time limits](#time-limits-on-mcp-tool-calls), including the wall-clock limit and the idle timeout, apply until the server answers the call with the task. If you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task), they apply for the whole task. Answered status checks count as activity for the idle timeout.654Outside [cloud sessions and claude.ai chats](#mcp-task-results-in-the-cloud), a task in the background has no Claude Code time limit by default. The [tool call time limits](#time-limits-on-mcp-tool-calls), including the wall-clock limit and the idle timeout, apply until the server answers the call with the task. If you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task), they apply for the whole task. Answered status checks count as activity for the idle timeout.
582 655
583#### Make Claude wait for the result of an MCP task656#### Make Claude wait for the result of an MCP task
584 657
585To make Claude wait for a task's result in an interactive session, set one of two environment variables, for example in the `env` block of [`settings.json`](https://code.claude.com/docs/en/settings):658To make Claude wait for a task's result in an interactive terminal session, set one of two environment variables, for example in the `env` block of [`settings.json`](https://code.claude.com/docs/en/settings):
586 659
587* **[`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) set to `0`**: Claude waits for every MCP tool call until the call ends660* **[`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) set to `0`**: Claude waits for every MCP tool call until the call ends
588* **[`CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND`](https://code.claude.com/docs/en/env-vars) set to `1`**: Claude waits for a task's result. While [automatic backgrounding](#automatic-backgrounding-of-long-tool-calls) is on, it moves the call after two minutes by default, so short tasks finish in place and long ones don't block you. The moved call is a plain background call rather than an MCP task. It doesn't survive exiting the session661* **[`CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND`](https://code.claude.com/docs/en/env-vars) set to `1`**: Claude waits for a task's result. While [automatic backgrounding](#automatic-backgrounding-of-long-tool-calls) is on, it moves the call after two minutes by default, so short tasks finish in place and long ones don't block you. The moved call is a plain background call rather than an MCP task. It doesn't survive exiting the session
626| `taskId` | Required. At most 128 printable ASCII characters with no spaces, or Claude gets a tool error beginning `MCP server "<name>" returned a malformed task handle for tool "<tool>"`. Keep the ID answerable across connections, because after a resume Claude Code asks about it on a new connection |699| `taskId` | Required. At most 128 printable ASCII characters with no spaces, or Claude gets a tool error beginning `MCP server "<name>" returned a malformed task handle for tool "<tool>"`. Keep the ID answerable across connections, because after a resume Claude Code asks about it on a new connection |
627| `status` | Required. One of `working`, `input_required`, `completed`, `failed`, or `cancelled`. Another value gives the `Unsupported result type` error |700| `status` | Required. One of `working`, `input_required`, `completed`, `failed`, or `cancelled`. Another value gives the `Unsupported result type` error |
628| `createdAt`, `lastUpdatedAt`, `ttlMs` | Required by the tasks extension, and `ttlMs` may be `null`. Claude Code doesn't drop a task because its `ttlMs` has passed |701| `createdAt`, `lastUpdatedAt`, `ttlMs` | Required by the tasks extension, and `ttlMs` may be `null`. Claude Code doesn't drop a task because its `ttlMs` has passed |
629| `pollIntervalMs` | Optional. Milliseconds between `tasks/get` requests, clamped to between 250 and 30000. Claude Code uses 2000 when the field is absent or `null`, and reads the value again from each `tasks/get` response |702| `pollIntervalMs` | Optional. Milliseconds between `tasks/get` requests, read again from each `tasks/get` response. Outside the cloud, Claude Code clamps the value to between 250 and 30000, and uses 2000 when the field is absent or `null`. For the cloud, see [Choose a time to live and a poll interval](#choose-a-time-to-live-and-a-poll-interval) |
630| `statusMessage` | Optional. `/tasks` shows the value from your latest `tasks/get` response, not this first one, and a response that omits the field clears it. A [status message from Claude Code](#status-messages-on-an-mcp-task) can take its place |703| `statusMessage` | Optional. `/tasks` shows the value from your latest `tasks/get` response, not this first one, and a response that omits the field clears it. A [status message from Claude Code](#status-messages-on-an-mcp-task) can take its place |
631 704
632Claude Code accepts a task answer that omits `createdAt`, `lastUpdatedAt`, or `ttlMs`, or that sets `pollIntervalMs` to `null`. Before v2.1.317, the call failed with the `Unsupported result type` error instead. To work with those versions too, send the three fields that the tasks extension requires, and send `pollIntervalMs` as a number or not at all.705Claude Code accepts a task answer that omits `createdAt`, `lastUpdatedAt`, or `ttlMs`, or that sets `pollIntervalMs` to `null`. Before v2.1.317, the call failed with the `Unsupported result type` error instead. To work with those versions too, send the three fields that the tasks extension requires, and send `pollIntervalMs` as a number or not at all.
635 708
636#### Report status, results, and questions709#### Report status, results, and questions
637 710
638Right after the task answer, Claude Code sends `tasks/get` with `{ "taskId": ... }`, then repeats it once per poll interval. The tasks extension requires your response to carry `"resultType": "complete"` along with `taskId`, `status`, `createdAt`, `lastUpdatedAt`, and `ttlMs`. `ttlMs` may be `null`, and `statusMessage` and `pollIntervalMs` are optional. This example reports the build as done:711Right after the task answer, Claude Code sends `tasks/get` with `{ "taskId": ... }`, then repeats it once per [poll interval](#choose-a-time-to-live-and-a-poll-interval). The tasks extension requires your response to carry `"resultType": "complete"` along with `taskId`, `status`, `createdAt`, `lastUpdatedAt`, and `ttlMs`. `ttlMs` may be `null`, and `statusMessage` and `pollIntervalMs` are optional.
712
713This example reports the build as done:
639 714
640```json theme={null}715```json theme={null}
641{716{
658| `failed` | Tells Claude the `message` of the top-level `error` object `{ code, message, data }`, which the tasks extension requires on a failed task. Without that `message`, Claude gets `statusMessage` instead, or else `Task failed` |733| `failed` | Tells Claude the `message` of the top-level `error` object `{ code, message, data }`, which the tasks extension requires on a failed task. Without that `message`, Claude gets `statusMessage` instead, or else `Task failed` |
659| `cancelled` | Tells Claude `statusMessage`, or else `Task was cancelled by the server` |734| `cancelled` | Tells Claude `statusMessage`, or else `Task was cancelled by the server` |
660| `input_required` | Reads `inputRequests`, an object that maps a key you choose to `{ method, params }`. Claude Code answers each key once through `tasks/update` with `{ taskId, inputResponses }`, where `inputResponses` maps the same key to that request's result. Keys beyond 16 per task are ignored |735| `input_required` | Reads `inputRequests`, an object that maps a key you choose to `{ method, params }`. Claude Code answers each key once through `tasks/update` with `{ taskId, inputResponses }`, where `inputResponses` maps the same key to that request's result. Keys beyond 16 per task are ignored |
661| Methods in `inputRequests` | `elicitation/create` is served only in interactive terminal sessions, and `roots/list` everywhere. When Claude Code can't serve a request, it asks the server to cancel the task |736| Methods in `inputRequests` | `elicitation/create` reaches a person in interactive terminal sessions. For the cloud, see [where a person can answer](#mcp-task-questions-in-the-cloud). `roots/list` is served outside the cloud. Don't depend on it in [cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud). When Claude Code can't serve a request, it asks the server to cancel the task |
662| Another `status` value | Claude Code asks the server to cancel the task and reports it to Claude as failed |737| Another `status` value | Claude Code asks the server to cancel the task and reports it to Claude as failed |
663| JSON-RPC error `-32602` | Read as an unknown task ID. For a task in the background, Claude Code keeps asking for up to five minutes, then reports the outcome to Claude as unknown |738| JSON-RPC error `-32602` | Read as an unknown task ID. For a task in the background outside the cloud, Claude Code keeps asking for up to five minutes, then reports the outcome to Claude as unknown. In cloud sessions and claude.ai chats, expect about five minutes of retries too, then a report that [the server no longer knows the task](#mcp-task-results-in-the-cloud) |
664| `tasks/cancel` | Sent, for example, when Claude or the person stops the task while the server is connected. Not sent on exit |739| `tasks/cancel` | Sent, for example, when Claude or the person stops the task while the server is connected. Not sent on exit |
665| `tasks/result`, `tasks/list`, `notifications/tasks` | Not used, so put the outcome in your `tasks/get` responses |740| `tasks/result`, `tasks/list`, `notifications/tasks` | Not used, so put the outcome in your `tasks/get` responses |
666 741
673* **`ttlMs`**: report how long your server keeps the task, counted from the task's creation. Send your longest run time plus the time you keep the result, such as `5400000` for a 30-minute job and one hour. Send `null` if your server keeps tasks with no time limit748* **`ttlMs`**: report how long your server keeps the task, counted from the task's creation. Send your longest run time plus the time you keep the result, such as `5400000` for a 30-minute job and one hour. Send `null` if your server keeps tasks with no time limit
674* **`pollIntervalMs`**: send 10000 to 30000 for a job that runs longer than a minute, so your server answers fewer status checks. For a shorter job, send 2000 so Claude gets the result sooner749* **`pollIntervalMs`**: send 10000 to 30000 for a job that runs longer than a minute, so your server answers fewer status checks. For a shorter job, send 2000 so Claude gets the result sooner
675 750
751In [cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud), status checks can come less often than your `pollIntervalMs` asks, so plan for these intervals:
752
753* **A new task**: expect checks to follow a `pollIntervalMs` from 1000 to 30000. A lower value can be raised to 1000. If you omit the field, expect at most 10 seconds between checks
754* **An older task**: allow for checks that slow to every 10 seconds once the task is a minute old, and to every 30 seconds after 10 minutes
755* **A value above 30000**: checks can follow it as sent and delay the result, so stay at 30000 or below
756
676### Plugin-provided MCP servers757### Plugin-provided MCP servers
677 758
678[Plugins](https://code.claude.com/docs/en/plugins/overview.md) can bundle MCP servers that provide tools and integrations when you enable the plugin.759[Plugins](https://code.claude.com/docs/en/plugins/overview.md) can bundle MCP servers that provide tools and integrations when you enable the plugin.
1748 1829
1749MCP Apps UI resources are entries with a `ui://` URI or the `text/html;profile=mcp-app` media type: pages for a host application to render rather than content for Claude to read. They don't appear in the `@` suggestions or in the resource list tool's results, and a server that offers only UI resources shows an empty resource list. Reading a UI resource by its URI still works.1830MCP Apps UI resources are entries with a `ui://` URI or the `text/html;profile=mcp-app` media type: pages for a host application to render rather than content for Claude to read. They don't appear in the `@` suggestions or in the resource list tool's results, and a server that offers only UI resources shows an empty resource list. Reading a UI resource by its URI still works.
1750 1831
1832## Use skills from MCP servers
1833
1834With Skills over MCP, a server can provide [skills](https://code.claude.com/docs/en/skills.md) alongside its tools. This works for [claude.ai connectors](#use-mcp-servers-from-claude-ai), [servers you add](#installing-mcp-servers), and [servers from plugins](#plugin-provided-mcp-servers). To serve skills from a server you build, implement the [Skills extension](https://modelcontextprotocol.io/extensions/skills/overview), an extension to MCP that defines how servers list and deliver skills.
1835
1836> [!NOTE]
1837>
1838> MCP skills are in public beta and require Claude Code v2.1.331 or later. In the Desktop app, check the [Code tab's Claude Code version](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab). See [where they're supported](#requirements-for-skills-from-mcp-servers).
1839
1840### Find and call MCP skills by name
1841
1842To find a skill, type `/` at the prompt in the terminal, VS Code, or the Desktop app's Code tab. In the terminal or VS Code, you can also run `/skills`. To use a skill, ask Claude, or type its name as a command. A skill's name is `<server>:<skill>`.
1843
1844For example, if you added a server named `docs` that has a `pdf` skill, the skill's name is `docs:pdf`, and this command runs it on `report.pdf`:
1845
1846```text theme={null}
1847/docs:pdf report.pdf
1848```
1849
1850Connector and plugin servers add a prefix, such as `claude_ai_Docs:pdf` for a connector named Docs, or `plugin_my-plugin_docs:pdf` for a `docs` server from `my-plugin`. In `<server>`, spaces and punctuation other than `-` become `_`.
1851
1852### Approvals for MCP skills
1853
1854When Claude loads an MCP skill in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the default, you don't see a prompt. The classifier decides whether the skill loads, without reading it. In Manual or `acceptEdits` mode, you see a prompt. Select **Allow this version** to skip the prompt and the classifier until the server changes the skill's files. To remove that approval in the terminal, delete its rule in `/permissions`.
1855
1856With an [ask rule](#block-a-servers-skills-or-ask-first) or a connector set to [**Restrict to Ask**](#restrict-mcp-skills-for-organizations), Claude needs your approval each time, including in auto and `bypassPermissions` modes. In plan mode, you see the prompt even for a version you allowed, unless your terminal session has [bypass available](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode). Typing a skill's command at the prompt doesn't need approval. For Remote Control, see [Where MCP skills are supported](#where-mcp-skills-are-supported).
1857
1858#### Set rules for a server's skills
1859
1860Add a [permission rule](https://code.claude.com/docs/en/permissions.md) to block an MCP server's skills, see a prompt each time Claude loads one, or skip the prompt. In the terminal, run `/permissions` to add one.
1861
1862These example rules use `docs` as the [server name](#run-an-mcp-skill):
1863
1864| To | Add to | Rule |
1865| :- | :- | :- |
1866| Block its skills, including typed commands | `deny` | `Skill(mcp__docs__*)` |
1867| Block only its `pdf` skill | `deny` | `Skill(docs:pdf)` |
1868| Block its skills and tools | `deny` | `mcp__docs` |
1869| See a prompt each time Claude loads one | `ask` | `Skill(mcp__docs__*)` |
1870| Approve all versions of its skills | `allow` | `Skill(mcp__docs__*)` |
1871
1872Add the `allow` rule to user or managed settings. It works for servers you added at user or local scope and for managed servers, but not for connectors, `.mcp.json` servers, or plugin servers. `Skill(mcp__docs__*)` rules require Claude Code v2.1.331 or later.
1873
1874With `deny` rules, normal [resource reads](#use-mcp-resources) from the server are still allowed. To stop Claude from reading any server's resources, including allowed skills' supporting files, deny `ReadMcpResourceTool`.
1875
1876### Security scanning for MCP skills
1877
1878Anthropic scans skills from some connectors, with [exceptions and limitations](#limitations-of-mcp-skills). For these connectors, a version loads only after it passes the scan:
1879
1880* Third-party [Directory](https://claude.ai/directory) connectors you add on claude.ai
1881* Custom connectors, while your Enterprise organization keeps **Skill and plugin security scanning** on in [**Organization settings > Plugins & skills > Policy**](https://claude.ai/admin-settings/skills?tab=policy)
1882
1883Anthropic doesn't scan skills from other connectors or servers, including Directory servers added with `claude mcp add`.
1884
1885> [!WARNING]
1886>
1887> Skills can direct Claude to run code. Servers can change skills at any time. Add only servers you trust.
1888
1889### MCP skill availability
1890
1891When you sign in with `/login` on a Pro, Max, or Ultra plan, MCP skills are on. With `/login` on a Team or Enterprise plan, they're off until your organization [turns them on](#turn-on-skills-for-an-organization).
1892
1893With a [long-lived token](https://code.claude.com/docs/en/authentication.md#generate-a-long-lived-token) from any of these plans, MCP skills are on. With an API key or a Console login, they're rolling out: off now, and on by default when the rollout reaches you. For a token, a key, or a Console login, claude.ai connectors don't load, so you can use skills only from other MCP servers.
1894
1895#### Where MCP skills are supported
1896
1897You can use MCP skills in a terminal, including in JetBrains IDEs, and in local sessions you start in the Desktop app. In the VS Code extension, they're rolling out and turn on without a setting. When you control an interactive terminal session over [Remote Control](https://code.claude.com/docs/en/remote-control.md), ask Claude to use a skill instead of sending its command.
1898
1899You also need a Fable model, or Claude Opus 4.8, Sonnet 5, Haiku 5.5, or later, and a direct connection to Anthropic with [feature flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) on. If your setup matches one of these, MCP skills aren't supported:
1900
1901* **Sessions**: cloud sessions, `claude -p`, `claude remote-control` server mode, [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), and the Agent SDK
1902* **Servers in the Desktop app**: connectors, Desktop extensions, and servers from [`claude_desktop_config.json`](https://code.claude.com/docs/en/desktop#mcp-servers-from-the-claude-desktop-chat-app)
1903* **Connections**: cloud providers, a custom `ANTHROPIC_BASE_URL`, `apiKeyHelper`, and `ANTHROPIC_AUTH_TOKEN`
1904* **Compliance settings**: organizations with a setting such as [HIPAA](https://code.claude.com/docs/en/hipaa-setup.md) or [zero data retention](https://code.claude.com/docs/en/zero-data-retention.md). For connectors, this includes [customer-managed encryption keys](https://platform.claude.com/docs/en/manage-claude/cmek).
1905
1906### MCP skill limitations
1907
1908Each server shows up to 100 skills. [Scanned skills](#safety-of-mcp-skills) have limits:
1909
1910* **Size**: 100 KB per text file, 400 KB per skill
1911* **Unscanned files**: PNG, JPEG, GIF, BMP, ICO, SVG, PDF, WOFF, WOFF2, TTF, EOT, MP3, MP4, WAV, AVI, MOV, and dependency lock files aren't scanned or counted
1912* **Unsupported files**: skills with an archive, another binary file such as WebP or OTF, or text in folders such as `dist/` don't load
1913
1914### Turn on MCP skills for organizations
1915
1916To turn on MCP skills for Team or Enterprise members who sign in with `/login`:
1917
1918* **Connectors**: an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) turns on **Skills over MCP** in [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors). Your organization's [**Skills** setting](https://claude.ai/admin-settings/skills?tab=policy) must also be on.
1919* **Other servers**: set [`disableDirectMcpSkills`](https://code.claude.com/docs/en/settings-reference#disabledirectmcpskills) to `false` in [managed settings](https://code.claude.com/docs/en/managed-settings.md), in the highest-ranked [admin source](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) you use
1920
1921> [!WARNING]
1922>
1923> Turn skills on only if you trust your members' servers: skill instructions or code can make Claude take unintended actions, including through [prompt injection](https://code.claude.com/docs/en/security.md#protect-against-prompt-injection).
1924
1925#### Restrict MCP skills for organizations
1926
1927To restrict one connector's skills, open the connector in [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors) and change **Default restriction for unconfigured tools**:
1928
1929* **Restrict to Ask**: Claude needs approval each time it loads a skill
1930* **Restrict to Blocked**: no skill loads, including typed commands
1931
1932Either way, you also restrict the connector's tools that have no restriction of their own. [Per-tool controls](#organization-controls-on-connector-tools) don't apply to skills.
1933
1934On devices you manage, people can also sign in with a personal plan, an API key, or a long-lived token, where your organization's defaults don't apply. To turn skills off on those devices, set these keys to `true` in a [managed settings file or MDM policy](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability):
1935
1936* **`disableDirectMcpSkills`**: turns off skills from servers other than connectors
1937* **[`disableClaudeAiConnectors`](#disable-claude-ai-connectors)**: turns off the connectors Claude Code fetches, including their skills and tools
1938
1939Normal [resource reads](#use-mcp-resources) from MCP servers are still allowed when skills are turned off.
1940
1941### Troubleshoot MCP skills
1942
1943If skills from MCP servers are missing, check the [supported setups](#requirements-for-skills-from-mcp-servers), [approval](#approvals-for-mcp-skills), the [`claude --debug=mcp` log](https://code.claude.com/docs/en/debug-your-config#check-mcp-servers), and these cases:
1944
1945| What you see | What to do |
1946| :- | :- |
1947| A **Features** row in `/status` that names a variable, such as `DISABLE_TELEMETRY` | Unset the variable to turn [feature flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) on, then restart Claude Code |
1948| `Unknown command`, or Claude treats the command as text | Send it again. |
1949| `Claude Code could not read whether your organization limits this connector` in a prompt | Restart Claude Code |
1950| `scan of this skill has no result yet` | Retry in a minute, then tell the server's owner. Some [unsupported files](#limitations-of-mcp-skills) get no result. |
1951| `scan cannot take it` or `scan stopped this version` | Tell the server's owner |
1952| A connector shows tools but no skills | Ask its provider whether it serves skills to Claude Code. During the beta, Anthropic keeps skills off for some connectors, and no setting changes that. |
1953| No **Protocol** row on a connected server's `/mcp` page | Confirm the server supports [MCP revision](#mcp-client-runtimes) 2026-07-28 or later, over HTTP or stdio. If a stdio server takes over 3 seconds to start, change its command from `npx` to the installed program, then select **Reconnect**. |
1954
1751## Scale with MCP tool search1955## Scale with MCP tool search
1752 1956
1753Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Claude Code doesn't impose a fixed per-server tool cap; the practical limit is your context window budget.1957Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Claude Code doesn't impose a fixed per-server tool cap; the practical limit is your context window budget.