top of page

MCP: The Protocol That Connects AI to Everything

Shift Quality Editorial
Feb 1
13 min read

Updated: Nov 18

Every useful AI application eventually needs to reach outside the model: search a database, read a repository, open a ticket, check a calendar. Before the Model Context Protocol, each of those connections was custom. Every AI application wrote its own connector for every system, and every system wrote an adapter for every AI application. With M applications and N systems, that's M × N integrations to build and keep working.

MCP replaces that with one standard interface. A system exposes its capabilities once, as an MCP server, and any application that speaks MCP can use them. That's M + N.

This post covers what MCP is as of its current revision, how it works, and what building a server looks like in code. Most of it is about a question the protocol doesn't answer for you: whether the model will actually use your server correctly. A server that's valid MCP can still give the model the wrong tools, the wrong descriptions and the wrong outputs. That's a design problem, and it can be measured.

What MCP is

MCP is an open protocol for connecting AI applications to external context and tools. Anthropic created it, and in December 2025 donated it to the newly formed Agentic AI Foundation, a directed fund under the Linux Foundation, co-founded with Block and OpenAI. The Linux Foundation's announcement put the number of available MCP servers at more than 10,000.

The specification names three roles:

  • Hosts are the AI applications people use, such as a desktop assistant, an IDE or an agent framework.

  • Clients are the connectors inside a host, one for each server it talks to.

  • Servers provide capabilities: tools, resources and prompts.

Messages are JSON-RPC 2.0. The specification says it takes inspiration from the Language Server Protocol, which did the same job for programming-language support across editors: implement once, work everywhere.

There are two standard transports:

  • stdio: the host launches the server as a local process and they exchange newline-delimited messages over its standard input and output.

  • Streamable HTTP: each message is an HTTP POST to a single endpoint, and replies come back as JSON or as a stream for that request.

The protocol is moving quickly, so check which revision you're reading about. The current revision, dated 2026-07-28, made significant changes. It removed the initialization handshake and protocol-level sessions, so each request now carries its own protocol version and client capabilities. Servers advertise themselves through a new server/discover method. Long-running work moved into an optional Tasks extension. The older HTTP+SSE transport, already superseded by Streamable HTTP in 2025, is now formally deprecated. The roots, sampling and logging features are deprecated too. The project has also adopted a policy of at least twelve months' notice before a deprecated feature is removed.

The test: list the MCP servers your team uses and note which transport and revision each one speaks. Any remote server still on HTTP+SSE is on a deprecated transport, and any custom server built against early-2025 examples is worth checking against the current SDK.

How it works

A server can offer three kinds of capability. They differ in who decides when they're used:

Capability

What it is

Who controls its use

Example

Tools

Functions the model can call

The model, with the user able to approve or deny

find_tickets, create_branch

Resources

Data exposed by URI

The application or user

A file, a database schema, a runbook

Prompts

Templated messages or workflows

The user

"Summarise this incident for the status page"

Tools get most of the attention because they let the model act. A client asks the server for its tool list (tools/list). Each tool has a name, a description, an input schema in JSON Schema, and optionally an output schema. The host shows these to the model. When the model decides to use one, the client sends tools/call with the arguments, and the server returns the result.

A tool definition looks like this:

{
  "name": "find_tickets",
  "title": "Find support tickets",
  "description": "Search support tickets by customer name, status, text or date range. Returns up to 10 summaries with the customer's name, status, owner and last update. Use get_ticket_history for the full thread.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "customer": { "type": "string", "description": "Customer or company name, as people say it" },
      "status": { "type": "string", "enum": ["open", "pending", "closed"] },
      "text": { "type": "string", "description": "Words to match in the title or body" },
      "updated_since": { "type": "string", "format": "date" }
    },
    "additionalProperties": false
  }
}

The important thing about this definition is that the description and schema are the model's only guide to the tool. The model doesn't see your code. It sees this text and decides from it when to call the tool and what to pass. That makes the description part of your prompt, and it should be written and tested as carefully as a prompt.

