Agents Guide 11 of 25

Model Context Protocol (MCP): how AI agents plug into your systems

MCP turned the messy work of wiring AI apps to tools and data into one shared protocol. Here is how it works, who backs it, what just changed, and where it can hurt you.

  • 10 min read
  • Updated 
  • 8 sources

Key takeaways

  • MCP standardizes how AI applications discover and call outside tools and data, so one server can serve many compliant clients instead of each app needing its own connector.
  • The July 2026 specification made MCP stateless: no handshake and no sessions, so remote servers scale behind ordinary load balancers and API gateways.
  • OpenAI, Google, Microsoft, and Anthropic products all speak MCP, and since December 2025 it has lived in a vendor-neutral Linux Foundation fund rather than with one company.
  • MCP moves trust decisions to you. Tool descriptions can hide instructions, and an agent with private data, untrusted input, and an outbound channel can leak.
  • Treat every server as third-party code: allowlist and pin it, scope credentials per user, require approval for writes, and keep tool lists small.
On this page 7 sections

Every useful AI assistant eventually needs something outside the model: a ticket queue, a database, a code repository, a calendar. Until late 2024, each AI application wired up each of those systems its own way. Ten AI tools and twenty internal systems could mean two hundred bespoke connectors, each with its own auth, schema, and failure modes.

The Model Context Protocol (MCP) is the industry’s answer to that sprawl. Anthropic released it as an open standard on 25 November 2024, with a specification, software development kits (SDKs), and reference servers for systems such as GitHub, Slack, and Postgres. Products from OpenAI, Google, and Microsoft have since adopted it, and since December 2025 a vendor-neutral Linux Foundation fund has hosted it.

For engineering teams, MCP raises two practical questions. Should you expose your own systems as MCP servers so any AI client can use them? And when you connect an agent to someone else’s server, what exactly are you trusting? This guide covers both, plus the protocol changes that landed in July 2026.

What problem does MCP solve?

MCP is an integration protocol, not a model and not an agent framework. It defines how an AI application learns what an outside system offers, how it invokes those capabilities, and how results come back. The specification names the Language Server Protocol (LSP) as one of its inspirations. LSP let any code editor support any programming language through one shared interface; MCP aims to do the same for AI applications and the tools they use.

The economics are the point. Without a shared protocol, every pairing of AI application and system needs its own integration, so effort grows with applications times systems. With one, each system ships a single server and each application ships a single client, so effort grows with applications plus systems. A team that publishes an MCP server for its order system can serve Claude, ChatGPT, Microsoft Copilot, and its own in-house agents from the same code.

It helps to place MCP next to function calling, the model-side mechanism in which the model emits a structured request to use a tool your code described. MCP sits one layer further out. It standardizes where those tool descriptions come from and how the call reaches the system that executes it, across a process or network boundary. The model never speaks MCP itself; the application around it does.

How MCP works: hosts, clients, and servers

The specification names three roles. The host is the AI application a person uses: a chat app, an integrated development environment (IDE), or an agent runtime. Inside the host, each client talks to exactly one server, a program that exposes capabilities locally or across a network. Every message is JSON-RPC 2.0, a lightweight and long-established format for remote procedure calls.

MCP hosts, clients, and servers A host application contains the model and two MCP clients. Each client exchanges JSON-RPC messages with one server: a local server over stdio and a remote server over Streamable HTTP, each fronting a real system. HOST · AI application Model (LLM) picks tools MCP client A MCP client B consent · permissions · logs MCP server A local · stdio files · git MCP server B remote · Streamable HTTP tickets · CRM JSON-RPC JSON-RPC one client per server MCP hosts, clients, and servers A host application contains the model and two MCP clients. Below it, each client exchanges JSON-RPC messages with one server: a local server over stdio and a remote server over Streamable HTTP, each fronting a real system. HOST · AI application Model (LLM) picks tools MCP client A MCP client B consent · permissions · logs JSON-RPC JSON-RPC MCP server A local · stdio files · git MCP server B remote · Streamable HTTP tickets · CRM one client per server
The host runs the model and one MCP client per server; each client exchanges JSON-RPC messages with a local or remote server that fronts a real system.

Two standard transports carry those messages. With stdio, the client launches the server as a local subprocess and they talk over standard input and output, which suits desktop tools and anything touching local files. With Streamable HTTP, the client sends every message as a POST request to a single server URL, which suits shared servers run by a vendor or a platform team.

A typical tool call follows five steps:

  1. The client asks the server what it offers (tools/list) and gets back names, descriptions, and input schemas.
  2. The host passes those definitions to the model along with the user’s request.
  3. The model decides a tool would help and emits a call with arguments.
  4. The host applies its permission rules, often asking the user, and the client sends tools/call to the server.
  5. The server acts on the real system and returns a result, which the host feeds back to the model.

