context7-mcp
Skill này làm gì
Skill này khiến agent kiểm tra tài liệu hiện tại của thư viện và framework phần mềm trước khi trả lời. Skill dành cho lập trình viên muốn có code chính xác thay vì ví dụ đã lỗi thời.
Khi nào nên dùng
- ✓Khi bạn nhờ agent viết code dùng một thư viện như React, Next.js hoặc Prisma.
- ✓Khi bạn hỏi một câu hỏi về cài đặt hoặc cấu hình của một framework.
- ✓Khi bạn cần đúng các phương thức API của một công cụ đang dùng.
Liên kết skill
https://github.com/upstash/context7/blob/master/packages/opencode/skills/context7-mcp/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy chỉ cho tôi cách thiết lập proxy Next.js theo tài liệu mới nhất.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trước hết tìm thư viện phù hợp trong chỉ mục của Context7, rồi lấy tài liệu cho câu hỏi của bạn. Agent trả lời dựa trên tài liệu đó, chứ không chỉ dựa vào trí nhớ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 a Next.js proxy?")
- 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 questionquery: 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-docscalls — 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 16", "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
Câu hỏi thường gặp
Vì sao không chỉ dựa vào trí nhớ của agent?
Thư viện thay đổi thường xuyên, nên trí nhớ có thể đã lỗi thời. Tài liệu hiện tại giúp tránh các ví dụ code cũ.
Skill có thể tìm tài liệu cho một phiên bản cụ thể không?
Có, nếu bạn nêu một phiên bản như React 19, skill ưu tiên tài liệu dành riêng cho phiên bản đó.
Skill có làm việc với nhiều công cụ không?
Skill làm việc với nhiều thư viện và framework, như React, Vue, Next.js, Prisma và Supabase.
Chi tiết
Mô tả gốc của tác giả
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
repo: upstash/context7
Độ phổ biến
- Sao GitHub
- 64k
- Vị trí xếp hạng
- #3164
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
context7-docs
64kGiúp agent lấy tài liệu và ví dụ code cập nhật cho bất kỳ thư viện, framework, SDK hoặc dịch vụ đám mây nào trước khi trả lời.
context7-cli
64kGiúp agent dùng công cụ dòng lệnh ctx7 để lấy tài liệu thư viện và thiết lập Context7 cho trình soạn code của bạn.
find-docs
64kGiúp agent tra cứu tài liệu hiện tại, tham chiếu API và ví dụ code cho bất kỳ công cụ lập trình, thư viện hoặc dịch vụ đám mây nào.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.