Quick Submission
The fastest way to add a library is through our web interface: Submit a Library ->- Paste the GitHub repository URL.
- (Optional) Adjust folders and exclusions.
- Submit and let Context7 parse and index the documentation.
context7.com/owner/repo).
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 examplecontext7.json file with all available options:
Pro Tip: Including the
$schema field enables autocomplete, validation, and helpful tooltips
in modern code editors like VS Code, making it easier to create and maintain your configuration.Field Descriptions
-
projectTitle(string): Suggested display name for your project in Context7. Only used when the LLM cannot generate a name with high confidence. -
description(string): Suggested description for your project in Context7. Only used when the LLM cannot generate a description with high confidence. -
branch(string): The name of the git branch to parse. If not provided, the default branch will be used. -
folders(array): Specific folder paths to include when parsing. If empty, Context7 scans the entire repository. Root-level markdown files are always included. -
excludeFolders(array): Patterns to exclude from documentation parsing. Supports simple names, paths, and glob patterns (see Exclusion Patterns below). -
excludeFiles(array): Specific file names to exclude. Use only the filename, not the full path. Examples:CHANGELOG.md, license files, or non-documentation content. -
rules(array): Best practices or important guidelines that coding agents should follow when using your library. These appear as recommendations in the documentation context provided to coding agents. -
previousVersions(array): Information about previous versions of your library that should also be available in Context7.tag: The Git tag or version identifier
-
branchVersions(array): Information about previous versions (branch-based) of your library that should also be available in Context7.branch: The Git branch
Exclusion Patterns
TheexcludeFolders parameter supports various pattern types for flexible exclusion:
- Simple folder names:
"node_modules"- Excludes any folder named “node_modules” anywhere in the tree - Root-specific patterns:
"./xyz"- Excludes the folder only at repository root (e.g., excludes/xyzbut not/dist/xyz) - Path patterns:
"app-sdk/v2.3"- Excludes specific paths and everything under them - Glob patterns:
"*.test","temp*"- Excludes folders matching the pattern - Globstar patterns:
"**/dist","docs/**/internal"- Advanced path matching - Complex patterns:
"src/**/*.test.js"- Exclude test files in the src directory
"node_modules"- Excludes all node_modules folders anywhere"./build"- Excludes the build folder only at root (notsrc/build)"app-sdk/v2.3"- Excludes the app-sdk/v2.3 path and all its contents"*.test"- Excludes folders ending with .test"docs/**/internal"- Excludes any “internal” folder under docs"**/temp"- Excludes any folder named “temp” anywhere
Default Exclusions
If you don’t specifyexcludeFiles or excludeFolders in your context7.json file, Context7 uses these default patterns:
Default Excluded Files
Default Excluded Folders
Who Can Manage Configuration?
- Library authors: Add
context7.jsondirectly to your repository - Contributors: Submit pull requests to add or update the configuration
- Community members: Propose improvements to the way popular libraries are parsed
Best Practices
- Keep descriptions concise: One sentence explaining your library’s purpose. Example: “Serverless Redis SDK for edge and browser environments.”
- Exclude irrelevant folders: Use
excludeFoldersto skip source code, tests, or build artifacts. Example:["src", "test", "dist", "node_modules"] - 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” - 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:-
Add version to the
context7.jsonfile: Update thepreviousVersionsarray with your new version:Thetagvalue must exactly match an existing Git tag in your GitHub repository. - Refresh your library: Go to your library page on Context7 and trigger a refresh to index the new version.
-
Confirm availability: Search for the new version or run
resolve-library-idfrom an MCP client to confirm it appears in results.
Monitor Parsing and Quality
Keep documentation helpful for agents:- Review the rendered documentation after each release
- Trim noisy sections (e.g., large changelogs) with
excludeFilesorexcludeFolders - Update
ruleswhen best practices change, so AI assistants surface current guidance