On the wire, step 4 is a small message. Under the current specification, every request carries its own protocol version and client capabilities, and usually the client’s name, rather than relying on an earlier handshake:

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "tools/call",
  "params": {
    "name": "search_tickets",
    "arguments": {
      "customer_id": "C-1093",
      "status": "open"
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion":
        "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "support-desk",
        "version": "1.4.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}

Notice what the protocol leaves out. It does not choose which tool the model calls, judge whether the arguments make business sense, or perform step 4’s permission check. Those jobs belong to the host and the harness around the model.

The building blocks: tools, resources, and prompts

Servers can offer three kinds of capability, which the specification sorts by who decides when each one is used.

PrimitiveWho controls itWhat it isExample
ToolsThe model, which decides when to call oneFunctions that read or change somethingCreate a ticket; run a query
ResourcesThe host application, which decides what to attachData and content offered as contextA file, a schema, a customer record
PromptsThe user, who picks oneReusable message templates and workflowsAn incident-summary slash command

Clients can offer capabilities back. In the current version that means elicitation, which lets a server ask the user for missing information mid-task, such as a confirmation or a form field; roots and sampling are deprecated. Optional extensions add more: Tasks for long-running work, MCP Apps for interactive interface elements rendered inside the conversation, and Skills over MCP for packaged agent instructions.

In the servers we build, tools carry almost all of the load. Resources and prompts pay off mainly when a host surfaces them well in its interface.

What changed in the July 2026 specification?

MCP versions its specification by date, and the 2026-07-28 release reworks its foundations. Above all, it made the protocol stateless. Earlier versions opened each connection with an initialize handshake and could tie a client to a server-side session, which pushed operators toward sticky routing or shared session storage. Now each request stands alone, so an ordinary round-robin load balancer can send it to whichever instance is free.

A server that needs memory across calls, such as a shopping cart, now returns an explicit handle that the model hands back as a tool argument on later calls. The maintainers report that this works better than state buried in the transport, since the handle is visible to the model. Other changes follow from the same design:

  • Gateway-friendly headers. HTTP requests now carry the method and target name in headers, so gateways can route and meter traffic without parsing JSON bodies.
  • Cacheable lists. Tool, prompt, and resource lists come with freshness hints, so clients can cache them and skip needless re-fetches.
  • Multi round-trip requests. Servers no longer open their own requests to the client. A server that needs input returns an input_required result, and the client gathers the answer and retries the original call.
  • Hardened authorization. OAuth, the standard for delegated access, gains issuer validation, and client registration shifts toward published Client ID Metadata Documents.
  • Deprecations. Roots, sampling, and logging are deprecated but will keep working for at least twelve months. The legacy HTTP-plus-server-sent-events transport, long since replaced by Streamable HTTP, is formally deprecated too. Tasks moved out of the core into an official extension.

The release post put downloads across the four Tier 1 SDKs at close to half a billion a month as of July 2026. Teams that relied on session identifiers face migration work. For new remote servers, the stateless design is plainly better: an MCP server now deploys and scales like any other stateless web service.

Who supports MCP, and who governs it?

Adoption came quickly. At launch, Anthropic named Block and Apollo as early adopters, with Zed, Replit, Codeium, and Sourcegraph working with MCP in their developer tools. As of October 2026, OpenAI’s Responses API accepts remote MCP servers as a built-in tool, and by default it asks the developer to approve each call before any data reaches the server.

On 10 December 2025, Google announced fully managed remote MCP servers for its own services. The first wave covered Google Maps, BigQuery, Compute Engine, and Kubernetes Engine. Administrators govern them through Cloud Identity and Access Management (IAM) and audit logs, plus Model Armor, which Google positions as a guard against agent attacks like indirect prompt injection.

Governance moved the day before. On 9 December 2025, Anthropic donated MCP to the newly formed Agentic AI Foundation (AAIF), which Anthropic, Block, and OpenAI co-founded as a directed fund inside the Linux Foundation. Google, Microsoft, Amazon Web Services, Cloudflare, and Bloomberg signed on as supporters. Anthropic said MCP’s governance model would not change and its maintainers would keep putting community input first; the difference is that no single vendor owns the project.

At the time, Anthropic counted more than 10,000 active public servers and over 97 million monthly downloads of MCP’s Python and TypeScript SDKs. It listed ChatGPT, Cursor, Gemini, Microsoft Copilot, and Visual Studio Code among the products that had adopted MCP.

Read those numbers with care: downloads include automated build pipelines, and a server count says nothing about how many are maintained. The stronger signal is that competing model vendors ship MCP in flagship products and share one foundation. That makes MCP a safe interface to build on; it says nothing about the quality or safety of any particular server.

What are the security risks of MCP?

MCP makes connecting things easy, which also makes connecting the wrong things easy. The specification is blunt about the stakes:

“Tools represent arbitrary code execution and must be treated with appropriate caution.”

It also concedes that the protocol cannot enforce its own security principles. Hosts are expected to get explicit user consent before invoking tools, and to treat tool descriptions as untrusted unless the server itself is trusted. Three risks deserve particular attention.

Tool poisoning and rug pulls

The model reads every tool description; the user rarely does. In April 2025, Invariant Labs demonstrated tool poisoning with an innocent-looking add tool. Its description hid instructions to read a Cursor configuration file and the user’s Secure Shell (SSH) keys, then smuggle them out inside a tool argument. The researchers also described rug pulls, where a server changes its descriptions after approval, and demonstrated shadowing, in which one server’s description rerouted a trusted server’s email tool to the attacker.

The lethal trifecta

Simon Willison’s lethal trifecta — private data, untrusted content, and a way to send data out, in one agent — is covered in our guide to tool use. MCP makes it easy to assemble by accident, because users mix servers from different sources. One server can even supply all three legs: his example is GitHub’s official server, which could read attacker-filed public issues, see private repositories, and open pull requests.

Supply chain and data exposure

A local stdio server is a program running with the user’s own permissions, installed through the same package managers as any other dependency. A remote server receives whatever the model writes into tool arguments. OpenAI’s guidance for its API recommends servers run by the service provider itself, approval for sensitive actions, and logging everything shared with third-party servers. It also warns that a server can change its behavior without notice.

How to adopt MCP safely

Expose a system over MCP when several AI hosts need it, or when you want vendor agents such as ChatGPT, Claude, Copilot, Gemini, or IDE assistants to reach it without custom work. For one application calling three internal functions, plain function calling is simpler and has fewer moving parts.

  • Design servers for the model, not for your API. Mirroring every endpoint one-to-one floods the context and muddles tool choice. Offer a few task-shaped tools with precise descriptions, tight schemas, and compact results.
  • Build new remote servers on the 2026-07-28 version. Keep them stateless, pass explicit handles, skip sampling and roots, and put them behind your existing gateway using the new method and name headers.
  • Treat every server as third-party code. Keep an allowlist, pin versions, read tool descriptions at install, and re-review whenever they change. Prefer servers run by the vendor that owns the data.
  • Break the trifecta by design. Split work so no single agent holds private data, untrusted input, and an outbound channel together. Require human approval for writes, messages, and payments.
  • Scope credentials per user. Use narrowly scoped OAuth so the agent can do only what the signed-in person could do. Never give a server one shared admin token.
  • Budget the context. Every connected tool’s definition takes up room in the model’s context, and OpenAI bills those definitions as ordinary tokens. Connect only the servers a task needs, and filter each server’s tool list where the host allows it.
  • Log at the boundary. Record every tool call, its arguments, its result, and the user and server behind it. When an agent misbehaves, that trail is how you tell model error from server error.

MCP solved the plumbing. It did not decide what an agent should be allowed to touch. In the production agents SurgeX Labs builds, the permission model and audit trail around MCP servers take more care than the servers themselves. They are what make an agent safe to put in front of customers.

Sources

  1. Introducing the Model Context Protocol (opens in new tab) — Anthropic, 2024 anthropic.com

  2. Model Context Protocol specification (version 2026-07-28) (opens in new tab) — Model Context Protocol, 2026 modelcontextprotocol.io

  3. The 2026-07-28 Specification (opens in new tab) — Model Context Protocol Blog, 2026 blog.modelcontextprotocol.io

  4. Donating the Model Context Protocol and establishing the Agentic AI Foundation (opens in new tab) — Anthropic, 2025 anthropic.com

  5. MCP servers (API guide) (opens in new tab) — OpenAI, 2026 developers.openai.com

  6. Announcing official MCP support for Google services (opens in new tab) — Google Cloud Blog, 2025 cloud.google.com

  7. MCP Security Notification: Tool Poisoning Attacks (opens in new tab) — Invariant Labs, 2025 invariantlabs.ai

  8. The lethal trifecta for AI agents: private data, untrusted content, and external communication (opens in new tab) — Simon Willison, 2025 simonwillison.net

Where this shows up in our work

Building this? Talk to an engineer.

If this guide maps to a system you’re planning, send a short brief. A senior engineer replies within one business day.