MCP Runtime
After an MCP server connects, Claude Code adds its tools, resources, and prompts to the session.
The names, the permission rules, and the limits decide what Claude can use and for how long.
A tool from a server is named mcp__<server>__<tool>.
For example, mcp__github__create_issue is the create_issue tool of the github server.
This runs by itself once a server connects. Use permissions.deny for tools, ENABLE_TOOL_SEARCH for deferral, and CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS for background moves. Large results are saved under tool-results.
Tools and Names
Source: Connect Claude Code to Tools via MCP, Configure Permissions, and the program for rows marked Undocumented.
| Item | Status | What It Does | How It Works |
|---|---|---|---|
mcp__ | Documented | Names an MCP tool. | Characters outside A- in the server name become _. A tool whose full name is over 128 characters is left out. Used in permission rules, hooks, tools, and allowed-. |
mcp__ | Documented | Names a plugin server tool. | The server is named plugin:. A hook matcher on the bare server key never fires for it. |
mcp__, mcp__, mcp__ | Documented | Select tools by server. | The first two match one server. mcp__ matches all MCP tools. Used in subagent tools and disallowed. |
Hook matcher mcp__ | Documented | Matches a server in hooks. | A matcher with only exact-match characters, such as mcp__, matches no tool. The . is required. |
mcp_ hook input field | Documented | Gives the origin of the server. | An object with name and source (plugin, sdk, user, project, and more). Sent to tool hooks. |
mcp_ hook type | Documented | Calls an MCP tool as a hook. | The output counts as command stdout. Skipped on Setup, and at Session before servers connect. |
updated | Documented | Replaces an MCP tool result. | Output of a Post hook. MCP tools only. |
Tool | Documented | Finds deferred MCP tools. | On by default. permissions. turns the tool off. |
Wait | Documented | Waits for a connecting server. | Used when tool search is off. With tool search the wait happens inside Tool. Works in the main session and subagents. |
Search, Suggest, List | Undocumented | Find and list MCP connectors. | Search searches the connector registry by keyword. List lists the connectors of the claude.ai organization. |
Resources and Prompts
| Item | Status | What It Does | How It Works |
|---|---|---|---|
@server: | Documented | Attaches a resource. | Fetched as an attachment. The @ menu has fuzzy search. |
List | Documented | Lists resources of all servers. | The docs say Claude Code has tools to list and read resources but give no names. Each entry has a server field. ui:// entries are hidden. |
Read | Documented | Reads one resource. | Parameters server and uri, both required. |
Read | Undocumented | Lists the children of a directory resource. | Parameters server and uri. Uses resources/. Not recursive. Only for a server that declares directory support. |
| Old tool names | Undocumented | Map old names to new. | List, Read, and Read map to the ... names in rules and hooks. |
/ and / | Documented | Runs a server prompt. | Arguments split on whitespace. Results go into the conversation. Needs the prompt capability. |
| MCP Apps resources | Documented | UI pages for a host. | A ui:// URI, or the media type text/ with the profile parameter mcp-. Reading by URI still works. |
CLAUDE_ | Undocumented | Declares MCP Apps support. | Adds the extension io. with the MIME type to the client capabilities. |
Elicitation and Channels
Elicitation is a server asking you for input. A channel is a way for a server to push messages into your session.
| Item | Status | What It Does | How It Works |
|---|---|---|---|
| Elicitation dialog | Documented | Asks you for input. | form mode shows fields. url mode asks to open a link. The escaped URL has a cap of about 8000 characters. Claude Code declares elicitation:. |
Elicitation hook | Documented | Answers a request. | Input: mcp_, message, mode, url, elicitation_, requested_. Output action: accept (with content), decline, or cancel. |
Elicitation hook | Documented | Observes or overrides the answer. | Input has action and content. Runs before the answer goes to the server. |
claude/ capability | Documented | Lets a server push messages. | You opt in with --. Not registered on a v2 connection that agreed on revision 2026-07-28. |
claude/ | Documented | Relays permission prompts over a channel. | Notifications notifications/ and .../. |
channels plugin key | Documented | Binds a channel to a plugin server. | Fields server, display, user. In plugin.. |
Source: Channels Reference and Push Events into a Running Session with Channels.
Limits
| Item | Status | What It Does | How It Works |
|---|---|---|---|
| Output warning | Documented | Warns on large output. | Fixed at 10000 tokens. |
MAX_ | Documented | Sets the token limit of a result. | Default 25000. Over the limit, Claude Code saves the result to a file in tool- and shows the path. Images stay under this limit. |
| 50000 characters | Documented | File threshold for text. | A successful text result over 50000 characters is saved to a file, whatever the token count. |
ENABLE_ | Undocumented | Switch for the file path. | When false, Claude Code truncates instead of saving to a file. |
_ | Documented | Raises the threshold for one tool. | Up to 500000 characters. Text only. Set in the tools/ entry. |
_ | Documented | Always asks. | Only JSON true counts. It prompts in all modes. dont denies. With --, an allow becomes a deny. |
_ | Documented | Loads a tool upfront. | false keeps it deferred when the user config sets always (2. and later). |
| Error text | Documented | Shortens long errors. | Over about 11000 characters, the first 5000 and last 5000 stay. For is results. |
| 16 MiB response | Documented | Caps one response or message. | HTTP and SSE stop reading. A WebSocket closes the connection. |
| Description limits | Documented | Cuts long text. | 4096 characters for server instructions and an upfront tool. 16384 for a tool found by tool search. CLAUDE_ replaces both. |
| Schema checks | Documented | Drops bad tools. | Excludes a tool with a bad top-level property name or an invalid 2020-12 schema. Flattens a root any, one, or all. |
Timing and Recovery
| Item | Status | What It Does | How It Works |
|---|---|---|---|
| Auto background | Documented | Moves a long call to a task. | After 120000 ms in the main conversation. Not for subagents, IDE servers, or - unless CLAUDE_. |
| Idle timeout | Documented | Aborts a silent call. | 5 minutes for remote servers, 30 minutes for stdio. CLAUDE_ changes it. 0 turns it off. Not for IDE and sdk servers. |
| Reconnection | Documented | Retries a dropped remote server. | Five tries with backoff from 1 s. Stdio is not reconnected. The first connect retries 3 times, except ws and auth errors. |
list_ | Documented | Refreshes tools, prompts, and resources. | Interactive sessions refresh all three. - refreshes tools only. A failed refresh keeps the old lists. |
| Stdio shutdown | Documented | Stops a stdio server. | On macOS and Linux: SIGINT, then SIGTERM after 100 ms, then SIGKILL after 400 ms more. |
roots/ | Documented | Tells servers which folders are allowed. | Answers with the launch folder and added folders. |
| Tool search modes | Documented | Controls deferral. | ENABLE_: not set, true, auto, auto:, or false. Since 2.1.304 tool search is on by default behind a custom ANTHROPIC_, and a 400 or 422 from the gateway is retried without it. |
Example
{
"permissions": {
"allow": ["mcp__github__*"],
"deny": ["mcp__untrusted"]
}
}
{
"hooks": {
"PreToolUse": [
{ "matcher": "mcp__memory__.*", "hooks": [{ "type": "command", "command": "./audit.sh" }] }
]
}
}
How It Works
Related Pages
- MCP
- MCP Env Vars
- Plugin Manifest for the
channelskey - Agent Loop for how tool calls run