# Mintlify Index (/zh/search-index)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1284 · updated: 2026-09-23 -->

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

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

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

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

<CardGroup cols="3">
  <Card title="连接你的编码代理" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M9 2L9 5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M15 2L15 5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M12 18L12 22&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M12.6939 8.5L10.6029 10.6749C10.3788 10.9079 10.5394 11.2433 10.9048 11.3053L13.0952 11.6773C13.4848 11.7434 13.6334 12.1147 13.361 12.3413L10.7666 14.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M14.3066 5L9.69342 5C7.5551 5 6.48594 5 5.89527 5.69774C5.3046 6.39548 5.46717 7.46639 5.79232 9.60823L6.31604 13.0581C6.83606 16.4836 8.28588 18 12 18C15.7141 18 17.1639 16.4836 17.684 13.0581L18.2077 9.60823C18.5328 7.46639 18.6954 6.39548 18.1047 5.69774C17.5141 5 16.4449 5 14.3066 5Z&#x22; stroke=&#x22;currentColor&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/search-index/connect">
    将 Index 添加到 Claude Code、Codex、Cursor 和其他编码代理。
  </Card>

  <Card title="MCP 参考" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M5.33333 3.00001C7.79379 2.99657 10.1685 3.88709 12 5.5V21C10.1685 19.3871 7.79379 18.4966 5.33333 18.5C3.77132 18.5 2.99032 18.5 2.64526 18.2792C2.4381 18.1466 2.35346 18.0619 2.22086 17.8547C2 17.5097 2 16.8941 2 15.6629V6.40322C2 4.97543 2 4.26154 2.54874 3.68286C3.09748 3.10418 3.65923 3.07432 4.78272 3.0146C4.965 3.00491 5.14858 3.00001 5.33333 3.00001Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M18.6667 3.00001C16.2062 2.99657 13.8315 3.88709 12 5.5V21C13.8315 19.3871 16.2062 18.4966 18.6667 18.5C20.2287 18.5 21.0097 18.5 21.3547 18.2792C21.5619 18.1466 21.6465 18.0619 21.7791 17.8547C22 17.5097 22 16.8941 22 15.6629V6.40322C22 4.97543 22 4.26154 21.4513 3.68286C20.9025 3.10418 20.3408 3.07432 19.2173 3.0146C19.035 3.00491 18.8514 3.00001 18.6667 3.00001Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/search-index/mcp">
    查看 `context` 工具、输入字段、输出和速率限制。
  </Card>

  <Card title="REST API" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M14 12C14.5523 12 15 12.4477 15 13V14C15 14.5523 15.4477 15 16 15C15.4477 15 15 15.4477 15 16V17C15 17.5523 14.5523 18 14 18M10 12C9.44772 12 9 12.4477 9 13V14C9 14.5523 8.55228 15 8 15C8.55228 15 9 15.4477 9 16V17C9 17.5523 9.44772 18 10 18&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/api/search-index/introduction">
    在应用或代理中使用 `search`、`context` 和 `contents`。
  </Card>
</CardGroup>

<div id="how-index-retrieves-context">
  ## Index 如何检索上下文 [#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`](/zh/api/search-index/context)**：适用于大多数代理任务。在一次请求中返回一组紧凑的带引用来源材料。
* **[`search`](/zh/api/search-index/search)**：当应用需要排名后的结果并自行决定读取哪些来源时使用。可通过 REST API 使用。
* **[`contents`](/zh/api/search-index/contents)**：在 `search` 之后使用，获取所选 Mintlify 结果 ID 或结果 URL 对应的内容。可通过 REST API 使用。
