返回顶部
c

context7

>-

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
60
下载量
0
收藏
概述
安装方式
版本历史

context7

# context7 Look up live, accurate documentation for any library via the context7-mcp server. Prevents hallucinated APIs by fetching real, indexed documentation at query time. ## When to Use Use this skill any time you need accurate, current details about a library — method signatures, config schemas, integration examples, version-specific behaviour. context7 indexes 5000+ libraries including OpenClaw, LangChain, Next.js, Supabase, FastAPI, and more. **Do not rely on training data alone** for library-specific questions; use this skill instead. ## How context7-mcp Works context7-mcp is a Model Context Protocol (MCP) server that queries [context7.com](https://context7.com) for indexed documentation. It exposes two tools: - `resolve-library-id` — resolve a library name to its context7 library ID - `query-docs` — fetch documentation snippets for a specific library + query The server runs via `npx -y @upstash/context7-mcp` with no auth required. ## Workflow ### Step 1: Resolve the library ID Call `resolve-library-id` with the library name and your task as the query. Pick the result with the highest **Benchmark Score** and **Source Reputation: High or Medium** that matches your intent. ``` resolve-library-id( libraryName: "openclawai", query: "how to configure mcp.servers" ) ``` Use the returned library ID (format: `/org/project`) in step 2. ### Step 2: Fetch documentation Call `query-docs` with the library ID and a specific, task-focused query. Narrow queries return better results than broad ones. ``` query-docs( libraryId: "/websites/openclaw_ai", query: "mcp.servers configuration add local stdio process" ) ``` ### Step 3: Apply the result Use the returned code snippets and prose directly. They come with source URLs — cite them when precision matters. ## Tips - **Narrow queries beat broad ones.** "How to authenticate with JWT in Express" beats "authentication". - **Try multiple queries** if the first result is shallow — rephrase around what you actually need to do. - **Use the source URL** in results to fetch more context with `web_fetch` if a snippet is incomplete. - **Call `resolve-library-id` once per library per session** — cache the ID rather than resolving it repeatedly. - **Don't call either tool more than 3 times per question** — if 3 calls haven't found it, use the best result you have. ## OpenClaw MCP Integration If context7-mcp is configured as an OpenClaw MCP server, the tools (`resolve-library-id`, `query-docs`) appear natively in your tool surface without running a subprocess. Apply the same workflow — the tool names and arguments are identical. To check if it's configured: run `/mcp show` and look for `context7`. To configure it (operator slash command): ``` /mcp set context7="{\"command\":\"npx\",\"args\":[\"-y\",\"@upstash/context7-mcp\"]}" ``` ## Manual Testing To verify context7-mcp works on your system: ```bash echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}} {"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \ | npx -y @upstash/context7-mcp 2>/dev/null | grep '"name"' ``` Expected output includes `resolve-library-id` and `query-docs`.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 morrow-context7-1775977700 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 morrow-context7-1775977700 技能

通过命令行安装

skillhub install morrow-context7-1775977700

下载 Zip 包

⬇ 下载 context7 v1.0.0

文件大小: 2.5 KB | 发布时间: 2026-4-13 11:06

v1.0.0 最新 2026-4-13 11:06
Initial release of Morrow Context7 docs skill.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部