MCP vs REST API is not a battle between two competing technologies. Rather, it’s about understanding two different paradigms for different consumers. REST API is a general-purpose interface designed for human developers to build software integrations. MCP (Model Context Protocol) is an AI-native protocol designed for AI agents to discover and use tools dynamically.
MCP stands for Model Context Protocol. It is an open standard introduced by Anthropic in November 2024 that standardizes how AI applications communicate with external data sources and tools.
Think of it as the USB-C port for AI applications — a universal, standardized interface that lets any AI model (Claude, GPT, DeepSeek, etc.) plug into any external tool, database, or service without custom integration code.
CN:
MCP 全称 Model Context Protocol(模型上下文协议) 。它是 Anthropic 在 2024 年 11 月推出的一个开放标准,用于标准化 AI 应用与外部数据源和工具之间的通信方式。
你可以把它理解为 AI 应用的 USB-C 接口 —— 一个通用的标准化接口,让任何 AI 模型(Claude、GPT、DeepSeek 等)都能即插即用地接入任何外部工具、数据库或服务,而无需编写定制化的集成代码。
MCP Architecture Overview — Core Concepts
MCP follows a client-host-server architecture.
3.1 Three Core Participants
三个核心角色
① Host(主机) — The AI application itself (e.g., Claude Desktop, Claude Code, an IDE).
The host acts as the container and coordinator:
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
② Client(客户端) — Created by the host, each client maintains a 1:1 dedicated connection with exactly one server.
Each client:
Communicates with exactly one server
Attaches protocol version and capabilities to every request
Routes protocol messages bidirectionally
Manages subscriptions and notifications
Maintains security boundaries between servers
③ Server(服务器) — A program that provides specialized context and capabilities to AI applications.
Each server:
Exposes Resources, Tools, and Prompts via MCP primitives
Operates independently with focused responsibilities
Can be local processes (STDIO transport) or remote services (HTTP/SSE transport)
Must respect security constraints — cannot read the whole conversation or “see into” other servers
CN:
① Host(主机) — AI 应用本身(如 Claude Desktop、Claude Code、IDE)。
Defines the JSON-RPC based protocol for client-server communication, including lifecycle management, and core primitives (tools, resources, prompts, notifications)
Defines communication mechanisms and channels (STDIO, HTTP/SSE) for data exchange, including connection establishment, message framing, and authorization
定义通信机制和通道(STDIO、HTTP/SSE),包括连接建立、消息帧和授权
CN:
MCP 由两层组成:
层
EN
CN
数据层
Defines the JSON-RPC based protocol for client-server communication, including lifecycle management, and core primitives (tools, resources, prompts, notifications)
Defines communication mechanisms and channels (STDIO, HTTP/SSE) for data exchange, including connection establishment, message framing, and authorization
定义通信机制和通道(STDIO、HTTP/SSE),包括连接建立、消息
3.3 Three Core Primitives
三种核心原语
MCP servers expose three types of primitives to AI applications:
Primitive
EN
CN
Control
Prompts
Pre-defined templates or instructions that guide language model interactions
预定义的模板或指令,用于引导语言模型的交互
User-controlled (用户控制)
Resources
Structured data or content that provides additional context to the model
结构化的数据或内容,为模型提供额外的上下文
Application-controlled (应用控制)
Tools
Executable functions that allow models to perform actions or retrieve information
可执行的函数,允许模型执行操作或检索信息
Model-controlled (模型控制)
3.4 Design Principles
MCP is built on four key design principles:
1. Servers should be extremely easy to build(服务器应该极易构建)
Host applications handle complex orchestration
Servers focus on specific, well-defined capabilities
Both parties must respect declared capabilities throughout the session
Additional capabilities can be negotiated through protocol extensions
This ensures clients and servers have a clear understanding of supported features while keeping the protocol extensible.
CN:
MCP 使用 基于能力的协商系统 。在初始化期间,客户端和服务器明确声明它们支持的功能。
服务器声明:工具支持、资源订阅、提示模板
客户端声明:采样支持、elicitation 处理
双方在整个会话期间必须遵守已声明的能力
额外能力可通过协议扩展协商
这确保客户端和服务器对支持的功能有清晰的理解,同时保持协议的可扩展性。
3.6 Stateful vs Stateless
有状态 vs 无状态
Important note: The MCP specification has evolved. Earlier versions (2025-06-18) described MCP as a “stateful session protocol.” However, the July 28, 2026 revision made MCP stateless at its core — every request is self-contained and carries its own protocol version and capabilities.
This change:
Removes the need for session affinity
Simplifies horizontal scaling and load balancing
Makes the protocol easier to operate at scale
For our learning purposes, we’ll focus on the current stateless model while understanding that the SDKs abstract away most of these concerns.