context7-mcp

作者: upstash

当用户询问库、框架、API参考或需要代码示例时,应使用此技能。适用于设置问题、代码…

npx skills add https://github.com/upstash/context7 --skill context7-mcp

When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data.

When to Use This Skill

Activate this skill when the user:

  • Asks setup or configuration questions ("How do I configure Next.js middleware?")
  • Requests code involving libraries ("Write a Prisma query for...")
  • Needs API references ("What are the Supabase auth methods?")
  • Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)

How to Fetch Documentation

Step 1: Resolve the Library ID

Call resolve-library-id with:

  • libraryName: The library name extracted from the user's question
  • query: What to look up in the library's documentation (improves relevance ranking)

Step 2: Select the Best Match

From the resolution results, choose based on:

  • Exact or closest name match to what the user asked for
  • Higher benchmark scores indicate better documentation quality
  • If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs

Step 3: Fetch the Documentation

Call query-docs with:

  • libraryId: The selected Context7 library ID (e.g., /vercel/next.js)
  • query: What to look up in the library's documentation, scoped to a single concept

If the user's question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate query-docs call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic.

Step 4: Use the Documentation

Incorporate the fetched documentation into your response:

  • Answer the user's question using current, accurate information
  • Include relevant code examples from the docs
  • Cite the library version when relevant

Guidelines

  • Be specific: Describe what to look up in the library's documentation, but keep each query to a single concept
  • One topic per query: Split multi-topic questions into separate query-docs calls — resolve the library ID once, then query per concept, unless the question is about how the concepts interact
  • Version awareness: When users mention versions ("Next.js 15", "React 19"), use version-specific library IDs if available from the resolution step
  • Prefer official sources: When multiple matches exist, prefer official/primary packages over community forks

来自 upstash 的更多技能

docs
upstash
从Context7检索并查询任何编程库或框架的最新文档和代码示例。在编写依赖于……的代码时使用。
ctx7-cli
upstash
使用ctx7 CLI获取库文档、管理AI编码技能以及配置Context7 MCP。当用户提到“ctx7”或“context7”时激活…
documentation-lookup
upstash
获取当前库的文档和代码示例,而非依赖训练数据。将库名称解析为Context7文档ID,然后查询安装、配置和API参考信息。支持主流框架和库:React、Vue、Svelte、Next.js、Express、Prisma、Supabase、Tailwind等。自动激活以处理安装问题、代码生成请求和框架相关查询。返回版本感知的文档和官方代码...
redis-js
upstash
使用 Upstash Redis JavaScript/TypeScript SDK 进行无服务器 Redis 操作。适用于缓存、会话存储、速率限制、排行榜、全文…
upstash-search-js
upstash
涵盖Upstash Search快速入门、核心概念及TypeScript SDK使用的文档技能入口。当用户询问如何开始使用时…
upstash/search TypeScript SDK
upstash
upstash/search-typescript-sdk — 一个可安装的AI代理技能,由upstash/search-js发布。
upstash
upstash
与任何Upstash TypeScript/JavaScript SDK配合使用,包括Redis、Box、QStash、Workflow、Vector、Search和Ratelimit。当用户正在使用任何……时使用。
upstash-box-js
upstash
使用 @upstash/box TypeScript/JavaScript SDK 处理沙盒云容器,支持 AI 代理、shell、文件系统和 git。在基于 Upstash 构建时使用…