本文へ移動
cccskills
無料GitHub で公開

context7

Fetch up-to-date library, framework, and SDK documentation via Context7's search and docs endpoints. Use when the user asks about a library/API (React, Next.js, Prisma, Supabase, Tailwind, Django, Vue, etc.) and you need current docs, not Claude's training-time knowledge. Skip this skill for generic programming questions that don't require library-specific docs.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Context7

Live documentation lookup for libraries, frameworks, and SDKs. Operates Context7 via its public REST API — no MCP server required.

Use this instead of training memory whenever the answer depends on the library's current behavior (current major version, recent API changes, new methods, deprecations). Training data goes stale fast for active libraries.

When to use vs. skip

Use Context7Skip Context7
"How do I do X in Next.js 15 / React 19 / Prisma 6?""What's a closure in JavaScript?" (language concept)
"What's the right way to set up Auth.js v5 middleware?""Fix this TypeError in my code" (debugging user's own code)
"Did the Supabase client API change for storage uploads?""Convert this loop to a map" (pure refactor, no SDK)
Anything where you'd otherwise hedge with "as of my training cutoff…"Std-lib (fs, os, collections) unless asking about a recent runtime version

If you catch yourself about to write code from memory for a library that's released in the last 18 months, stop and call this skill first.

Credentials check

[ -n "$CONTEXT7_API_KEY" ] && echo "CONTEXT7_API_KEY: PRESENT" || echo "CONTEXT7_API_KEY: MISSING"

Never echo the variable directly — the value would land in the conversation transcript.

If MISSING, respond to the user with EXACTLY this message (do NOT paraphrase, do NOT suggest manual JSON edits):

I need your context7 credential. Run this in another terminal — it'll open the signup page, validate format, and save it safely with masked input:

teleport-setup add-key context7

Then restart Claude Code (/exit, then claude) and ask me again.

Do NOT suggest editing ~/.claude/settings.local.json manually. Stop execution until the user has run the command and restarted.

API

  • Base URL: https://context7.com/api/v1
  • Auth header: Authorization: Bearer $CONTEXT7_API_KEY
  • All requests are GET. Responses are markdown by default (type=txt) or JSON (type=json).

Two-step workflow

Docs lookup is two calls: (1) resolve the library name to its canonical libraryId, (2) fetch docs for that ID, scoped by topic.

Step 1 — Resolve library name → library ID

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/search?query=next.js"

Returns an array of matches. For each candidate, weigh:

  • Name match — does it actually correspond to what the user asked? "next.js auth" returns both /vercel/next.js and /nextauthjs/next-auth. Different libraries.
  • Trust / popularity signal — when present in the result (trustScore, totalSnippets, stars), prefer high values. Low-trust forks usually mean unofficial mirrors.
  • lastUpdate recency — abandoned mirrors with stale docs are worse than the canonical repo.
  • Maintainer org — /vercel/next.js (official) beats /some-fork/next.js-clone.

When uncertain between 2–3 close matches, do NOT guess. Show the top candidates to the user with a one-line description each and ask which one they want. A wrong libraryId silently returns wrong docs — that's worse than no docs.

Step 2 — Fetch docs for the library

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=app-router&tokens=5000"

Path:

  • {libraryId} is appended verbatim. Pass /vercel/next.js as-is — do NOT URL-encode the leading slash (would become %2Fvercel%2Fnext.js and 404).

Query params:

ParamDefaultUse
topicnoneSingle keyword that filters the docs to a slice. Almost always set this — see sizing below.
tokens10000Cap on response size. Min 1000.
typetxttxt returns markdown (default, best for reading). json returns structured snippet array.

Topic + token sizing — pick deliberately

Question shapetopictokens
Quick API check: "is useFormState still a thing?"forms or hooks2000–3000
How-to: "how do I set up middleware auth?"middleware-auth4000–5000
Migration / deep dive: "what changed v4 → v5?"migration or v58000–10000
Browsing: "what does this library even do?"omit5000

A full docs dump without topic is almost never what you want — it wastes tokens and dilutes signal.

Common patterns

# Resolve + fetch in one go for a common library
LIB_ID=$(curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/search?query=auth.js" \
  | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['results'][0]['libraryId'])")

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1${LIB_ID}?topic=nextjs-setup&tokens=5000"

# Skip search if you're 100% sure of the canonical ID (well-known orgs)
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=app-router&tokens=5000"

# Multi-library question: resolve + fetch each, then synthesize.
# Run them in parallel via & for speed.
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=middleware&tokens=4000" > /tmp/next.md &
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/nextauthjs/next-auth?topic=v5-middleware&tokens=4000" > /tmp/auth.md &
wait

Gotchas

  • Wrong library wins silently. A bad pick at step 1 returns docs that look authoritative for the wrong project. Always sanity-check that the response opens with the library you expected.
  • Don't paraphrase from training memory. The whole reason to call Context7 is freshness — quote / adapt from the returned docs, and if the response contradicts what you "remember", trust the response.
  • 404 on a fetch usually means a typo in libraryId or URL-encoded slash. Re-check the path is /{org}/{repo} literal.
  • Library not in catalog — search returns no matches → fall back to web search and tell the user Context7 didn't have it. Don't fabricate a libraryId.
  • tokens < 1000 is rejected. Use 2000 as the practical floor.
  • topic is a free-text filter, not an enum. Phrase it like a section title in the docs (server-actions, migration-v5, middleware-auth). Multi-word topics use hyphens.
  • Response is markdown with code fences. When piping into another tool, prefer type=json to avoid re-parsing the markdown structure.
  • Rate limits — free tier is generous for /v1/{libraryId} fetches and lighter for /search. Batch your search calls; don't loop.

Attribution

When done, state: Used skill: Context7 (from teleport catalog).

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

{{One-sentence what-it-does + when to use it. Mention it bypasses the MCP via the REST API with {{ENV_VAR}}. Use when the user wants X, Y, Z programmatically without the {{service}} MCP installed.}}

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

Manage Cloudflare DNS zones, Workers, Pages, R2, KV, D1, and analytics via REST API. Use when the user wants to query DNS, deploy a Worker, list R2 buckets, manage KV namespaces, run D1 queries, or check analytics without the Cloudflare MCP installed.

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

discord

無料

Operate Discord via its REST API — post/read channel messages, manage guilds + roles, fire webhooks, register slash commands. Use when the user wants a bot to post to a channel, read recent history, run a community admin task, or ship one-way notifications via webhook URL without running a bot process.

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

exa

無料

AI-first web search via Exa — semantic/neural ranking, category-scoped results, fresh content retrieval, and one-shot answer synthesis with citations. Use when the user needs current web information better ranked than general web search, or a grounded answer with sources.

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

figma

無料

Read Figma files, component libraries, styles, comments, and export rendered assets (PNG / SVG / JPG / PDF) via Figma's REST API. Use when the user needs programmatic access to design files, to pull node data into code generation, or to export assets without opening the Figma desktop app.

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

github

無料

Operate on GitHub via the REST API — repos, PRs, issues, code search, actions, releases. Use when the user wants scripted / cross-repo operations, doesn't have `gh` installed, or needs behavior the `gh` CLI doesn't expose cleanly.

日本語の概要は準備中です。原文の説明を表示しています。

mnlt/teleport82026年4月25日 更新

mnlt のスキルをすべて見る

このスキルの問題を報告する