Core Features 核心功能 主な機能

The Model Context Protocol consists of four primary primitives that enable powerful interactions between clients and servers. 模型上下文协议由四个主要原语组成,实现了客户端和服务器之间的强大交互。 モデルコンテキストプロトコルは、クライアントとサーバー間の強力な相互作用を可能にする4つの主要なプリミティブで構成されています。

1. Resources 1. 资源 (Resources) 1. リソース (Resources)

Resources are passive data that servers expose to clients. They function like file reading. A resource could be a text file, a database row, or an image.

资源是服务器向客户端公开的被动数据。它们的功能类似于文件读取。资源可以是文本文件、数据库行或图像。

リソースは、サーバーがクライアントに公開する受動的なデータです。ファイル読み込みのように機能します。リソースは、テキストファイル、データベースの行、または画像などが該当します。

  • Example: `file:///logs/error.txt`示例: `file:///logs/error.txt`例: `file:///logs/error.txt`
  • Use Case: Providing context to the LLM.用例: 为 LLM 提供上下文。ユースケース: LLMにコンテキストを提供する。

2. Tools 2. 工具 (Tools) 2. ツール (Tools)

Tools are executable functions that the model can call. They allow the AI to take action or fetch dynamic data.

工具是模型可以调用的可执行函数。它们允许 AI 采取行动或获取动态数据。

ツールは、モデルが呼び出すことができる実行可能な関数です。AIがアクションを起こしたり、動的なデータを取得したりすることを可能にします。

  • Example: `get_weather(city="New York")`示例: `get_weather(city="New York")`例: `get_weather(city="New York")`
  • Use Case: API calls, database queries, system operations.用例: API 调用,数据库查询,系统操作。ユースケース: API呼び出し、データベースクエリ、システム操作。

3. Prompts 3. 提示词 (Prompts) 3. プロンプト (Prompts)

Prompts are pre-defined templates that servers provide to help users or models start interactions effectively.

提示词是服务器提供的预定义模板,旨在帮助用户或模型有效地开始交互。

プロンプトは、ユーザーやモデルが効果的に対話を開始できるようにサーバーが提供する事前定義されたテンプレートです。

  • Example: "Analyze this Git commit"示例: “分析这个 Git 提交”例: 「このGitコミットを分析する」
  • Use Case: Standardizing complex tasks.用例: 标准化复杂任务。ユースケース: 複雑なタスクの標準化。

4. Sampling (Agentic) 4. 采样 (Agentic) 4. サンプリング (Agentic)

Sampling allows the server to request a completion from the host's LLM. This enables "agentic" loops where the server can think and act autonomously.

采样允许服务器向主机的 LLM 请求补全。这实现了“代理”循环,服务器可以自主思考和行动。

サンプリングにより、サーバーはホストのLLMに補完を要求できます。これにより、サーバーが自律的に思考し行動できる「エージェント」ループが可能になります。

Back / 返回 / 戻る Overview 概览 概要 Next / 下一步 / 次へ Roadmap 路线图 ロードマップ

References & Evidence 参考资料与证据 参考文献とエビデンス