Sub topic 1
Why MCP exists: from custom integrations to one protocol
Prerequisites
This chapter assumes you can read basic Python or TypeScript and are comfortable with JSON. It also assumes you know roughly how an LLM application calls tools: the model emits a structured request, the application runs it, and the result goes back to the model. Familiarity with client-server communication and HTTP helps for later chapters. No code is required here.
The problem: every pairing needs its own glue
An AI application is only as useful as the context and actions it can reach. A coding assistant needs files, a Git host, and an issue tracker. A support assistant needs a ticket system and a knowledge base. Before a shared standard, each application wrote its own integration for each system.
If there are M applications and N external systems, custom integrations mean up to M × N separate pieces of glue code. Each one has its own authentication, its own way of describing tools to the model, and its own error handling. When a system changes its API, every integration for it breaks separately.
| Approach | Integrations to build | Cost of adding one new system |
|---|---|---|
| Custom per pair | M × N | One new integration per application |
| One shared protocol | M + N | One new server, usable by every application |
What MCP is
The Model Context Protocol (MCP) is an open protocol that lets AI applications connect to external tools and data through one standard interface. An application implements the client side of MCP once. A system owner implements a server once. Any compatible client can then talk to any compatible server.
The idea is similar to the Language Server Protocol, which let editors and language tooling stop writing one plugin per editor and language pair. MCP applies the same reduction to AI applications and the systems they use.
What the protocol standardizes
MCP does not replace APIs. A Git server still calls the Git host's API internally. MCP standardizes the layer between the AI application and that server. Concretely, it defines:
- A message format. Messages are JSON-RPC 2.0, covered in a later chapter.
- A session lifecycle. The two sides agree on a protocol version and exchange capabilities before doing anything else.
- Server features. Servers can offer tools (actions the model can invoke), resources (context the application can read), and prompts (templates the user selects).
- Client features. Clients can offer servers sampling, roots, and elicitation.
- Transports. Messages move over stdio for local servers or Streamable HTTP for remote ones.
Because tools are described in a uniform way, a client can discover what a server offers at runtime instead of having it hard-coded. The client asks the server what it has, and the server answers.
A worked example
Suppose you want an assistant to query a company's ticket system.
Without MCP, you write code that authenticates to the ticket API, defines a tool schema in the format your model provider expects, parses the model's tool call, calls the API, and formats the result. A second application repeats all of this in a different format.
With MCP, someone writes one ticket server. It declares a tool such as search_tickets with a JSON schema for its inputs. Your application, acting as an MCP client, connects, lists the tools, and passes them to the model. When the model requests search_tickets, the client forwards the call and returns the result. A second application gets the same capability by connecting to the same server, with no new integration code.
What MCP does not solve
- It does not make a model good at using tools. Poorly named tools or vague descriptions still lead to wrong calls.
- It does not provide security by itself. A server can still expose dangerous actions. Consent and trust are covered in a later chapter.
- It does not remove the need for servers to exist. The savings depend on a server being written once and reused. Niche systems may still need you to write one.
Exercise
An organization has 4 AI applications and 10 internal systems. How many integrations does it need with custom per-pair glue, and how many components does it need with MCP? What does the difference say about adding an eleventh system?
Show answer
Custom glue needs up to 4 × 10 = 40 integrations. With MCP it needs 4 clients plus 10 servers, so 14 components. Adding an eleventh system costs up to 4 new integrations without MCP, but only 1 new server with MCP, because all four applications can already connect to it.