Context7 Platform -- Up-to-date docs for AI agents
json md
enesakar93b06e17e35c
diff --git a/README.md b/README.mdindex 76408493..c427301c 100644--- a/README.md+++ b/README.md@@ -2,8 +2,7 @@[](https://context7.com) [](https://smithery.ai/server/@upstash/context7-mcp) [<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Context7%20MCP&color=0098FF">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22context7%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40upstash%2Fcontext7-mcp%40latest%22%5D%7D)-[](./docs/README.zh-CN.md) [](./docs/README.ko.md) [](./docs/README.es.md) [](./docs/README.fr.md) [-purple)](./docs/README.pt-BR.md) [](./docs/README.it.md) [](./docs/README.id-ID.md) [](./docs/README.de.md) [](./docs/README.ru.md) [](./docs/README.tr.md) [](./docs/README.ar.md)-+[](./docs/README.zh-CN.md) [](./docs/README.ko.md) [](./docs/README.es.md) [](./docs/README.fr.md) [-purple>)](./docs/README.pt-BR.md) [](./docs/README.it.md) [](./docs/README.id-ID.md) [](./docs/README.de.md) [](./docs/README.ru.md) [](./docs/README.tr.md) [](./docs/README.ar.md)## ❌ Without Context7@@ -35,7 +34,11 @@ Context7 fetches up-to-date code examples and documentation right into your LLM'No tab-switching, no hallucinated APIs that don't exist, no outdated code generations.-## 🛠️ Getting Started+## 📚 Adding Projects++Check out our [project addition guide](./docs/adding-projects.md) to learn how to add (or update) your favorite libraries to Context7.++## 🛠️ Installation### Requirements@@ -225,19 +228,19 @@ If you prefer to run the MCP server in a Docker container:docker build -t context7-mcp .```-2. **Configure Your MCP Client:**+2. **Configure Your MCP Client:**Update your MCP client's configuration to use the Docker command.- *Example for a cline_mcp_settings.json:*+ _Example for a cline_mcp_settings.json:_```json{"mcpServers": {"Сontext7": {- "autoApprove": [],- "disabled": false,- "timeout": 60,+ "autoApprove": [],+ "disabled": false,+ "timeout": 60,"command": "docker","args": ["run", "-i", "--rm", "context7-mcp"],"transportType": "stdio"@@ -246,21 +249,18 @@ If you prefer to run the MCP server in a Docker container:}```- *Note: This is an example configuration. Please refer to the specific examples for your MCP client (like Cursor, VS Code, etc.) earlier in this README to adapt the structure (e.g., `mcpServers` vs `servers`). Also, ensure the image name in `args` matches the tag used during the `docker build` command.*+ _Note: This is an example configuration. Please refer to the specific examples for your MCP client (like Cursor, VS Code, etc.) earlier in this README to adapt the structure (e.g., `mcpServers` vs `servers`). Also, ensure the image name in `args` matches the tag used during the `docker build` command._### Install in Windows-The configuration on Windows is slightly different compared to Linux or macOS (*`Cline` is used in the example*). The same principle applies to other editors; refer to the configuration of `command` and `args`.++The configuration on Windows is slightly different compared to Linux or macOS (_`Cline` is used in the example_). The same principle applies to other editors; refer to the configuration of `command` and `args`.+```json{"mcpServers": {"github.com/upstash/context7-mcp": {"command": "cmd",- "args": [- "/c",- "npx",- "-y",- "@upstash/context7-mcp@latest"- ],+ "args": ["/c", "npx", "-y", "@upstash/context7-mcp@latest"],"disabled": false,"autoApprove": []}@@ -358,11 +358,7 @@ If you encounter an error like: `Error: Cannot find module 'uriTemplate.js'` try"mcpServers": {"context7": {"command": "npx",- "args": [- "-y",- "--node-options=--experimental-vm-modules",- "@upstash/[email protected]"- ]+ "args": ["-y", "--node-options=--experimental-vm-modules", "@upstash/[email protected]"]}}}@@ -385,6 +381,7 @@ Context7 projects are community-contributed and while we strive to maintain high## Connect with UsStay updated and join our community:+- 📢 Follow us on [X](https://x.com/contextai) for the latest news and updates- 🌐 Visit our [Website](https://context7.com)- 💬 Join our [Discord Community](https://upstash.com/discord) (if applicable)diff --git a/docs/adding-projects.md b/docs/adding-projects.mdnew file mode 100644index 00000000..10f0c43c--- /dev/null+++ b/docs/adding-projects.md@@ -0,0 +1,99 @@+# Adding Projects to Context7++Context7 allows you to add your favorite libraries and frameworks to help developers get up-to-date documentation directly in their coding environment.++## Quick Submission++The easiest way to add a library is through our web interface:++**[Submit a Library →](https://context7.com/add-library?tab=github)**++Simply provide the GitHub repository URL and Context7 will automatically parse and index the project's 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 similar to `robots.txt` and tells Context7 how to handle your project.++### Configuration Fields++Here's an example `context7.json` file with all available options:++```json+{+ "$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",+ "title": "version 1.2.1"+ }+ ]+}+```++> **💡 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): The display name for your project in Context7. This overrides the default repository name.++- **`description`** (string): A brief description of what your library does. This helps coding agents understand the purpose of your project.++- **`folders`** (array): Specific folder paths to include when parsing documentation. If empty, Context7 will scan the entire repository for relevant documentation files. Supports regex patterns and requires full paths.++- **`excludeFolders`** (array): Folder paths to exclude from documentation parsing. Useful for excluding source code directories, build folders, or other non-documentation content. Supports regex patterns and requires full paths.++- **`excludeFiles`** (array): Specific file names to exclude from documentation parsing. Only include the filename (not the path). Useful for excluding files like `CHANGELOG.md`, license files, or other non-documentation content that might not be relevant for coding agents. Regex patterns are not supported.++- **`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+ - **`title`**: Human-readable version name++### Default Exclusions++If you don't specify `excludeFiles` or `excludeFolders` in your `context7.json`, 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 ensure that coding agents receive relevant, current documentation without outdated or non-technical content.++## Who Can Add Configuration?++- **Library authors**: Add `context7.json` directly to your repository+- **Contributors**: Submit pull requests to add or update the configuration+- **Community members**: Propose improvements to how popular libraries are parsed++## Best Practices++1. **Keep descriptions concise**: Aim for one clear sentence that explains your library's purpose to coding agents+2. **Exclude irrelevant folders**: Use `excludeFolders` to avoid indexing source code, tests, or build artifacts+3. **Add helpful rules**: Include common gotchas or best practices that coding agents should know when generating code+4. **Maintain version history**: Keep important previous versions accessible for projects that need older APIs++## Need Help?++If you encounter issues or need assistance adding your project, please [report an issue](https://context7.com/add-library?tab=github) or reach out to our community.diff --git a/schema/context7.json b/schema/context7.jsonnew file mode 100644index 00000000..512f6b87--- /dev/null+++ b/schema/context7.json@@ -0,0 +1,130 @@+{+ "$schema": "http://json-schema.org/draft-07/schema#",+ "$id": "https://context7.com/schema/context7.json",+ "title": "Context7 Configuration Schema",+ "description": "Configuration file for Context7 project parsing and documentation generation",+ "type": "object",+ "properties": {+ "projectTitle": {+ "type": "string",+ "description": "The display name for your project in Context7. This overrides the default repository name.",+ "minLength": 1,+ "maxLength": 100,+ "examples": ["Upstash Ratelimit", "Next.js", "React Query"]+ },+ "description": {+ "type": "string",+ "description": "A brief description of what your library does. This helps coding agents understand the purpose of your project.",+ "minLength": 10,+ "maxLength": 200,+ "examples": [+ "Ratelimiting library based on Upstash Redis",+ "The React Framework for Production",+ "Powerful data synchronization for React"+ ]+ },+ "folders": {+ "type": "array",+ "description": "Specific folder paths to include when parsing documentation. If empty, Context7 will scan the entire repository. Supports regex patterns and requires full paths.",+ "items": {+ "type": "string",+ "minLength": 1+ },+ "uniqueItems": true,+ "default": [],+ "examples": [+ ["docs", "guides"],+ ["documentation/**"],+ ["api-reference", "tutorials/*"]+ ]+ },+ "excludeFolders": {+ "type": "array",+ "description": "Folder paths to exclude from documentation parsing. Supports regex patterns and requires full paths.",+ "items": {+ "type": "string",+ "minLength": 1+ },+ "uniqueItems": true,+ "default": [],+ "examples": [+ ["src", "build", "node_modules"],+ ["**/test/**", "**/tests/**"],+ ["legacy/*", "archive"]+ ]+ },+ "excludeFiles": {+ "type": "array",+ "description": "Specific file names to exclude from documentation parsing. Only include the filename (not the path). Regex patterns are not supported.",+ "items": {+ "type": "string",+ "minLength": 1,+ "pattern": "^[^/\\\\]+$"+ },+ "uniqueItems": true,+ "default": [],+ "examples": [+ ["CHANGELOG.md", "LICENSE"],+ ["README-dev.md", "CONTRIBUTING.md"],+ ["package.json", "tsconfig.json"]+ ]+ },+ "rules": {+ "type": "array",+ "description": "Best practices or important guidelines that coding agents should follow when using your library. These appear as recommendations in the documentation context.",+ "items": {+ "type": "string",+ "minLength": 5,+ "maxLength": 200+ },+ "default": [],+ "examples": [+ ["Always use TypeScript for better type safety"],+ ["Use Upstash Redis as a database", "Use single region set up"],+ ["Import components from the main package", "Follow the naming conventions"]+ ]+ },+ "previousVersions": {+ "type": "array",+ "description": "Information about previous versions of your library that should also be available in Context7.",+ "items": {+ "type": "object",+ "properties": {+ "tag": {+ "type": "string",+ "description": "The Git tag or version identifier",+ "pattern": "^v?\\d+\\.\\d+\\.\\d+",+ "examples": ["v1.2.1", "2.0.0", "v3.1.0-beta.1"]+ },+ "title": {+ "type": "string",+ "description": "Human-readable version name",+ "minLength": 1,+ "maxLength": 50,+ "examples": ["version 1.2.1", "Legacy Version", "Beta Release"]+ }+ },+ "required": ["tag", "title"],+ "additionalProperties": false+ },+ "default": []+ }+ },+ "additionalProperties": false,+ "examples": [+ {+ "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",+ "title": "version 1.2.1"+ }+ ]+ }+ ]+}\ No newline at end of file