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

# Mintlify Index

> 通过一个 MCP 服务器或 REST API，为编码代理提供来自发布者维护的文档和 Web 的最新技术上下文。

Mintlify Index 为编码代理提供一个统一的技术知识搜索层。它会将关于已索引产品的问题路由到托管在 Mintlify 上、由发布者维护的文档，并使用 Web 搜索处理不属于该语料库的问题。

你可以通过公开 MCP 服务器或受访问控制的 REST API 使用 Index。

* **MCP 服务器**：连接 AI 工具，让它在你工作时检索带有来源引用的上下文。公开提供，无需 API key。
* **REST API**：搜索排名后的来源，在 token 预算内组装上下文，或获取所选结果的内容。受访问控制，需要 Index API key。

<div id="get-started">
  ## 开始使用
</div>

<CardGroup cols={3}>
  <Card title="连接你的编码代理" icon="plug-zap" href="/docs/zh/search-index/connect">
    将 Index 添加到 Claude Code、Codex、Cursor 和其他编码代理。
  </Card>

  <Card title="MCP 参考" icon="book-open" href="/docs/zh/search-index/mcp">
    查看 `context` 工具、输入字段、输出和速率限制。
  </Card>

  <Card title="REST API" icon="file-braces" href="/docs/zh/api/search-index/introduction">
    在应用或代理中使用 `search`、`context` 和 `contents`。
  </Card>
</CardGroup>

<div id="how-index-retrieves-context">
  ## Index 如何检索上下文
</div>

<Steps>
  <Step title="路由问题">
    Index 会判断问题涉及其文档语料库中的产品，还是需要更广泛的 Web 结果。
  </Step>

  <Step title="检索相关来源">
    针对特定产品的问题会搜索发布者的最新文档，其他问题则会搜索 Web。
  </Step>

  <Step title="返回适合代理使用的上下文">
    Index 会为结果排序，并返回带有相关内容的来源 URL。MCP 的 `context` 工具和 REST 的 `context` 端点会在 token 预算内组装这些内容。
  </Step>
</Steps>

<div id="choose-a-retrieval-operation">
  ## 选择检索操作
</div>

* **[`context`](/docs/zh/api/search-index/context)**：适用于大多数代理任务。在一次请求中返回一组紧凑的带引用来源材料。
* **[`search`](/docs/zh/api/search-index/search)**：当应用需要排名后的结果并自行决定读取哪些来源时使用。可通过 REST API 使用。
* **[`contents`](/docs/zh/api/search-index/contents)**：在 `search` 之后使用，获取所选 Mintlify 结果 ID 或结果 URL 对应的内容。可通过 REST API 使用。


## Related topics

- [Mintlify Index](/docs/fr/search-index/index.md)
- [Mintlify REST API introduction](/docs/api/introduction.md)
- [Introduction à l'API REST Mintlify](/docs/fr/api/introduction.md)
