Seth Rose

Context7 MCP

AI 智慧體v1.0.3
作者:Seth Rose更新於 2026-05-11共 4 個版本 · 最新版本釋出於 2026-01-21context7@clawhub_thesethrose/context7
上下文管理工具呼叫#Documentation

據 AlphaMoat 統計,截至 2026-10,Context7 MCP 累計下載 14,900 次、獲 18 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 1,872 位,在「AI 智慧體」分類(1,632 個)中排名第 262 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
1.5萬
星標
18
全站下載量排名
#1,872
全站前 18% · 「AI 智慧體」前 17%
平台累計下載星標評論
ClawHub ↗1.2萬183
SkillHub ↗1.5萬18—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

技能透過 Context7 的 MCP 服務按庫名檢索文件,返回庫標識、可信度評分與相關片段,供後續按庫查資料。使用前需要把示例環境檔案複製成 .env 並填入 API 金鑰。 可信度評分不代表官方正確性保證;應對照該套件的最新文件核實檢索片段。

資料釋出於 2026-10-27

可以用來做什麼

  • 查某個前端框架的當前版本文件
  • 核對一個庫的推薦用法與介面說明

什麼時候用

  • 不確定某庫當前 API 怎麼寫時
  • 需要帶來源評分的文件片段而不是搜尋摘要時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

幫我查這個框架最新的路由配置文件,給出庫標識和可信度
這個庫的鑑權該怎麼寫,按文件片段整理一份示例

月度資料趨勢

累計下載1.5萬
69061.1萬1.5萬2026-03 · 累計下載 74982026-05 · 累計下載 92812026-06 · 累計下載 96932026-07 · 累計下載 1萬2026-08 · 累計下載 1.1萬2026-09 · 累計下載 1.2萬2026-10 · 累計下載 1.5萬26-0326-0926-10
星標18
1517182026-03 · 星標 152026-05 · 星標 182026-06 · 星標 182026-07 · 星標 182026-08 · 星標 182026-09 · 星標 182026-10 · 星標 1826-0326-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。 該技能有同名的其他版本,調整前的資料歸屬當前下載量最大的這一個。

月份累計下載環比星標
2026-101.5萬—18
2026-091.2萬—18
2026-081.1萬+2.4%18
2026-071萬+7.8%18
2026-069693+4.4%18
2026-059281—18
2026-037498—15

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

4.6 KB · ClawHub v1.0.3
---
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
展開全部(共 174 行)
    install:
      - id: "skill-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:
   ```bash
   cp .env.example .env
   ```

   Add your API key to `.env`:
   ```
   CONTEXT7_API_KEY=your-api-key-here
   ```

   Get your key from [context7.com/dashboard](https://context7.com/dashboard)

2. Install dependencies:
   ```bash
   npm install
   ```

## Usage

Context7 provides two main commands:

### Search Command

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

```bash
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:

```bash
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

```bash
# 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

「AI 智慧體」分類下的熱門技能

Seth Rose 的其他技能

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。