Library Owners - Context7 MCP (original) (raw)

Context7 allows you to add your favorite libraries and frameworks so developers always receive current, trustworthy documentation inside their coding environment.

Quick Submission

The fastest way to add a library is through our web interface: Submit a Library ->

  1. Paste the GitHub repository URL.
  2. (Optional) Adjust folders and exclusions.
  3. Submit and let Context7 parse and index the documentation.

Advanced Configuration with context7.json

For more control over how Context7 parses and presents your library, you can add a context7.json file to the root of your repository. This file works similarly to robots.txt and tells Context7 how to handle your project.

Configuration Fields

Here’s an example context7.json file with all available options:

{
  "$schema": "https://context7.com/schema/context7.json",
  "projectTitle": "Upstash Ratelimit",
  "description": "Ratelimiting library based on Upstash Redis",
  "folders": [],
  "excludeFolders": ["src"],
  "excludeFiles": [],
  "rules": ["Use Upstash Redis as a database", "Use single region set up"],
  "previousVersions": [
    {
      "tag": "v1.2.1"
    }
  ]
}

Field Descriptions

Exclusion Patterns

The excludeFolders parameter supports various pattern types for flexible exclusion:

Examples:

Default Exclusions

If you don’t specify excludeFiles or excludeFolders in your context7.json file, Context7 uses these default patterns:

Default Excluded Files

CHANGELOG.md, changelog.md, CHANGELOG.mdx, changelog.mdx
LICENSE.md, license.md
CODE_OF_CONDUCT.md, code_of_conduct.md

Default Excluded Folders

*archive*, *archived*, old, docs/old, *deprecated*, *legacy*
*previous*, *outdated*, *superseded*
i18n/zh*, i18n/es*, i18n/fr*, i18n/de*, i18n/ja*, i18n/ko*
i18n/ru*, i18n/pt*, i18n/it*, i18n/ar*, i18n/hi*, i18n/tr*
i18n/nl*, i18n/pl*, i18n/sv*, i18n/vi*, i18n/th*
zh-cn, zh-tw, zh-hk, zh-mo, zh-sg

These defaults help coding agents avoid irrelevant, outdated, and non-technical content.

Claiming Your Library

If you’re the library owner, you can claim your library on Context7 to unlock a web-based admin panel for managing configuration. This allows you to:

Learn more about claiming libraries →

Who Can Manage Configuration?

Best Practices

  1. Keep descriptions concise: One sentence explaining your library’s purpose. Example: “Serverless Redis SDK for edge and browser environments.”
  2. Exclude irrelevant folders: Use excludeFolders to skip source code, tests, or build artifacts. Example: ["src", "test", "dist", "node_modules"]
  3. Add helpful rules: Include common gotchas or best practices. Example: “Always call .close() on Redis connections” or “Use environment variables for API keys, never hardcode them”
  4. Maintain version history: Keep important previous versions accessible. Users on v1.x still need v1.x documentation, not just the latest v2.x

Adding a Version

To add a new version to your existing library:

  1. Add version to the context7.json file: Update the previousVersions array with your new version:
"previousVersions": [  
  {  
    "tag": "v2.0.0",  
    "title": "version 2.0.0"  
  }  
]  
  1. Refresh your library: Go to your library page on Context7 and trigger a refresh to index the new version.
  2. Confirm availability: Search for the new version or run resolve-library-id from an MCP client to confirm it appears in results.

Monitor Parsing and Quality

Keep documentation helpful for agents:

Need Help?

If you encounter issues or need assistance adding your project, please open an issue or reach out to our community.