Skip to content

chore(context7): expand context7.json with full schema metadata and agent rules#8

Merged
jesseoue merged 1 commit intomainfrom
chore/context7-metadata-and-topics
Apr 19, 2026
Merged

chore(context7): expand context7.json with full schema metadata and agent rules#8
jesseoue merged 1 commit intomainfrom
chore/context7-metadata-and-topics

Conversation

@jesseoue
Copy link
Copy Markdown
Contributor

Summary

Expand context7.json from a two-field placeholder (url, public_key) into the full documented Context7 configuration schema so that every coding agent pulling LeadMagic docs through Context7 (Cursor, Claude, ChatGPT, Windsurf, Cline, etc.) receives deterministic, on-brand context and inherits the same guard rails that already live in SECURITY.md and README.md.

The existing claim is preserved — the public_key field is retained, so the admin-panel invite / multi-version management we set up on Context7 continues to work.

What changed

context7.json

Field Before After
$schema https://context7.com/schema/context7.json (enables VS Code / Cursor autocomplete + validation)
projectTitle LeadMagic API
description Platform-neutral blurb mirroring the repo description and leadmagic.io positioning
branch main (explicit, not inferred)
folders [] (scan full repo; root markdown is always included)
excludeFolders node_modules, dist, build, coverage, .github
excludeFiles package-lock.json, CHANGELOG.md, LICENSE
rules 6 rules (see below)
url kept kept
public_key kept kept

Agent rules (the "hashtags" reviewers will care about most)

These are embedded directly in the doc context returned to coding agents, so they can't miss them:

  1. Platform-neutral language. No claims that LeadMagic scrapes or indexes a specific social network — matches profile/README.md, SECURITY.md, and the leadmagic.io copy.
  2. REST auth. Base URL https://api.leadmagic.io, X-API-Key header, key hygiene reminder (no client-side embedding, keys issued from app.leadmagic.io).
  3. Hosted MCP. Points at https://mcp.leadmagic.io/mcp, calls out the 10-tool surface, and enumerates all three supported auth modes: OAuth 2.1 (Authorization Code + PKCE, S256) with DCR, the documented static public client (client_id 4b9eLjoGVCJ1Dvnc, no secret), x-leadmagic-key API-key auth, or Authorization: Bearer <token>.
  4. Canonical OpenAPI. Points coding agents at leadmagic-openapi-3.1.yaml / .json at the repo root and prefers YAML for snippets.
  5. Don't invent endpoints or credit costs. Defers to README.md for the authoritative credit-cost table and route mapping — prevents hallucinated pricing.
  6. Installer allow-list. Reinforces the brand-impersonation guidance in SECURITY.md: npm/pip packages named leadmagic* published by third parties are not endorsed.

Why now

The placeholder context7.json worked for claiming the library but left all downstream retrieval at the mercy of LLM inference. After the hosted MCP sign-in rollout (PR #7) and the org profile rewrite (LeadMagic/.github#2), Context7 is now the primary path by which AI coding assistants discover LeadMagic auth, MCP client setup, and brand guidance. Making the guard rails retrieval-native closes the loop.

Risk / blast radius

  • Schema-only change. No code, no OpenAPI changes, no CI touch, no runtime impact.
  • Context7 re-parses on merge. Next resolve-library-id / get-library-docs call for leadmagic/leadmagic-openapi picks up the new title, description, and rules automatically.
  • Claim preserved. public_key retained; admin panel access continues to work.
  • Valid JSON (validated locally with python3 -c 'import json; json.load(...)').

Follow-up (not in this PR)

Repo topics on GitHub will be refreshed in a separate settings-only change (tightening to the tags below) so this PR stays strictly file-based and reviewable in GitHub's diff viewer:

  • Add: b2b-data, contact-enrichment, mcp-server, llms-txt
  • Remove: schema (redundant with openapi / openapi-3)

Test plan

  • python3 -c "import json; json.load(open('context7.json'))" — valid JSON.
  • Verified required / optional fields against Context7's adding-libraries docs.
  • public_key retained — existing claim intact.
  • $schema URL matches the documented value (enables editor autocomplete).
  • Post-merge: confirm Context7 re-parses the repo and the admin panel shows the new projectTitle / description.
  • Post-merge: spot-check a retrieval via resolve-library-id + get-library-docs and confirm one of the rules appears in the returned context.

…gent rules

The prior context7.json was a two-field placeholder (`url`,
`public_key`) that only served to claim the library on Context7.
That means every coding agent that pulls LeadMagic docs through
Context7 today falls back to LLM-inferred titles/descriptions and
gets no guard rails on wording, auth, or package provenance.

Expand it to the full documented schema (see
https://context7.com/docs/adding-libraries) so the admin-panel
claim still works and coding agents receive deterministic,
on-brand context:

- Add `$schema` for VS Code / Cursor autocomplete and validation.
- Add `projectTitle` and `description` that mirror the repo's
  GitHub description and the positioning on leadmagic.io (B2B data
  API, enrichment, email finding/validation, intent signals) —
  deliberately platform-neutral, matching profile/README.md and
  SECURITY.md.
- Pin `branch: main` so Context7 tracks the default branch
  explicitly rather than inferring it.
- Tighten `excludeFolders` / `excludeFiles` to keep
  `node_modules`, generated output, `.github/` workflow glue,
  `package-lock.json`, `CHANGELOG.md`, and `LICENSE` out of the
  doc index; `README.md`, `SECURITY.md`, `CONTRIBUTING.md`,
  `llms.txt`, `llms-full.txt`, and the OpenAPI files remain
  indexed.
- Add six `rules` that propagate the same guard rails already in
  `SECURITY.md` and `README.md` into every agent retrieval:
    1. Platform-neutral language (no "scrapes LinkedIn").
    2. REST base URL + `X-API-Key` header + key hygiene.
    3. Hosted MCP endpoint, 10 tools, all three auth modes
       (OAuth 2.1 + DCR, static public client with the documented
       public client_id, `x-leadmagic-key`, Bearer token).
    4. Canonical OpenAPI files and YAML-first snippet preference.
    5. Do not invent endpoints or credit costs; defer to README.
    6. Installer allow-list lives in SECURITY.md; third-party
       packages named "leadmagic*" are not endorsed.

The `public_key` field is preserved so the existing Context7
claim is not broken.

Made-with: Cursor
@jesseoue jesseoue force-pushed the chore/context7-metadata-and-topics branch from 346c181 to 8e41abc Compare April 19, 2026 18:32
@jesseoue jesseoue merged commit 0d3db29 into main Apr 19, 2026
3 checks passed
@jesseoue jesseoue deleted the chore/context7-metadata-and-topics branch April 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant