skip to content

Using Connected Servers

A connected server's tools appear as mcp__server__tool, resources as @-mentions and prompts as commands, while tool search keeps definitions out of context. Asked because many servers crowd context.

part ofClaude Coderead it →
on this pageshow

explore

questions

6

In Claude Code, what does a connected MCP server add to a session, and how are its tools, resources and prompts invoked?

level: juniorimportance: must knowfreq 22%

answer

  1. three things, three invocation routes
  2. who decides: Claude or you
  3. the @ menu beside files
  4. the / menu, marked MCP
  5. arguments split on whitespace

basics

~10 s

Claude Code exposes a server's tools for Claude to call as mcp__server__tool, its resources as @server:protocol://path mentions you attach, and its prompts as commands listed as /server:prompt (MCP) or typed as /mcp__server__prompt.

solid answer

~40 s

A connected server can add three things. **Tools** are for Claude: it decides when to call them, under names like `mcp__github__search_repositories`, and you approve or rule on them like any tool. **Resources** are for you to attach: type `@` and they appear beside files, referenced as `@server:protocol://path` such as `@github:issue://123`; Claude Code fetches them as attachments, and Claude also gets tools to list and read them. **Prompts** become commands: the `/` menu lists each as `/servername:promptname (MCP)`, and typing `/mcp__servername__promptname` runs it too, with arguments passed space-separated and split on whitespace; the prompt's result is injected into the conversation. A server can also open an elicitation dialog mid-task to ask you for input.

go deeper

for a junior

Recall the three routes: Claude calls tools by their mcp__ names, you attach resources with @, and you run prompts from the slash menu.

for a middle

Explain who triggers each capability and what lands in context: attachments for resources, injected prompt output, and permission prompts for tools.

for a senior

Show you would pick the route deliberately: attach a resource when you know what Claude needs, leave tools to Claude when it must search, and expect elicitation in unattended runs.

for a principal

Judge what a team's servers should expose as prompts versus tools so recurring workflows become one command without handing Claude broad tool access.

## Three things a server can contribute The **Model Context Protocol (MCP)** lets an external server offer three kinds of capability. What they mean at the protocol level is the MCP primitives material's subject; this answer is about how Claude Code puts each one in front of you and who triggers it. | Capability | Who triggers it | How it appears in Claude Code | | :- | :- | :- | | Tool | Claude, during its work | `mcp__<server>__<tool>`, subject to permission prompts and rules | | Resource | You, when you write a prompt | `@server:protocol://path` in the `@` autocomplete | | Prompt | You, as a command | `/servername:promptname (MCP)` in the `/` menu, or `/mcp__servername__promptname` | ## Tools: Claude calls them You never type a tool. Once a server connects, Claude can call its tools whenever a task needs them, just as it calls `Read` or `Bash`. Each tool gets a prefixed name, `mcp__<server>__<tool>`, built from the name you configured for the server. Calls go through the normal permission flow: a prompt unless a rule or mode already decides. The `/mcp` panel lists connected servers with their tool counts, which is the fastest way to see what a server actually brought. ## Resources: you attach them with @ A **resource** is a piece of content a server can hand over by address: an issue, a schema, a document. 1. Type `@` in your prompt. Resources from all connected servers appear alongside files, and the paths are fuzzy-searchable. 2. Pick one, or type it in the form `@server:protocol://resource/path`, for example `Can you analyze @github:issue://123 and suggest a fix?`. 3. Reference several in one prompt if you need to, such as `Compare @postgres:schema://users with @docs:file://database/user-model`. Referenced resources are **fetched automatically and included as attachments**, so Claude reads them without spending a tool call. Claude Code also gives Claude two tools for servers that support resources, `ListMcpResourcesTool` and `ReadMcpResourceTool`, so Claude can discover and read resources on its own. Resources that are UI pages meant for a host application to render (a `ui://` address) do not show in the `@` suggestions. ## Prompts: you run them as commands An **MCP prompt** is a template the server offers for a recurring request. - Type `/` and the menu lists each one as `/servername:promptname (MCP)`. - Typing `/mcp__servername__promptname` runs the same prompt; in that form, characters in the server name outside letters, digits, `_` and `-` become `_`. - Pass arguments after the command, separated by spaces: `/mcp__github__pr_review 456`. Claude Code **splits arguments on whitespace**, so each argument is a single token, and a value with a space in it cannot be passed as one argument. - The prompt's result is **injected into the conversation**, and Claude continues from it. Prompts are discovered dynamically: when a server changes its list and notifies Claude Code, an interactive session fetches the new list without a reconnect. A server named `anthropic-skills` has its prompts hidden, because Claude Code reserves that name for skills synced from claude.ai; its tools still work. ## When the server asks you: elicitation Sometimes a server needs something only you can supply mid-task. Claude Code shows an **elicitation** dialog and passes your answer back, with no configuration needed: - **Form mode** shows fields the server defines, such as a username. - **URL mode** asks whether to open a link in your browser, for flows such as sign-in that finish outside the terminal. An `Elicitation` hook can answer these automatically when nobody is at the keyboard; writing such hooks is the hooks material's subject. ## Checking what a server actually brought Before relying on a server, open `/mcp`. It lists each server with its status and the number of tools it exposes, and flags a server that advertises the tools capability but exposes none. If a tool you expected is missing, the server's log often explains why: Claude Code normally excludes individual tools whose input schemas would be rejected by the API and keeps the server's other tools working, and you can ask Claude which tools were excluded. ## Common confusions - **Tools are not slash commands.** Only prompts appear in the `/` menu; tools are called by Claude, never typed by you. - **Resources are not tools.** An `@` mention attaches content up front; Claude does not need to decide to fetch it. - **Prompts are not skills.** Skills you write are discovered and invoked by their own rules; an MCP prompt is whatever the server defines and changes when the server changes it.

  • Your prompt uses @docs:file://api/authentication. Does Claude have to call a tool to read it?
    No. Claude Code fetches a referenced MCP resource automatically and includes it as an attachment with your message. Separately, for servers that support resources, Claude Code gives Claude `ListMcpResourcesTool` and `ReadMcpResourceTool`, so Claude can discover and read other resources itself when the task calls for it.
  • A server asks for a password in the middle of a tool call. What do you see in Claude Code?
    An elicitation dialog. In form mode Claude Code shows the fields the server defined, and your answer goes back to the server; in URL mode it asks whether to open a link in your browser, for flows such as sign-in. No configuration is needed, and an `Elicitation` hook can answer automatically for unattended runs.

  • You run an MCP tool by typing its name after a slash
  • A resource mention makes Claude call a tool to fetch it later
  • MCP prompt arguments can contain spaces inside one argument
  • MCP prompts only run in the /server:prompt form
  • Elicitation needs a setting before servers can ask you anything