Errors come in two kinds. Protocol errors, such as an unknown tool or a malformed request, come back as JSON-RPC errors. Tool execution errors, such as a date in the wrong format or a record that doesn't exist, come back as a normal result marked isError: true, with text the model can use to correct itself and retry. The specification recommends that clients pass these execution errors back to the model, so the wording matters.

The test: call each tool on your server with one deliberately wrong argument. Read the error it returns as if you were the model. If it doesn't say what was wrong and what a valid value looks like, the model can't recover from it either.

Building a server

The official SDKs handle the protocol, so the code you write is mostly the capability itself. Here's a single tool in the current Python SDK, following the structure of the official quickstart:

from mcp.server import MCPServer
from mcp.server.mcpserver.exceptions import ToolError

mcp = MCPServer("support")

@mcp.tool()
async def find_tickets(customer: str | None = None, status: str | None = None,
                       text: str | None = None) -> str:
    """Search support tickets by customer name, status or text.

    Returns up to 10 summaries with customer name, status, owner and last update.
    """
    results = await search_tickets(customer=customer, status=status, text=text)
    if results is None:
        raise ToolError("Ticket search is unavailable. Try again in a minute.")
    if not results:
        return "No tickets matched. Try a shorter customer name or remove the status filter."
    return "\n".join(format_summary(t) for t in results[:10])

if __name__ == "__main__":
    mcp.run(transport="stdio")

The Python SDK builds the tool's schema from the type hints and its description from the docstring. The TypeScript SDK registers tools explicitly, and serves them through a factory function so one server can answer both current clients and clients on 2025-era revisions:

import { McpServer } from "@modelcontextprotocol/server";
import { serveStdio } from "@modelcontextprotocol/server/stdio";
import { z } from "zod";

function createServer() {
  const server = new McpServer({ name: "support", version: "1.0.0" });

  server.registerTool(
    "find_tickets",
    {
      description: "Search support tickets by customer name, status or text. Returns up to 10 summaries.",
      inputSchema: z.object({
        customer: z.string().optional().describe("Customer or company name, as people say it"),
        status: z.enum(["open", "pending", "closed"]).optional(),
        text: z.string().optional().describe("Words to match in the title or body"),
      }),
    },
    async ({ customer, status, text }) => {
      const results = await searchTickets({ customer, status, text });
      return { content: [{ type: "text", text: formatSummaries(results) }] };
    },
  );

  return server;
}

serveStdio(createServer, {
  onerror: (error) => console.error("Support server error:", error),
});

One mistake catches almost everyone writing their first stdio server: never write to standard output. On stdio, standard output is the protocol channel, so a stray print() or console.log() corrupts the messages. Log to standard error instead.

To connect a local server, you add it to the host's configuration. For Claude Desktop, that's an entry like this:

{
  "mcpServers": {
    "support": {
      "command": "uv",
      "args": ["--directory", "/path/to/support-server", "run", "server.py"]
    }
  }
}

The host starts the process, asks for the tool list and offers the tools to the model. Remote servers are configured with a URL instead of a command, and the protocol is the same.

A worked example: 38 tools that worked and a server that didn't

This is a composite drawn from common patterns, not one company. The figures are illustrative.

A support engineering team built an MCP server over its ticketing system so engineers could ask an assistant about customer history. The first version wrapped the ticketing system's REST API one endpoint at a time: 38 tools, including list_tickets, get_ticket, get_comments, search_tickets, get_user and get_organization. Every tool worked when tested on its own.

In use, the assistant struggled. Asked "what's still open for Northwind and who's on it?", it called list_tickets without a filter and got a truncated page of unrelated tickets. It passed a user id where an organisation id was expected, because both fields were called id. It couldn't look up "Northwind" at all, because the API searched organisations by numeric id, not name.

The fork. The team's first instinct was to switch to a larger model. Before doing that, one engineer built a small evaluation. She pulled 25 real questions from the support team's chat history and wrote down, for each, the answer a good engineer would give and the system that held it. Then she ran all 25 through the assistant and recorded what happened:


