"Verify or configure Context7 for this plugin's lookups — check the ctx7 CLI, CONTEXT7_API_KEY auth, and the Context7 MCP server, then install/upgrade the CLI on request. Use when: 'set up context7', 'configure context7', 'is context7 working', 'context7 setup', 'install ctx7', 'context7 auth', 'add the Context7 MCP server'. Actions: check (read-only verification, default) | apply (resolve what check found) | apply install-cli (also install/upgrade the ctx7 CLI)."
Resources
1Install
npx skillscat add melodic-software/claude-code-plugins/plugins-context7-skills-setup Install via the SkillsCat registry.
This skill verifies and configures the Context7 environment by checking the CLI installation, API authentication, and MCP server status. It resolves configuration issues and manages CLI updates to ensure successful plugin lookups. Use this skill when setting up, troubleshooting, or upgrading the Context7 integration.
Pre-computed context
Installed CLI version: !ctx7 --version 2>/dev/null || echo "not installed"
Latest published CLI version: !npm view ctx7 version 2>/dev/null || echo "unknown (npm registry unreachable)"
MCP availability: check your own tool list — if mcp__context7__resolve-library-id / mcp__context7__query-docs are present, the Context7 MCP server is already configured.
Purpose
Bring the local environment to a working state for /context7:lookup. Two independent paths,
either alone sufficient: the CLI (ctx7 via npm) and the Context7 MCP server (configured
by the consuming project). An optional CONTEXT7_API_KEY raises rate limits for both.
Check-centric per the uniform contract: check inspects and reports, apply resolves whatcheck found, and the CLI install is a distinct opt-in subaction. Idempotent and transparent:
safe to rerun. Report what is already in place before touching anything, and when both paths are
already working, confirm the verified state and make no changes.
Action routing: no argument or check runs the check; apply runs the check first, then the
guidance-only remediations (auth, MCP routing); apply install-cli additionally authorizes the
global ctx7 install/upgrade below. All actions are non-interactive when the action is given —
never prompt.
check (read-only)
Work top-down from the pre-computed context and report a PASS/FAIL/INFO table with one
remediation line per FAIL. Do not install, edit config, or write anything.
- CLI path — from the pre-computed block: is
ctx7installed, and does it match the latest
published version? A working, current CLI is PASS. Installed-but-behind is INFO with
remediationapply install-cli. Absent is INFO only when the MCP path is live (below);
otherwise it is a FAIL of the "at least one path works" requirement. - MCP path — is the Context7 MCP server present in your tool list? Present is PASS; absent is
INFO (the MCP interface is optional — the CLI alone is sufficient). - At least one path — FAIL only when neither the CLI nor the MCP server resolves; every
lookup would then be blocked. Remediation:apply install-cli, or add the MCP server (routed
inapply). - Auth — INFO: report whether
CONTEXT7_API_KEYis present in the environment
([ -n "$CONTEXT7_API_KEY" ]). Report presence only — never print or echo the value.
Anonymous usage works at low rates, so absence is never a FAIL. - Windows Git Bash — INFO: CLI
ctx7 docs /org/project "..."calls must be prefixed withMSYS_NO_PATHCONV=1(a no-op on macOS/Linux — safe to always include), or the/org/project
ID gets path-mangled. Full explanation:${CLAUDE_PLUGIN_ROOT}/skills/lookup/context/cli.md.
apply (idempotent)
Run check, then resolve each finding. Re-running after both paths are working changes nothing
and reports "already configured". State each change before making it, and re-detect before
claiming it.
apply install-cli— install or upgrade the CLI. Only with this subaction, and only whencheckfoundctx7missing or behind latest:npm install -g ctx7@latestNo global install available?
npx ctx7@latest <command>works per-invocation. Version floor,
npx trade-offs, and the full command/flag reference:${CLAUDE_PLUGIN_ROOT}/skills/lookup/context/cli.md. After installing, re-read the CLI version
and report the observed result — never claim upgraded on the install command's exit code alone.Auth (optional, both paths) — guidance only. For higher limits, direct the user to set
CONTEXT7_API_KEYin their own shell profile / secret store:export CONTEXT7_API_KEY="<your-key>"Prefer this over
ctx7 login. Never write the key into the repository, Claude Code settings,
or an MCP config file, and never print its value. An environment-variable change takes effect
in a fresh session; report its presence only and defer verification to that fresh session.
Rationale and thectx7 logincaveat:${CLAUDE_PLUGIN_ROOT}/skills/lookup/context/cli.md.MCP path (optional) — guidance only. If the user wants the MCP interface (cleaner output,
~1.8× more content per call, no Windows ceremony), route them to add acontext7server entry
to their own MCP configuration. The exact JSON — anonymous and API-key forms, plus the
"unset env var breaks config parsing" caveat — lives in${CLAUDE_PLUGIN_ROOT}/skills/lookup/context/mcp.md. Do not edit their.mcp.jsonfor them.Verify. Re-read the CLI version and your tool list. Confirm at least one path (CLI or MCP)
is live before declaring setup complete.
Output
Report what was already in place, what changed, what was skipped, and which lookup path(s) are now
available (CLI, MCP, or both). If nothing needed changing, say the environment was already ready.
Boundaries
- Do not run
ctx7 setuporctx7 skills install— this plugin owns the lookup surface; those
install a parallel skill that fragments and clobbers it (detail in the CLI and update references). - Do not run
ctx7 setup --mcpor edit the consumer's.mcp.jsonwithout consent — their MCP
configuration is theirs to curate. - Do not write
CONTEXT7_API_KEYinto the repository, Claude Code settings, or any config file, and
never print its value; the key belongs in the environment or a secret store. - Do not write the plugin cache, Claude Code user settings, or
pluginConfigs. - Do not perform library lookups — that is
/context7:lookup.