open as a page

In Claude Code, how is a connected MCP server's tool named, and how do you write permission rules for one tool or a whole server?

level: middleimportance: must knowfreq 18%

basics

~20 s

Claude Code names each MCP tool mcp__<server><tool>, using the server name from your configuration. The rule mcp__server or mcp__server* covers every tool on that server, mcp__server__tool covers one, and an allow glob must start with a literal server prefix.

open as a page

In Claude Code, an MCP tool returns a 60,000-token database dump: what do the output warning and limit do, and how do MAX_MCP_OUTPUT_TOKENS and maxResultSizeChars change them?

level: seniorimportance: should knowfreq 8%

basics

~20 s

Claude Code warns when MCP output passes 10,000 tokens and caps it at 25,000 by default, saving an oversized text result to a file and passing its path. MAX_MCP_OUTPUT_TOKENS raises the cap; a tool's anthropic/maxResultSizeChars overrides it for text.

open as a page

A Claude Code session with a dozen MCP servers feels slow and context-heavy: how does tool search defer their definitions, and how does ENABLE_TOOL_SEARCH change it?

level: seniorimportance: should knowfreq 12%

basics

~20 s

By default Claude Code loads only MCP tool names and server instructions, and the ToolSearch tool loads full definitions on demand. ENABLE_TOOL_SEARCH overrides it: true defers even behind a proxy, auto or auto:N defers past a context threshold, false loads everything.

open as a page

What does `claude mcp serve` expose to another MCP client, and who must confirm each tool call that client makes through it?

level: middleimportance: nice to knowfreq 3%

basics

~20 s

claude mcp serve runs Claude Code as a stdio MCP server exposing Claude Code's own tools, such as reading and editing files, to the connecting client. It prints nothing on start, and the client must confirm individual tool calls.

open as a page

How do Claude Code channels push external events into a running session, and what must be true before a channel server's messages actually arrive?

level: seniorimportance: nice to knowfreq 4%

basics

~20 s

A channel is an MCP server declaring the claude/channel capability that pushes events into an open Claude Code session. They arrive only if you name it with --channels at startup, it is allowlisted, and your organization permits channels.

open as a page