An agent skill that makes documentation available through Context7
when it isn't yet: it indexes a repo, docs site, llms.txt, OpenAPI spec or PDF/DOCX file
if Context7 doesn't have it, and allows it in your teamspace policy so your API key and the
Context7 MCP actually serve it.
It is meant for teamspaces that restrict access with policies (a hand-picked allowlist, or quality filters with a wild-card list). Without a policy it still handles the indexing half.
Other Context7 skills look docs up. This one is for the step before that, when the lookup fails
with access_denied / "not included in your allowed libraries", or the library isn't indexed.
- Check each input: is it indexed (ready, processing, not found), is it blocked by the policy, and which allowlist entry (exact library, org or domain) already admits it.
- Index what's missing through the Context7 API: GitHub, GitLab, Bitbucket and other Git
repos (public or private), websites,
llms.txt, OpenAPI URLs, PDF/DOCX/OpenAPI uploads. - Allow the narrowest entry that works (
/owner/repoby default). A dry run shows how many libraries the teamspace can reach before and after. - Wait for indexing and verify the library is served.
- Log every applied change to
registry.jsonl, an audit trail of why each entry exists.
Nothing changes without --apply; the skill tells the agent to confirm anything broader than
what you asked for (org or domain entries, removals, private content).
npx skills add saalse/context7-addor with the Context7 CLI:
npx ctx7 skills install /saalse/context7-add context7-addor copy skills/context7-add/ into ~/.claude/skills/ (Claude Code), ~/.agents/skills/,
or your agent's skills folder. Each release
has the skill folder as a zip, for a fixed version.
- Python 3.8+ (standard library only).
- A Context7 API key:
CONTEXT7_API_KEYin the environment, or thecontext7MCP server configured in~/.claude.jsonwith aCONTEXT7_API_KEYorAuthorization: Bearerheader. The key is read, never printed. - Changing policies or adding private sources needs an owner or admin key; private sources need a paid plan.
Ask your agent, for example:
- "Add https://github.com/saalse/context7-add to Context7 and allow it."
- "Context7 says /saalse/context7-add isn't in my allowed libraries, fix it."
- "Make the docs at https://docs.acme.dev available in context7."
Or run the helper yourself:
C7=skills/context7-add/scripts/c7.py
python3 $C7 whoami
python3 $C7 check https://github.com/saalse/context7-add
python3 $C7 allow /saalse/context7-add # dry run
python3 $C7 allow /saalse/context7-add --apply
python3 $C7 add https://github.com/saalse/context7-add --apply # already indexed: reports its id, creates nothing
python3 $C7 wait /saalse/context7-addResults are JSON on stdout; errors go to stderr with a distinct exit code (bad input,
auth, not found, refused by policy, rate limited, unprocessable, timed out, submission
queue full, file too large). See python3 $C7 --help.
The skill follows the Agent Skills specification.
The tests are offline: they stub the Context7 API, so they need no key or network.
python3 -m unittest discover -s tests -vCI runs them on Python 3.8 to 3.14, validates the skill against the Agent Skills specification, and prints a coverage report.
To release a new version:
-
Set the same version in
.claude-plugin/plugin.jsonand inmetadata.versioninskills/context7-add/SKILL.md, and add a## [X.Y.Z]section to CHANGELOG.md. CI checks that the three agree. -
After the change is merged into
main, tag it and push the tag:git tag vX.Y.Z git push origin vX.Y.Z
The release workflow reruns the tests, checks that the tag matches the version, and publishes a GitHub release with that version's changelog section and the zipped skill folder.
- Submitting a public source adds it to Context7's public index. Use
--privatefor internal repositories. - Notion and Confluence need connected accounts; add those at context7.com/add-library.
- If you use the official Context7 Admin MCP, its
add_library/update_library_policiestools make the same calls; this skill adds the check → narrowest entry → add → verify workflow and needs only your regular API key.
Made by Alex Samson.
MIT, see LICENSE.