Version 1: one tool per endpoint

Version 2: tools shaped around the questions

Tools

38

5

Questions answered correctly

13 of 25

22 of 25

Typical tool calls per question

6

2

Main failures

Unfiltered lists, confused ids, couldn't search by name

Two questions needed billing data the server didn't have

The failures weren't the model's. They were the server's. Version 2 replaced the 38 wrappers with five tools built around what people actually asked: find_tickets (searchable by customer name, status, text and date, returning names instead of ids), get_ticket_history, find_similar_incidents, draft_reply, and add_internal_note. Each returned short, readable summaries by default. The three questions version 2 still missed pointed at the next gap: billing data, which belonged in a separate server.

This matches the published guidance. Anthropic's engineering post on writing tools for agents recommends against tools that are thin wrappers around "existing software functionality or API endpoints", and in favour of consolidating related steps, returning "high signal information" instead of cryptic identifiers, and evaluating against realistic tasks.

The discovery move. The question that fixed the design was asked before any tool was written in version 2: "What will people actually ask this, and which system holds each answer?" The 25 real questions became both the tool list and the test set. A server designed from the API reflects how the system is built. A server designed from the questions reflects how it's used, and the model is there for the use.

The test: before you build or change a server, collect 20 to 30 real requests from wherever people ask them now, such as chat, tickets or search logs. Write the expected answer and the expected tool calls for each. Run them through the assistant after every change to the tool list, the descriptions or the outputs, and track how many it gets right.

Designing a server that's safe to connect

An MCP server executes real actions with real credentials. The specification is explicit about the minimum: servers must validate all tool inputs, implement access controls, rate-limit tool calls and sanitise tool outputs. Clients should show tool inputs to the user before calling, ask for confirmation on sensitive operations, set timeouts and log tool use. The spec also warns that tool annotations, the hints a server gives about whether a tool is read-only or destructive, must be treated as untrusted unless the server is trusted.

The risk that catches teams out isn't one tool. It's the combination. Simon Willison calls it the "lethal trifecta": "access to your private data", "exposure to untrusted content" and "the ability to externally communicate". In May 2025, Invariant Labs showed it with the official GitHub MCP server. A malicious issue filed on a public repository instructed the agent reading it to pull data from the user's private repositories and publish it in a pull request on the public one. As Invariant put it, this was "not a flaw in the GitHub MCP server code itself". Every tool did what it was meant to. The problem was that one session could do all three things.

Design choices that cut one leg:

  • Scope credentials to the task. A token that can read one repository can't leak another.

  • Separate reading from sending. In the example above, draft_reply returns a draft to the engineer and doesn't send it, so a poisoned ticket can't make the assistant email a customer.

  • Require confirmation for writes, and don't encourage users to click "always allow" on tools that change things or send data out.

  • Treat everything a tool returns as untrusted input to the model, because it may contain text written by someone else.

MCP Is Your New Attack Surface goes through how to test an agent against these attacks in detail.

The test: list every tool your server, or your combination of servers, exposes in one session. Mark each one that reads private data, each one that can bring in content from outside your organisation, and each one that can send data anywhere. If one session can do all three, remove a leg before you ship.

To check a whole agent rather than one server, the MCP Trust-Boundary Test Card records every server it connects to, counts the legs present in one session, and runs canary tests that show whether untrusted content can reach private data and a way out.

Before you connect someone else's server

Third-party servers are dependencies that can act on your behalf, and they deserve the same review as any other dependency:

  • Who publishes it, and is it maintained? An official server from the system's vendor is a different risk from an unmaintained fork.

  • What credentials does it need, and can you scope them down?

  • Read the tool descriptions before enabling them. They become part of what your model is told, so treat them like code you're importing.

  • Pin the version and review the tool list again when you upgrade. Servers can change their tools over time, and the protocol includes a notification for exactly that.

  • Check the trifecta across servers. Two individually safe servers, one reading private data and one posting to the web, can combine into an unsafe session.

