What is the Model Context Protocol?

Introduction

AI solves clear contextual problems like LeetCode with remarkable efficiency and accuracy. However, in real situations, AI often struggles due to vague environmental context and requirements. The Model Context Protocol (MCP) is a unified protocol for large language models to achieve better outcomes by enabling AI to better understand interactions with the external world.

Three Stages of Understanding Why MCP is Needed

Stage One: Large Language Models (LLM) Only

LLMs operate solely based on training data to predict the most likely next word. Their limitation is that they cannot achieve tasks outside of training, such as understanding the latest weather data (context) or sending emails (tools).

User

LLM

Stage Two: Connecting Additional APIs

Therefore, developers provide various APIs for LLMs to call. The issue arises from the different data formats, validation methods, and response structures of each API, leading to high integration costs as LLMs must manage different specifications. Creating tools for a stable experience requires significant time investment and can easily lead to confusion.

User

LLM

API A

API B

API C

Stage Three: Model Context Protocol (MCP)

A unified way to provide AI applications with context and tools

MCP is an open-source standard announced by Anthropic🔗 that provides SDKs for different environments, making it easier for developers to create MCP Servers for better resource access by AI. Specifically, it provides three ways:

  • Tools: Provide functionality (like POST endpoints for executing code or side effects such as file operations, API calls, or database queries)
  • Resources: Expose data (like GET endpoints for LLMs to load information, e.g., file content, database records, API responses)
  • Prompts: Define reusable LLM interaction templates

Users coordinate and manage one or more MCP Clients’ AI applications through a local MCP Host, such as in Claude Desktop🔗. When connected to the MCP Server, it is used for:

  • Creates and manages multiple client instances
  • Controls client connection permissions and lifecycle
  • Enforces security policies and consent requirements
  • Handles user authorization decisions
  • Coordinates AI/LLM integration and sampling
  • Manages context aggregation across clients

Each MCP Client maintains a connection to the MCP Server and obtains resources for MCP Host usage:

  • Establishes one stateful session per server
  • Handles protocol negotiation and capability exchange
  • Routes protocol messages bidirectionally
  • Manages subscriptions and notifications
  • Maintains security boundaries between servers

Finally, the MCP Server is a program that provides services specifically to MCP Clients, which can be established locally or provided by third-party services.

  • Expose resources, tools and prompts via MCP primitives
  • Operate independently with focused responsibilities
  • Request sampling through client interfaces
  • Must respect security constraints
  • Can be local processes or remote services

MCP Host

User

LLM

MCP Client - Plugin A

MCP Client - Plugin B

MCP Client - Plugin C

MCP Server - Plugin A

MCP Server - Plugin B

MCP Server - Plugin C

Conclusion

  • Modern Developers: Can provide context and services in a more unified and standardized way to interact with AI.
  • General Users: Can extend AI’s capabilities in a consistent manner.

The MCP architecture allows various apps to interact with AI in a unified manner. Imagine the USB-C standard where manufacturers need not worry about how data transmission interfaces, as long as they follow the same standard. MCP is the unified communication standard for the AI era. To explore MCP, check out the Example Clients🔗 and Example Servers🔗 for detailed comparison lists and descriptions.

Further Reading