Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

context7Context7 文档搜索

Agent Skill

context7 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

198

周安装

8

GitHub Stars

177

下载量

62
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context7(Context7 文档搜索)
来源仓库:https://github.com/moltbot/skills
仓库路径:skills/context7
安装命令:
npx skills add moltbot/skills --skill "context7"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add moltbot/skills --skill "context7"

简介

context7 是智能文档搜索工具,支持图书馆级知识库检索。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中的上下文感知问答。
  • 通过 npx skills add moltbot/skills --skill "context7" 安装使用。
  • 需配置文档索引路径和缓存策略以提升性能。
  • context7 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
context7
description
Context7 MCP - Intelligent documentation search and context for any library
metadata
version
1.0.3
tags
["documentation", "search", "context", "mcp", "llm"]
clawdbot
requires
bins
["node"]
npm
true
install
kind
skill
source
clawdhub
slug
context7
label
Install Context7 skill

Context7 MCP

Context7 provides intelligent documentation search and context for any library, powered by LLMs.

Setup

  1. Copy .env.example to .env and add your Context7 API key:
   cp .env.example .env

Add your API key to .env:

   CONTEXT7_API_KEY=your-api-key-here

Get your key from context7.com/dashboard

  1. Install dependencies:
   npm install

Usage

Context7 provides two main commands:

Search Command

Search for libraries by name with intelligent LLM-powered ranking:

npx tsx query.ts search <library_name> <query>

# Examples:
npx tsx query.ts search "nextjs" "setup ssr"
npx tsx query.ts search "react" "useEffect cleanup"
npx tsx query.ts search "better-auth" "authentication flow"

This calls the Context7 Search API:

GET https://context7.com/api/v2/libs/search?libraryName=<name>&query=<query>

Response includes:

  • id: Library ID (e.g., /vercel/next.js)
  • name: Display name
  • trustScore: Source reputation (0-100)
  • benchmarkScore: Quality indicator (0-100)
  • versions: Available version tags

Context Command

Retrieve intelligent, LLM-reranked documentation context:

npx tsx query.ts context <owner/repo> <query>

# Examples:
npx tsx query.ts context "vercel/next.js" "setup ssr"
npx tsx query.ts context "facebook/react" "useState hook"

This calls the Context7 Context API:

GET https://context7.com/api/v2/context?libraryId=<repo>&query=<query>&type=txt

Response includes:

  • title: Documentation section title
  • content: Documentation text/snippet
  • source: URL to source page

Quick Reference

# Search for documentation
npx tsx query.ts search "library-name" "your search query"

# Get context from a specific repo
npx tsx query.ts context "owner/repo" "your question"

Best Practices

Get the most out of the Context7 API with these best practices:

Optimize Search Relevance

When using the /libs/search endpoint, always include the user's original question in the query parameter. This allows the API to use LLM-powered ranking to find the most relevant library for the specific task, rather than relying on a simple name match.

Example: If a user asks about SSR in Next.js, search with:

  • libraryName=nextjs
  • query=setup+ssr

This ensures the best ranking for the specific task.

Use Specific Library IDs

For the fastest and most accurate results with the /context endpoint, provide the full libraryId (e.g., /vercel/next.js). If you already know the library the user is asking about, skipping the search step and calling the context endpoint directly reduces latency.

Leverage Versioning

To ensure documentation accuracy for older or specific project requirements, include the version in the libraryId using the /owner/repo/version format. You can find available version tags in the response from the search endpoint.

Choose the Right Response Type

Tailor the /context response to your needs using the type parameter:

  • Use type=json when you need to programmatically handle titles, content snippets, and source URLs (ideal for UI display).
  • Use type=txt when you want to pipe the documentation directly into an LLM prompt as plain text.

Filter by Quality Scores

When programmatically selecting a library from search results, use the trustScore and benchmarkScore to prioritize high-quality, reputable documentation sources for your users.

Find Navigation Pages

Find navigation and other pages in this documentation by fetching the llms.txt file at:

https://context7.com/docs/llms.txt

API Reference

Context7 REST API

Search Endpoint:

GET https://context7.com/api/v2/libs/search
  ?libraryName=<library_name>
  &query=<user_query>

Context Endpoint:

GET https://context7.com/api/v2/context
  ?libraryId=<owner/repo>
  &query=<user_query>
  &type=txt|json

Troubleshooting

No results found?

  • Check your API key is valid
  • Verify the library name is correct (e.g., 'react' not 'React')

Authentication errors?

  • Ensure CONTEXT7_API_KEY is set in .env
  • Check your key hasn't expired at context7.com/dashboard

License

MIT

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

windsurf

27.35%
按下载量换算17

OpenCode

24.67%
按下载量换算15

Cursor

15.43%
按下载量换算10

Codex

13.2%
按下载量换算8

Claude Code

6.98%
按下载量换算4

Antigravity

3.55%
按下载量换算2

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills