"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 the user wants Context7 set up, verified, or repaired on this machine, covering CLI installation, API-key auth, and MCP server wiring: 'set up context7', 'is context7 working', 'install ctx7'. Actions: check (read-only verification, default) | apply (resolve what check found) | apply install-cli (also install/upgrade the ctx7 CLI)."
Recursos
1Instal·la
npx skillscat add melodic-software/claude-code-plugins/plugins-context7-skills-setup Instal·la des del registre de SkillsCat.
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 setup contract (docs/plugin-philosophy.md
"Setup is explicit and repeatable" in the marketplace repository): check inspects and reports,apply resolves what check found, and the CLI install is a distinct opt-in subaction.
Idempotent and transparent: safe to rerun.
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, so it is 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-cliinstalls or upgrades 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,
more content per call with the measured ratio in${CLAUDE_PLUGIN_ROOT}/skills/lookup/context/mcp.md, no Windows ceremony), route them to add acontext7server entry
to their own MCP configuration. The exact JSON, covering 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).
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. This skill brings the
local environment to a working state for lookups; machine-wide Claude Code state belongs to the user
and the harness, and the installed plugin cache is overwritten on the next plugin update. - Do not perform library lookups. That is
/context7:lookup.