Type: entity
Confidence: 0.70
Created: 2026-04-18
Updated: 2026-04-18
Tags: 工具MCP文档检索开发工具工具与框架

Context7

概述

由 Upstash 开发的 MCP 服务器工具,为 AI Agent 提供实时文档检索能力,通过 npx @upstash/context7-mcp 启动,支持代码示例和 API 文档的按需查询。

关键内容

  1. 定位:Context7 是一个 MCP Server,专注于为 LLM Agent 提供最新、准确的库和框架文档。解决训练数据过时问题,让 Agent 能查询任意库的当前 API。

  2. 使用方式toml [mcp_servers.context7] command = "npx" args = ["-y", "@upstash/context7-mcp@latest"] enabled = true 通过 stdio 传输协议运行,Codex 启动时自动连接并发现其工具。

  3. 典型工具:暴露 search_docsget_code_examples 等工具,Agent 可在推理时按需查询任何库的文档。

  4. 在 Codex 中的角色:作为 config.toml 中声明的 MCP 服务器之一,启动时被 Codex 的 MCP Client 连接,其工具清单通过 tools/list 接口获取并注入 LLM 的 system prompt。

来源

相关