How to Claim a Library in Context7: Complete Guide to the Library Claiming Process
The library claiming process in Context7 allows repository owners to verify ownership by adding a context7.json file containing a unique public key to their repository root, enabling access to an admin panel for documentation management and analytics.
The upstash/context7 repository powers a documentation platform that indexes open-source libraries for AI-powered search. Understanding the library claiming process in Context7 is essential for maintainers who want to manage their documentation configuration, view usage analytics, and unlock advanced features without modifying code directly.
What Is the Library Claiming Process in Context7?
The library claiming process is a verification mechanism that establishes cryptographic proof of ownership between a GitHub repository and a Context7 admin account. Unlike simple "claim" buttons that rely on OAuth permissions alone, Context7 requires owners to commit a signed context7.json file to their repository's default branch.
This process serves two critical functions. First, it prevents unauthorized users from asserting control over popular repositories they do not own. Second, it creates a persistent configuration file that Context7 can reference when indexing documentation, ensuring that parsing rules and exclusions remain synchronized with the codebase.
Step-by-Step Guide to Claiming Your Library
Follow these five steps to complete the library claiming process in Context7. Each step references the implementation details found in docs/howto/claiming-libraries.mdx.
Step 1: Navigate to the Admin Page
Access your library's administrative interface by either clicking the Manage button from your Context7 dashboard or navigating directly to:
https://context7.com/{owner}/{repo}/admin
Replace {owner} and {repo} with your GitHub username and repository name respectively.
Step 2: Open the Claim Modal
If the library is currently unclaimed, a Claim Library button appears in the page header. Click this button to initiate the verification workflow. The modal will display instructions and generate the cryptographic credentials required for the next step.
Step 3: Generate Your Public Key
The Claim modal automatically generates a unique public_key (formatted as pk_ followed by alphanumeric characters). This key is embedded within a JSON snippet that looks like this:
{
"url": "https://context7.com/vercel/next.js",
"public_key": "pk_abc123xyz..."
}
Copy this entire snippet. The public_key serves as your cryptographic signature, proving that the entity controlling the Context7 account also controls the repository.
Step 4: Add context7.json to Your Repository
Create a new file named exactly context7.json in your repository's root directory. Paste the JSON snippet generated in Step 3 into this file. Commit the change and push it to your default branch (usually main or master).
The file must be publicly accessible at:
https://raw.githubusercontent.com/{owner}/{repo}/main/context7.json
Context7 will fetch and validate this file during the verification step.
Step 5: Verify Ownership
Return to the Claim modal in your browser and click Claim Library. Context7 performs the following validation sequence:
- Fetches the
context7.jsonfile from your repository's raw GitHub URL - Validates that the URL field matches the expected repository path
- Confirms the
public_keymatches the one generated for your account - Grants admin access upon successful cryptographic verification
Once verified, you gain immediate access to the full admin panel.
Why Claim a Library in Context7? Key Benefits
Claiming your library unlocks seven distinct advantages that streamline documentation management and provide operational insights.
Web-Based Configuration
Modify parsing settings, exclusion patterns, and custom indexing rules directly through the admin UI. Changes apply immediately without requiring new commits to your repository, as documented in docs/howto/claiming-libraries.mdx.
Team Management
Grant administrative privileges to all project maintainers. Once claimed, any team member with repository access can be assigned admin rights, ensuring continuity if the original claimer leaves the project.
Version Management
Add and control multiple documentation versions simultaneously. The admin panel allows you to index specific tags or branches (such as v1.0.0 and v2.0.0), making historical documentation searchable alongside current releases.
Usage Analytics
Access detailed statistics including page views, API request volumes, and MCP (Model Context Protocol) invocation counts. These metrics help you understand how developers interact with your documentation and which sections receive the most attention.
Higher Refresh Limits
Benefit from increased rate limits for documentation re-indexing. Claimed libraries receive priority processing and higher API quotas, ensuring your documentation stays synchronized with code changes even during high-traffic periods.
Verification Eligibility
Only claimed library owners may apply for the "verified" badge. This status indicator signals to Context7 users that the documentation is officially maintained by the repository owners, increasing trust and credibility.
context7.json Configuration Schema
The context7.json file follows a strict JSON Schema defined in packages/mcp/schema/context7.json. This schema validates against https://context7.com/schema/context7.json to ensure configuration integrity.
Minimal Configuration
For basic claiming and verification, only the url and public_key fields are required:
{
"url": "https://context7.com/vercel/next.js",
"public_key": "pk_abc123xyz..."
}
Place this file at your repository root and push to your default branch.
Advanced Configuration
Leverage the full schema to customize indexing behavior and documentation presentation:
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "My Awesome Library",
"description": "Utility functions for data processing",
"folders": ["docs", "src"],
"excludeFolders": ["node_modules", "dist"],
"excludeFiles": ["CHANGELOG.md", "LICENSE"],
"rules": [
"Always use TypeScript for type safety",
"Prefer named exports over default exports"
],
"previousVersions": [
{ "tag": "v1.0.0", "title": "Initial release" },
{ "tag": "v2.0.0", "title": "Major overhaul" }
]
}
This configuration excludes build artifacts from indexing, specifies custom documentation rules for the AI parser, and maintains historical versions for searchability.
Summary
- The library claiming process in Context7 requires adding a
context7.jsonfile containing a uniquepublic_keyto your repository root, establishing cryptographic proof of ownership. - Claiming grants access to an admin panel at
https://context7.com/{owner}/{repo}/adminfor web-based configuration, team management, and version control. - Benefits include usage analytics, higher refresh limits, verification eligibility, and the ability to manage multiple documentation versions without code commits.
- The
context7.jsonschema is validated againsthttps://context7.com/schema/context7.jsonas defined inpackages/mcp/schema/context7.json.
Frequently Asked Questions
How long does the library claiming process take?
The claiming process completes within minutes. After pushing the context7.json file to your default branch, click Claim Library in the admin modal. Context7 fetches the file from GitHub's raw content URL, validates the public key, and grants access immediately upon verification.
Can I claim a library without push access to the repository?
No. The claiming process requires committing a context7.json file to the repository root, which necessitates write permissions. If you are a maintainer without direct push access, coordinate with repository owners to either grant you permissions or have them complete the claiming process and add you as an admin through the team management interface.
What happens if I lose access to my Context7 account?
If you lose access to your Context7 account but still control the repository, you can re-initiate the claiming process with a new account. Generate a new public_key from the Claim modal, update the context7.json file in your repository, and verify ownership again. The new public key will override the previous claim, transferring admin rights to your new account.
Is the context7.json file required after claiming is complete?
Yes. The context7.json file must remain in your repository root. Context7 periodically validates this file to ensure continued ownership and to read configuration updates. Removing the file may result in loss of admin access or suspension of advanced features like analytics and version management.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →