Protocol

MCP agent

An MCP agent is the host application that speaks the Model Context Protocol and orchestrates LLM completions against the tools and data exposed by MCP servers. Claude Code, Claude Desktop, Cursor, Windsurf, ChatGPT Apps, Continue, Cline, and Zed are all MCP agents in this sense.

What makes an MCP agent

At the mechanism level, an MCP agent hosts the LLM connection (sends prompts, receives completions, manages context), spawns or connects to MCP servers, and runs the initialize handshake. The agent negotiates capabilities at session start: which of Resources, Tools, and Prompts the server advertises, and which of Roots, Sampling, and Elicitation the agent advertises back.

When the LLM emits a tool-call request, the agent routes it to the right MCP server, collects the structured response, and returns it to the LLM. A properly-implemented agent gates tool calls behind user approval where the tool has side effects. The user consent boundary sits at the agent. The protocol leaves it there by design.

Sampling

A server can request the agent to run an LLM completion on its behalf via the sampling/createMessage request. The server passes a prompt; the agent's LLM produces a response; the agent returns the response to the server. The server uses the agent's LLM credentials, never its own. This lets servers do recursive work (summarize a long document before returning it, classify a file by content) without each server holding its own model credentials.

Elicitation

A server can request the agent to prompt the user for additional information. The server never sees the user directly; the agent mediates the interaction. Used for collecting file paths, confirmations, secrets that the agent might have access to but the server does not.

Roots

The agent advertises filesystem URIs (its roots capability) where a server is permitted to operate. A filesystem MCP server, for example, gets scoped to the project directory the user opened. The server can request changes via notifications/roots/list_changed if the agent's scope shifts.

Related on MCPowered