The Model Context Protocol (MCP) defines three core primitives that servers can expose to clients: Tools, Resources, and Prompts. These are the fundamental building blocks that enable rich interactions between clients, servers, and language models.
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 (模型控制)
4.1 Tools
工具—— “执行者 / The Doers”
Tools are executable functions that perform actions or computations. They are callable functions that the AI agent invokes to take an action or retrieve data. The agent reads the tool’s name and description and decides when to call it based on the user’s request.
CN: Tools(工具)是执行动作或计算的可执行函数。它们是 AI 代理调用的可调用函数,用于执行操作或检索数据。代理读取工具的名称和描述,并根据用户的请求决定何时调用它。
Core Characteristics
Feature
Description
Model-controlled
The LLM decides when and whether to call the tool
Typed parameters
Accept typed, named parameters
Can write data
Can have side effects — write, update, delete
Has description
Description guides agent behavior
Counts as a tool call
Consumes tool-call budget
Best for
Actions, queries with parameters, dynamic operations
CN:
特征
说明
模型控制
LLM 决定何时以及是否调用
类型化参数
接受带类型、带名称的参数
可写入数据
可以有副作用 —— 写入、更新、删除
有描述
描述引导代理的行为
算作一次工具调用
消耗工具调用预算
最适合
动作、带参数的查询、动态操作
When to Use Tools?
The agent needs to decide when and whether to call it
The operation requires parameters beyond a simple identifier
The capability involves writes, state changes, or dynamic queries
You want the tool description to guide agent behavior
CN:
代理需要决定何时以及是否调用它
操作需要的参数不仅仅是简单的标识符
能力涉及写入、状态变更或动态查询
你希望工具描述来引导代理的行为
4.2 Resources
资源—— “知识库 / The Knowledge Stores”
Resources are read-only data endpoints identified by a URI. They are structured data or content that provides additional context to the model. Resources expose stable reference data that the agent or client can fetch without any decision-making.
CN: Resources(资源)是由 URI 标识的只读数据端点。它们是为模型提供额外上下文的结构化数据或内容。Resources 暴露稳定的参考数据,代理或客户端无需任何决策即可获取。
Core Characteristics
Feature
Description
Application-controlled
Client manages what data to attach
Read-only
Cannot write data — no side effects
URI-identified
Accessed via a stable, predictable URI
No description
No description to guide agent; just data
No tool-call cost
Does NOT count as a tool call
Best for
Reference lookups, pre-loaded context
CN:
特征
说明
应用程序控制
客户端管理要附加哪些数据
只读
不能写入数据 —— 无副作用
URI 标识
通过稳定、可预测的 URI 访问
无描述
没有描述来引导代理;只是数据
无工具调用成本
不算作工具调用
最适合
参考查找、预加载的上下文
When to Use Resources
The data is read-only and identified by a stable, predictable URI
The information is needed frequently and does not change mid-session
You want the client or agent to load context without consuming tool-call budget
The dataset is small enough to fit in context
CN:
数据是只读的,由稳定、可预测的 URI 标识
信息被频繁需要,且在会话期间不会变化
你希望客户端或代理加载上下文而不消耗工具调用预算
数据集足够小,可以放入上下文中
Common Examples
db://tables → list of all table names
db://schemas → schema definitions
file://config.json → configuration file content
git://history → git commit history
Company handbooks, policy documents
Product catalogs, customer records
CN:
db://tables → 所有表名的列表
db://schemas → 模式定义
file://config.json → 配置文件内容
git://history → git 提交历史
公司手册、政策文件
产品目录、客户记录
4.3 Prompts
提示—— “行为模板 / The Behavior Templates”
Prompts are pre-defined templates or instructions that guide language model interactions. They are named instruction templates that define the AI’s behavior in a specific domain. Prompts explain how to combine tools for real-world tasks and provide guidance on how to approach problems.
CN: Prompts(提示)是指导语言模型交互的预定义模板或指令。它们是命名的指令模板,定义 AI 在特定领域的行为。Prompts 解释如何组合工具来完成实际任务,并提供如何处理问题的指导。
Core Characteristics
Feature
Description
User-controlled
User explicitly selects which prompt to use
Read-only
Cannot write data — no side effects
Has description
Description guides agent behavior
No tool-call cost
Does NOT count as a tool call
Best for
System instructions, workflow recipes
CN:
特征
说明
用户控制
用户明确选择使用哪个提示
只读
不能写入数据 —— 无副作用
有描述
描述引导代理的行为
无工具调用成本
不算作工具调用
最适合
系统指令、工作流配方
When to Use Prompts
You want to provide step-by-step sequences for common tasks
You want to explain domain-specific concepts
You want to mention available resources and when to use them
You want to set tone, style, and persona for the AI
CN:
你想为常见任务提供分步序列
你想解释领域特定的概念
你想提及可用的资源以及何时使用它们
你想为 AI 设定语气、风格和人格
Common Examples
System messages to set global tone and constraints
Task-specific instructions embedded in context
Reusable templates for summarization, extraction, or translation
Pre-built directives enforcing format, safety, and validation rules
Slash commands in Claude Code: /mcp__my-server__analyze-customer
CN:
设置全局语气和约束的系统消息
嵌入上下文的任务特定指令
用于摘要、提取或翻译的可重用模板
强制执行格式、安全和验证规则的预构建指令
Claude Code 中的斜杠命令:/mcp__my-server__analyze-customer
Key Takeaways
要点 (Key Point)
EN
CN
三类原语
MCP defines three primitives: Tools, Resources, and Prompts
MCP 定义三个原语:Tools、Resources 和 Prompts
Tools = 执行者
Tools are executable functions that perform actions
Tools 是执行动作的可执行函数
Resources = 知识库
Resources are read-only data endpoints providing context
Resources 是提供上下文的只读数据端点
Prompts = 行为模板
Prompts are instruction templates guiding AI behavior