Context7 MCP Server

开发stdiohttp-streamingv1.1.1
代码仓库

将库、框架和 SDK 的最新版本专属文档与代码示例直接加入 AI prompt。Context7 不依赖可能过时的训练数据,而是从源站获取当前文档。支持包括 React、Next.js、Node.js 和 Python 包在内的数千个库。

此描述由机器自动翻译,尚未经过人工审核。

连接

将此配置添加到 .claude/mcp.json

传输方式:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}

工具 (2)

resolve-library-id

Resolve a library name to a Context7 library ID for documentation lookup.

{
  "type": "object",
  "required": [
    "libraryName"
  ],
  "properties": {
    "libraryName": {
      "type": "string",
      "description": "Library name to search for (e.g. \"react\", \"nextjs\", \"express\")"
    }
  }
}

get-library-docs

Fetch up-to-date documentation for a library using its Context7 ID.

{
  "type": "object",
  "required": [
    "context7CompatibleLibraryID"
  ],
  "properties": {
    "topic": {
      "type": "string",
      "description": "Optional topic to focus the documentation on"
    },
    "tokens": {
      "type": "integer",
      "description": "Maximum number of tokens to return (default 5000)"
    },
    "context7CompatibleLibraryID": {
      "type": "string",
      "description": "The Context7 library ID resolved from resolve-library-id"
    }
  }
}

资源

此服务器未提供任何资源。

提示词

此服务器未提供任何提示词。

服务器信息

作者
Upstash (@upstash)
代码仓库
https://github.com/upstash/context7
许可证
Apache-2.0
版本
1.1.1
星标
56,048
最后更新
2026年5月25日