with one click
context7
Context7知识库服务,实时获取库文档和代码示例。用户需要查技术文档、代码示例、API参考时说"用context7"或"查文档"。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Context7知识库服务,实时获取库文档和代码示例。用户需要查技术文档、代码示例、API参考时说"用context7"或"查文档"。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | context7 |
| description | Context7知识库服务,实时获取库文档和代码示例。用户需要查技术文档、代码示例、API参考时说"用context7"或"查文档"。 |
| triggers | ["mcp-context7","mcp context7"] |
| mcp | {"type":"remote","url":"https://mcp.context7.com/mcp","headers":{"CONTEXT7_API_KEY":"${CONTEXT7_API_KEY}"}} |
实时文档检索服务,解决LLM训练数据过时问题。
| 工具 | 功能 |
|---|---|
| resolve-library-id | 解析库名称获取ID |
| query-docs | 查询文档和代码示例 |
用户:Next.js 14中间件怎么用?
→ 自动调用:resolve-library-id("next.js") → query-docs("中间件配置")
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
"headers": {"CONTEXT7_API_KEY": "your_key"}
}
}
}
Context7 MCP Server 是由 Upstash 开发的实时文档检索服务:
功能:将库名称解析为Context7兼容的库ID
参数说明:
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| query | string | ✅ | 用户的问题或任务(用于相关性排序) |
| libraryName | string | ✅ | 要搜索的库名称 |
使用示例:
{
"query": "如何设置Next.js中间件",
"libraryName": "next.js"
}
返回:Context7库ID(如 /vercel/next.js)
功能:使用库ID获取相关文档
参数说明:
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| libraryId | string | ✅ | Context7库ID(如 /mongodb/docs) |
| query | string | ✅ | 要获取相关文档的问题或任务 |
使用示例:
{
"libraryId": "/vercel/next.js",
"query": "如何配置中间件进行JWT验证"
}
返回:
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "your_api_key"
}
}
}
}
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp", "--api-key", "your_api_key"]
}
}
}
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
用户:如何使用Next.js 14的App Router?
助手:[在提示中添加 "use context7"]
[Context7自动获取Next.js 14的最新文档]
用户:写一个使用Supabase认证的示例
助手:[提示中添加 "use library /supabase/supabase"]
[直接获取Supabase认证文档]
用户:从Next.js 13迁移到14有哪些变化?
助手:[指定版本查询]
[获取版本迁移指南]
用户:MongoDB的聚合管道怎么用?
助手:[调用 resolve-library-id → query-docs]
[获取聚合管道文档]
在提示中添加 use context7:
创建一个Next.js中间件,检查JWT有效性。use context7
如果已知库ID,直接指定:
使用Supabase实现基础认证。use library /supabase/supabase
提及特定版本号:
如何设置Next.js 14中间件?use context7
建议在MCP客户端中添加规则自动调用:
当我需要库/API文档、代码生成、配置步骤时,自动使用Context7 MCP,无需我明确要求。
设置位置:
Settings > RulesCLAUDE.md# 好的做法
"使用React hooks实现状态管理。use library /facebook/react"
# 不够明确
"用React实现状态管理" # 可能匹配到多个库
# 指定版本
"Next.js 14的App Router配置。use context7"
# 自动匹配最新版
"Next.js的App Router配置。use context7"
# 1. 先解析库ID
library_id = resolve_library_id("Tailwind CSS")
# 2. 再查询具体问题
docs = query_docs(library_id, "如何配置自定义颜色")
⚠️ 重要提示:
Context7支持30+ MCP客户端:
A: 免费使用有速率限制,建议获取API Key
A: 支持主流编程语言和框架,可通过resolve-library-id搜索
A: 访问 context7.com/docs/adding-libraries 提交
A: 实时跟踪官方文档更新
context7(查文档)→ 编写代码 → 测试调试
context7 → deepwiki(背景知识)→ 实践
更新时间: 2026-03-08 版本: 1.0
Word文档处理:创建、编辑、读取.docx文件。用户提到"Word"、"文档"、".docx"、"报告"、"信函"时使用。
使用腾讯云 API 密钥调用腾讯云各种服务,包括翻译、CVM、COS等。
图片识别与图文理解,基于 PaddleOCR-VL 模型,支持识别图片中的文字、场景、物体等信息。支持109种语言,可输出JSON或Markdown格式。
You MUST use this for gathering contexts before any work. This is a Knowledge management for AI agents. Use `brv` to store and retrieve project patterns, decisions, and architectural rules in .brv/context-tree. Uses a configured LLM provider (default: ByteRover, no API key needed) for query and curate operations.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack 🦞