Evaluating Open Source Before You Depend On It covers the general dependency checks.

Where MCP is heading

The direction is visible in the 2026-07-28 revision. A stateless protocol is simpler to run behind load balancers and easier to scale for remote servers. Optional extensions now carry features that not every server needs: Tasks for long-running work, and MCP Apps for interactive interface elements rendered inside a conversation. Neutral governance under the Linux Foundation and a formal deprecation policy make it a more predictable foundation to build on. For teams, the practical consequence is that MCP is turning from a convenience into infrastructure, and infrastructure needs ownership, versioning and testing like any other.

MCP, the protocol that connects AI to everything. It replaces M times N custom integrations with M plus N: hosts contain clients, which talk JSON-RPC to servers over stdio or Streamable HTTP; servers offer tools, resources and prompts. In a composite example, a server wrapping 38 API endpoints answered 13 of 25 real questions, and a redesign with 5 tools shaped around the questions answered 22. Ask: what will people actually ask this, and which system holds each answer? Before shipping, check that no one session combines private data, untrusted content and a way to send data out.

What to do this week

  • Inventory your servers: every MCP server configured on your team's machines and in your agents, with its transport, revision and the credentials it holds.

  • Collect 20 real questions for one server and write the expected tool calls for each. Run them and count the correct answers.

  • Rewrite one tool description as if explaining the tool to a new colleague: what it does, when to use it, what it returns and what to do next.

  • Test your errors: call each tool with one bad argument and check that the error tells the model how to fix it.

  • Run the trifecta check on your busiest session, and remove a leg if all three are present.

Final takeaway

MCP turns M × N custom integrations into M + N, and that's why it has spread so quickly. But the protocol only guarantees that a model can reach your tools. It doesn't guarantee that the model will pick the right ones or that the combination is safe. Design servers from the questions people actually ask rather than from your API, measure tool choice with a small set of real requests, make descriptions and errors something a model can act on, and make sure no single session holds private data, untrusted input and a way to send data out.

Before you promote an agent, the Agent Failure Mode Catalogue lists eighteen ways agents fail once they can act, each with how it shows up in a run, a detection test and the control, plus a scoring workbook that gives a promotion verdict.

Sources

Related reading

Keep learning. This article is part of the AI in Quality & Delivery path in the ShiftQuality Learning Center. Use AI in delivery — and evaluate it honestly — without the hype.

Frequently Asked Questions

What is the Model Context Protocol (MCP)?

MCP is an open protocol for connecting AI applications to external tools and data. It was created by Anthropic and donated in December 2025 to the Agentic AI Foundation, a directed fund of the Linux Foundation. Messages use JSON-RPC 2.0 over one of two standard transports: stdio for a local server process, or Streamable HTTP for a remote one. Servers offer tools, resources and prompts, so an application that supports MCP once can use any MCP server.

How is MCP different from RAG?

RAG retrieves documents to give a model context for an answer. MCP is a standard way to connect a model to external systems, which can include retrieval but also actions such as creating a ticket. Many systems use both: a retrieval step for 'find the relevant policy' and an MCP tool for 'open a ticket about it'.

What's the difference between MCP tools and MCP resources?

Tools are functions the model can call, such as searching a database or sending a message. Resources are data the server exposes by URI, such as a file or a schema, which the application or user can pull into context when needed rather than loading everything up front.

Which version of MCP should I build against?

The current revision is 2026-07-28, which removed the initialization handshake and protocol-level sessions. The official SDKs can serve both current clients and clients still using 2025-era revisions. The older HTTP+SSE transport is deprecated, so new remote servers should use Streamable HTTP.

Do I need to build an MCP server to use AI tools?

No. Thousands of servers already exist for databases, file systems, code hosts, cloud platforms and productivity tools. Build one when you need to expose an internal system, and review a third-party server's tools and permissions before connecting it, as you would any dependency that can act on your behalf.

bottom of page