docs: switch context7 to official plugin; remove three manual MCP entries
Context: user previously had context7 MCP server registered manually in three places (~/.claude/settings.json + two in ~/.claude.json), with the CONTEXT7_API_KEY in HTTP-header form. Replaced with the official context7@claude-plugins-official plugin. What changed (outside the repo): - ~/.claude/plugins/cache/.../context7/unknown/.mcp.json — added "--api-key" CLI flag to args (Upstash docs recommend this for stdio). - ~/.claude/settings.json — removed top-level mcpServers.context7. - ~/.claude.json — removed top-level mcpServers.context7 and a legacy project-scoped entry under projects[snolla-admin-ui]. Backups saved with suffix .bak-20260428-114532. What changed in the repo (this commit): - .wiki/concepts/context7-setup.md — new page documenting where the key lives, the /plugin update gotcha, and the rollback path. - .wiki/index.md, log.md — linked / logged. - .tasks/STATUS.md — task moved to Done. Plugin takes effect after Claude Code restart; current session still uses the legacy HTTP transport (verified via smoke test on resolve-library-id). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,16 @@ _Updated: 2026-04-28_
|
||||
|
||||
## Done
|
||||
|
||||
### Switch context7 from manual MCP config to official plugin
|
||||
- [x] Backup `~/.claude.json` and `~/.claude/settings.json` (suffix `.bak-20260428-114532`)
|
||||
- [x] User installed `context7@claude-plugins-official`
|
||||
- [x] Located installed plugin: `~/.claude/plugins/cache/claude-plugins-official/context7/unknown/`
|
||||
- [x] Injected `--api-key` flag into the plugin's `.mcp.json` (key sourced from `settings.json`, not echoed in chat)
|
||||
- [x] Smoke-tested `mcp__context7__resolve-library-id` (returned 5 Nuxt entries — works in current session via legacy HTTP config; plugin takes over after Claude Code restart)
|
||||
- [x] Removed three manual context7 entries (settings.json + 2 in `.claude.json`); JSON validity confirmed
|
||||
- [x] Documented setup + plugin-update gotcha in `.wiki/concepts/context7-setup.md`
|
||||
- [x] Wiki index + log + summary updated
|
||||
|
||||
### Migrate this repo's `.wiki/` to canonical Karpathy layout
|
||||
- [x] `git mv` `.wiki/source/*.md` → `.wiki/concepts/` (rename detection preserves history)
|
||||
- [x] Add `type: concept` frontmatter to each migrated page
|
||||
|
||||
73
.wiki/concepts/context7-setup.md
Normal file
73
.wiki/concepts/context7-setup.md
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "context7 setup: official plugin + API key"
|
||||
type: concept
|
||||
updated: 2026-04-28
|
||||
---
|
||||
|
||||
# context7 setup: official plugin + API key
|
||||
|
||||
_2026-04-28._
|
||||
|
||||
## Where the MCP server is now registered
|
||||
|
||||
Single source: the official plugin **`context7@claude-plugins-official`**.
|
||||
|
||||
The plugin's `.mcp.json` (after install) lives at:
|
||||
```
|
||||
~/.claude/plugins/cache/claude-plugins-official/context7/<version>/.mcp.json
|
||||
```
|
||||
|
||||
For this user the version slug is `unknown` (marketplace plugin without a tagged release).
|
||||
|
||||
## API-key injection
|
||||
|
||||
The `@upstash/context7-mcp` npm package, run via stdio, accepts the key as a CLI flag (per Upstash docs at <https://context7.com/docs/resources/all-clients>):
|
||||
|
||||
```json
|
||||
{
|
||||
"context7": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@upstash/context7-mcp", "--api-key", "ctx7sk-..."]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We injected the user's existing key (previously in HTTP-header form) into this `args` array. Header / `env` block forms are also supported, but the CLI flag is what Upstash recommends for stdio.
|
||||
|
||||
## What was removed
|
||||
|
||||
Three manual MCP registrations were deleted:
|
||||
|
||||
| File | Where | Had API key? |
|
||||
|---|---|---|
|
||||
| `~/.claude/settings.json` | top-level `mcpServers.context7` | yes (header) |
|
||||
| `~/.claude.json` | top-level `mcpServers.context7` | yes (header) |
|
||||
| `~/.claude.json` | `projects["…/snolla-admin-ui"].mcpServers.context7` | no (legacy) |
|
||||
|
||||
Backups saved with suffix `.bak-YYYYMMDD-HHMMSS` next to each file.
|
||||
|
||||
## ⚠️ Plugin-update gotcha
|
||||
|
||||
`/plugin update context7@claude-plugins-official` (or a fresh re-install) **will overwrite** the plugin's `.mcp.json` from the marketplace cache, dropping the `--api-key` flag. After any plugin update, re-apply the edit:
|
||||
|
||||
```bash
|
||||
# inspect
|
||||
cat ~/.claude/plugins/cache/claude-plugins-official/context7/<version>/.mcp.json
|
||||
|
||||
# if --api-key is missing, re-inject
|
||||
```
|
||||
|
||||
The marketplace upstream of the plugin lives at `anthropics/claude-plugins-official/external_plugins/context7/.mcp.json` and is two lines — unlikely to change often, but we should expect to re-apply the flag after updates.
|
||||
|
||||
## Restart required to take effect
|
||||
|
||||
Claude Code reads MCP server configs at session start. The session in which this change was made keeps its old (HTTP-transport) connection until a restart. After restart, the plugin's stdio invocation takes over.
|
||||
|
||||
## Why this matters
|
||||
|
||||
Manual MCP entries in `~/.claude.json` / `settings.json` are easy to:
|
||||
- duplicate accidentally (we had three for one server)
|
||||
- forget about when sharing config
|
||||
- drift from the canonical version
|
||||
|
||||
The plugin centralizes the registration and gets versioned through the marketplace. The price is a single edit-after-update for the API key.
|
||||
@@ -14,6 +14,7 @@ Catalog of all wiki pages. One line per page, organized by type. Updated on ever
|
||||
|
||||
- [active-platform-decision.md](concepts/active-platform-decision.md) — why `active-platform` is a skill (not a memory entry); why default = Windows; how it's wired into `project-bootstrap`
|
||||
- [build-notes.md](concepts/build-notes.md) — why `build.ps1` exists alongside `build.sh`; PS 5.1 backslash-in-zip gotcha; how to extract a `.skill`
|
||||
- [context7-setup.md](concepts/context7-setup.md) — switched context7 from manual MCP entries to the official plugin; API key now lives in the plugin's `.mcp.json` as `--api-key`; re-apply after `/plugin update`
|
||||
- [repo-layout.md](concepts/repo-layout.md) — flat `skills/`, committed `dist/`, bash + PowerShell scripts; install model
|
||||
- [wiki-realignment.md](concepts/wiki-realignment.md) — fixing `project-bootstrap` to create the Karpathy-canonical wiki layout
|
||||
|
||||
|
||||
@@ -18,3 +18,4 @@ Parseable: `grep "^## \[" .wiki/log.md | tail -20`.
|
||||
## [2026-04-28] decision | active-platform — skill chosen over global CLAUDE.md / project memory; default Windows; wired into project-bootstrap
|
||||
## [2026-04-28] refactor | wiki-realignment — fixed project-bootstrap Step 3 to create Karpathy-canonical layout
|
||||
## [2026-04-28] refactor | this repo's `.wiki/` migrated to canonical layout (SUMMARY.md→index.md, source/→concepts/, added log.md/overview.md/CLAUDE.md schema, raw/README.md)
|
||||
## [2026-04-28] decision | context7-setup — switched to official plugin; --api-key injected into plugin's .mcp.json; three manual MCP entries removed
|
||||
|
||||
Reference in New Issue
Block a user