No history yet

Protocol Architecture

The MCP Architecture

Large Language Models are powerful, but they are often isolated. To perform complex tasks, they need to interact with external tools like databases, APIs, and file systems. Traditionally, this meant building custom, one-off integrations for every single tool. This approach is brittle and doesn't scale. If a tool's API changes, the integration breaks. If you want to use a new AI model, you might have to rewrite everything.

Model Context Protocol (MCP) is an open source standard designed by Anthropic (Creators of Claude) to standardize how AI systems interact with external tools and resources.

The Model Context Protocol (MCP) solves this by creating a universal standard. Think of it like USB-C for AI. Before USB-C, we had dozens of different cables for charging phones, connecting peripherals, and transferring data. Now, a single, standardized port handles everything. MCP aims to do the same for AI, providing one consistent way for models to connect to any external tool.

The Three Key Roles

MCP's architecture is built on a clear separation of three roles: the Host, the Client, and the Server. This structure avoids the chaos of direct, point-to-point integrations.

  1. The : This is the environment where the AI lives, such as a code editor, a messaging app, or a desktop application like Claude Desktop. The Host's job is to manage the user experience and decide when to call upon the AI's capabilities.
  2. The Client: The Client is a component that lives inside the Host. It acts as the intermediary, translating the Host's needs into a request that an MCP Server can understand. It's responsible for initiating the connection and managing the communication session.
  3. The Server: The Server exposes the external tools and data. It could be a simple server that provides access to a single file, or a complex one that connects to multiple enterprise APIs. The Server's job is to advertise its capabilities and fulfill requests from the Client.

This separation of concerns means a developer building a tool server doesn't need to know anything about the AI model, and the AI model doesn't need to know the specific implementation details of the tool. It only needs to speak MCP.

Stateful Sessions and Discovery

Unlike many web APIs that are stateless, MCP connections are and persistent. When a Client connects to a Server, they establish a session that remains open. This is crucial for efficiency. The initial connection involves a where the Client and Server negotiate capabilities. The Server tells the Client what tools it offers, what data formats it understands, and what actions it can perform. This is known as the discovery process.

Once the handshake is complete, the Client has a full menu of the Server's capabilities. It can then make specific requests without the overhead of re-establishing a connection or re-discovering the available tools every time. For example, the Client might discover that a server has a read_file tool and a search_database tool. It can then use these tools as needed throughout the session.

This stateful, discovery-first approach makes the interaction dynamic. A server can add or remove tools, and the client will be updated in real-time. This flexibility is what allows MCP to function as a truly universal interface for AI.

Quiz Questions 1/5

What is the primary problem the Model Context Protocol (MCP) is designed to solve?

Quiz Questions 2/5

In the MCP architecture, which component lives inside the Host application and acts as an intermediary to the Server?