← Blog

What Is MCP? Model Context Protocol Explained

What Is MCP? Model Context Protocol Explained

MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems such as files, databases and APIs. A server offers tools, resources and prompts, and the AI application reaches it through a client over JSON-RPC 2.0. In POLYROB’s code, that starts with one initialize call that announces protocol version 2024-11-05 (tools/mcp/[email protected]).

How does MCP work?

The MCP architecture page (fetched 2026-11-14) names three roles. The host is the AI application that coordinates one or more clients. A client is the component that keeps a connection to one server and gets context from it for the host. The server is the program that has the capabilities.

Underneath, client and server exchange JSON-RPC 2.0 messages. A client asks a server what it has with tools/list, and runs one with tools/call. The same page describes the standard as built so that listings can be dynamic: a server can say its tool list changed, and the client asks again.

The model never speaks MCP itself. The host turns each server tool into something the model can choose, runs the call when the model picks it, and puts the result back into the conversation.

What do MCP servers offer: tools, resources and prompts?

The architecture page lists three kinds of server feature:

A host does not have to use all three. POLYROB’s client announces tools and resources in its handshake, and the tools/mcp/ package contains no prompts handling (tools/mcp/[email protected]; a search of the package for “prompts” returns nothing).

How does an MCP client connect to a server?

The spec defines two transports: stdio, where the host starts the server as a local process and talks over standard input and output, and Streamable HTTP, which uses HTTP POST with optional Server-Sent Events for streaming and suits remote servers (architecture page, fetched 2026-11-14).

POLYROB’s client has four transport types in its config: stdio, sse, http and streamable_http (tools/mcp/[email protected]). Here is the order of events in its code (tools/mcp/[email protected]):

  1. It opens the transport and sends initialize, with the client name “POLYROB MCP Client” and the capabilities tools and resources.
  2. It stores the capabilities the server returns and sends a notifications/initialized message.
  3. It discovers what the server has with tools/list and resources/list.
  4. Later calls go out as tools/call and resources/read.
  5. For a resource it was told to watch, it sends resources/subscribe and routes notifications/resources/updated to a listener.

Each server tool then reaches the model as an action whose name starts with the server name followed by the tool name, and one mcp tool covers every configured server (tools/mcp/[email protected]).

What happens when an MCP server fails or gets arguments wrong?

Two small mechanisms in the code handle the everyday failures.

Every server gets its own circuit breaker. Its failure threshold is the server’s retry_attempts setting and its recovery timeout is retry_delay. The defaults in the config model are a 30-second connection timeout, 3 retry attempts and a 5-second delay (tools/mcp/[email protected], tools/mcp/[email protected]). A server that keeps failing stops being called until the breaker allows another try, so one broken server does not stall the agent.

Arguments are checked against the tool’s JSON schema before the call goes out. The coercion module converts values it can, such as booleans, integers and dates, and returns a list of errors for the rest, so the model sees what was wrong (tools/mcp/[email protected]).

How do I try MCP with POLYROB?

POLYROB is an open-source (MIT) self-hosted AI agent, and its MCP client is switched on with one setting:

polyrob config set MCP_ENABLED true

No server is configured out of the box (tools/mcp/[email protected], docs/guide/[email protected]). Add one from any chat with /mcp add aave https://mcp.aave.com (the docs example). Chat adds take HTTPS URLs only, and a local command such as npx ... is refused; a local stdio server goes into the config file on the machine instead (docs/guide/[email protected]). The step-by-step version, with the config file, the REST routes and the approval switch for servers that hold money keys, is in the POLYROB MCP client guide.

POLYROB can also be the server. Setting MCP_SERVE_ENABLED=true mounts POST /mcp so a client such as Claude Desktop or Cursor can connect to it (docs/guide/[email protected]). It is off by default.

Can I trust what an MCP server returns?

Treat it as untrusted. In POLYROB’s security model, MCP tool output sits in the same class as browser pages, fetched web content and email bodies: it is data that may carry adversarial text, not instructions (docs/guide/[email protected]). A local stdio server is a separate matter. The child process gets an environment built from an allowlist, but it still runs as a sibling process with your own privileges, so the binary has to be code you trust (docs/guide/[email protected]). More on the wider picture is in the AI agent security guide.

Where does POLYROB’s MCP support fall short?

FAQ

What does MCP stand for?

Model Context Protocol. The Anthropic announcement (fetched 2026-11-14) describes it as an open standard for connecting AI assistants to the systems where data lives, from content repositories to business tools.

What are the benefits of MCP?

An AI application writes one client and can use any server that speaks the protocol, instead of writing glue code for each service. For a server author it works the other way: one server can be used from any host that has a client. The MCP intro page compares it to a USB-C port for AI applications.

What are MCP prompts?

Reusable templates a server can offer to help structure a conversation with a model. They are one of the three server features, next to tools and resources. POLYROB’s client does not use them today.

Is MCP the same as function calling?

No. Function calling is how a model asks the host to run a function. MCP is how the host finds and calls tools that live in another program. A host can use MCP to fill the list of functions it offers the model. POLYROB does this by prefixing each server tool with the server name.

Does POLYROB need a restart after I add an MCP server?

No. A server added with /mcp add is saved against your tenant and the agent can use it from the next turn (docs/guide/[email protected]).

Next steps

Install POLYROB from the install page and read the docs for every setting named above. If you want the wider picture first, see what self-hosting involves and how POLYROB works with Claude. The protocol itself is documented on the Model Context Protocol site, and the client code is in the public repository.


POLYROB is an open-source AI agent you run and own. Install it or read the docs.