> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 概述

服务器通过 MCP 为语言模型添加上下文提供了基本构建块。这些原语使客户端、服务器和语言模型之间能够实现丰富的交互：

* **提示（Prompts）**：预定义的模板或指令，用于指导语言模型交互
* **资源（Resources）**：为模型提供额外上下文的结构化数据或内容
* **工具（Tools）**：可执行的函数，允许模型执行操作或检索信息

每个原语都可以在以下控制层次结构中进行总结：

| 原语            | 控制方    | 描述               | 示例               |
| ------------- | ------ | ---------------- | ---------------- |
| 提示（Prompts）   | 用户控制   | 由用户选择触发的交互式模板    | 斜杠命令、菜单选项        |
| 资源（Resources） | 应用程序控制 | 由客户端附加和管理的上下文数据  | 文件内容、Git 历史      |
| 工具（Tools）     | 模型控制   | 暴露给 LLM 以执行操作的函数 | API POST 请求、文件写入 |

在下面更详细地探索这些关键原语：

<CardGroup cols={3}>
  <Card title="提示（Prompts）" icon="message" href="/specification/2024-11-05/server/prompts" />

  <Card title="资源（Resources）" icon="file-lines" href="/specification/2024-11-05/server/resources" />

  <Card title="工具（Tools）" icon="wrench" href="/specification/2024-11-05/server/tools" />
</CardGroup>
