Skip to content

Context7 Platform -- Up-to-date docs for AI agents

improve docs

enesakar764d6272e3ac
diff --git a/.gitignore b/.gitignore
index 5b2adbe3..e897e143 100644
--- a/.gitignore
+++ b/.gitignore
@@ -174,3 +174,5 @@ dist
# Finder (MacOS) folder config
.DS_Store
package-lock.json
+
+prompt.txt
\ No newline at end of file
diff --git a/README.md b/README.md
index 26cd9da4..8d7fde53 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=context7&config=eyJ1cmwiOiJodHRwczovL21jcC5jb250ZXh0Ny5jb20vbWNwIn0%3D) [<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/Install%20in%20VS%20Code-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white">](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)
-[![繁體中文](https://img.shields.io/badge/docs-繁體中文-yellow)](./docs/README.zh-TW.md) [![简体中文](https://img.shields.io/badge/docs-简体中文-yellow)](./docs/README.zh-CN.md) [![日本語](https://img.shields.io/badge/docs-日本語-b7003a)](./docs/README.ja.md) [![한국어 문서](https://img.shields.io/badge/docs-한국어-green)](./docs/README.ko.md) [![Documentación en Español](https://img.shields.io/badge/docs-Español-orange)](./docs/README.es.md) [![Documentation en Français](https://img.shields.io/badge/docs-Français-blue)](./docs/README.fr.md) [![Documentação em Português (Brasil)](<https://img.shields.io/badge/docs-Português%20(Brasil)-purple>)](./docs/README.pt-BR.md) [![Documentazione in italiano](https://img.shields.io/badge/docs-Italian-red)](./docs/README.it.md) [![Dokumentasi Bahasa Indonesia](https://img.shields.io/badge/docs-Bahasa%20Indonesia-pink)](./docs/README.id-ID.md) [![Dokumentation auf Deutsch](https://img.shields.io/badge/docs-Deutsch-darkgreen)](./docs/README.de.md) [![Документация на русском языке](https://img.shields.io/badge/docs-Русский-darkblue)](./docs/README.ru.md) [![Українська документація](https://img.shields.io/badge/docs-Українська-lightblue)](./docs/README.uk.md) [![Türkçe Doküman](https://img.shields.io/badge/docs-Türkçe-blue)](./docs/README.tr.md) [![Arabic Documentation](https://img.shields.io/badge/docs-Arabic-white)](./docs/README.ar.md) [![Tiếng Việt](https://img.shields.io/badge/docs-Tiếng%20Việt-red)](./docs/README.vi.md)
+[![繁體中文](https://img.shields.io/badge/docs-繁體中文-yellow)](./i18n/README.zh-TW.md) [![简体中文](https://img.shields.io/badge/docs-简体中文-yellow)](./i18n/README.zh-CN.md) [![日本語](https://img.shields.io/badge/docs-日本語-b7003a)](./i18n/README.ja.md) [![한국어 문서](https://img.shields.io/badge/docs-한국어-green)](./i18n/README.ko.md) [![Documentación en Español](https://img.shields.io/badge/docs-Español-orange)](./i18n/README.es.md) [![Documentation en Français](https://img.shields.io/badge/docs-Français-blue)](./i18n/README.fr.md) [![Documentação em Português (Brasil)](<https://img.shields.io/badge/docs-Português%20(Brasil)-purple>)](./i18n/README.pt-BR.md) [![Documentazione in italiano](https://img.shields.io/badge/docs-Italian-red)](./i18n/README.it.md) [![Dokumentasi Bahasa Indonesia](https://img.shields.io/badge/docs-Bahasa%20Indonesia-pink)](./i18n/README.id-ID.md) [![Dokumentation auf Deutsch](https://img.shields.io/badge/docs-Deutsch-darkgreen)](./i18n/README.de.md) [![Документация на русском языке](https://img.shields.io/badge/docs-Русский-darkblue)](./i18n/README.ru.md) [![Українська документація](https://img.shields.io/badge/docs-Українська-lightblue)](./i18n/README.uk.md) [![Türkçe Doküman](https://img.shields.io/badge/docs-Türkçe-blue)](./i18n/README.tr.md) [![Arabic Documentation](https://img.shields.io/badge/docs-Arabic-white)](./i18n/README.ar.md) [![Tiếng Việt](https://img.shields.io/badge/docs-Tiếng%20Việt-red)](./i18n/README.vi.md)
## ❌ Without Context7
@@ -518,13 +518,14 @@ it also can be solved tith the full path to Node.js and the installed package:
```toml
[mcp_servers.context7]
command = "/Users/yourname/.nvm/versions/node/v22.14.0/bin/node" # Node.js full path
-args = ["/Users/yourname/.nvm/versions/node/v22.14.0/lib/node_modules/@upstash/context7-mcp/dist/index.js",
+args = ["/Users/yourname/.nvm/versions/node/v22.14.0/lib/node_modules/@upstash/context7-mcp/dist/index.js",
"--transport",
"stdio",
"--api-key",
"YOUR_API_KEY"
]
```
+
This ensures Codex CLI works reliably on MacOS.
</details>
diff --git a/docs/adding-projects.mdx b/docs/adding-projects.mdx
deleted file mode 100644
index 8ab657a6..00000000
--- a/docs/adding-projects.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: "Adding Projects"
-description: "How to add or update libraries in Context7."
----
-
-See the detailed guide:
-
-- `docs/adding-projects.md`
-
-
diff --git a/docs/api.mdx b/docs/api.mdx
new file mode 100644
index 00000000..7164ca23
--- /dev/null
+++ b/docs/api.mdx
@@ -0,0 +1,320 @@
+---
+title: Public API
+description: Context7 Public API V1 documentation
+---
+
+# Context7 Public API - V1
+
+The Context7 Public API provides programmatic access to library documentation and search functionality.
+
+## Base URL
+
+```
+https://context7.com/api
+```
+
+## Authentication
+
+All API requests require authentication using an API key. Include your API key in the `Authorization` header:
+
+```
+Authorization: Bearer CONTEXT7_API_KEY
+```
+
+Get your API key at [context7.com/dashboard](https://context7.com/dashboard).
+
+## Endpoints
+
+### Get Context
+
+Retrieve documentation and code examples for a specific library.
+
+#### Request
+
+**HTTP Method**: `GET`
+
+**Endpoint**: `/v1/[library]`
+
+**URL Format**:
+- `/v1/{owner}/{repo}` - Get latest version
+- `/v1/{owner}/{repo}/{version}` - Get specific version
+
+**Examples**:
+- `/v1/vercel/next.js`
+- `/v1/vercel/next.js/v15.1.8`
+- `/v1/upstash/docs`
+
+#### Query Parameters
+
+| Parameter | Type | Required | Default | Description |
+|-----------|------|----------|---------|-------------|
+| `type` | string | No | `txt` | Format of the response: `txt` or `json` |
+| `topic` | string | No | - | Topic to search/rerank the results |
+| `tokens` | number | No | `10000` | Maximum token count to be included in the result |
+
+#### Examples
+
+<AccordionGroup>
+ <Accordion title="Basic usage (default txt format)">
+ ```bash
+ curl "https://context7.com/api/v1/vercel/next.js" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+ ```
+ </Accordion>
+
+ <Accordion title="Using JSON format">
+ ```bash
+ curl "https://context7.com/api/v1/vercel/next.js?type=json" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+ ```
+ </Accordion>
+
+ <Accordion title="Specifying a topic">
+ ```bash
+ curl "https://context7.com/api/v1/vercel/next.js?topic=routing" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+ ```
+ </Accordion>
+
+ <Accordion title="Limiting token count">
+ ```bash
+ curl "https://context7.com/api/v1/vercel/next.js?tokens=2000" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+ ```
+ </Accordion>
+
+ <Accordion title="Multiple parameters">
+ ```bash
+ curl "https://context7.com/api/v1/vercel/next.js?topic=authentication&tokens=3000&type=txt" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+ ```
+ </Accordion>
+</AccordionGroup>
+
+#### Response
+
+Returns documentation content in the specified format (`txt` or `json`).
+
+---
+
+### Search Libraries
+
+Search for libraries in the Context7 database.
+
+#### Request
+
+**HTTP Method**: `GET`
+
+**Endpoint**: `/v1/search`
+
+#### Query Parameters
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `query` | string | Yes | Library name to search for |
+
+#### Example
+
+```bash
+curl "https://context7.com/api/v1/search?query=next.js" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY"
+```
+
+#### Response
+
+Returns up to 50 matching libraries.
+
+```json
+{
+ "results": [
+ {
+ "id": "/vercel/next.js",
+ "title": "Next.js",
+ "description": "The React Framework",
+ "branch": "canary",
+ "lastUpdateDate": "2025-07-27T06:56:26.691Z",
+ "state": "finalized",
+ "totalTokens": 607822,
+ "totalSnippets": 3629,
+ "totalPages": 1156,
+ "stars": 131745,
+ "trustScore": 10,
+ "versions": [
+ "v14.3.0-canary.87",
+ "v13.5.11",
+ "v15.1.8",
+ "v15.4.0-canary.82",
+ "v12.3.7",
+ "v11.1.3"
+ ]
+ }
+ ],
+ "metadata": {
+ "authentication": "paid"
+ }
+}
+```
+
+#### Response Fields
+
+| Field | Type | Description |
+|-------|------|-------------|
+| `id` | string | Library ID in format `/owner/repo` |
+| `title` | string | Display name of the library |
+| `description` | string | Short description |
+| `branch` | string | Git branch being tracked |
+| `lastUpdateDate` | string | ISO 8601 timestamp of last update |
+| `state` | string | Processing state: `finalized`, `initial`, `error`, or `delete` |
+| `totalTokens` | number | Total tokens in documentation |
+| `totalSnippets` | number | Number of code snippets |
+| `totalPages` | number | Number of documentation pages |
+| `stars` | number | GitHub stars count |
+| `trustScore` | number | Authority score (0-10) |
+| `versions` | array | Available version tags |
+
+---
+
+### Add a Library
+
+Submit a new library to Context7 for indexing.
+
+#### Request
+
+**HTTP Method**: `POST`
+
+**Endpoint**: `/v1/add`
+
+**Content-Type**: `application/json`
+
+#### Request Body
+
+| Field | Type | Required | Description |
+|-------|------|----------|-------------|
+| `docsRepoUrl` | string | Yes | GitHub repository URL |
+| `projectTitle` | string | No | Display name for the project |
+| `branch` | string | No | Git branch to parse (default: repository's default branch) |
+| `folders` | array | No | Specific folders to include for documentation |
+| `excludeFolders` | array | No | Folders to exclude from parsing |
+| `excludeFiles` | array | No | Files to exclude from parsing |
+
+#### Examples
+
+<AccordionGroup>
+ <Accordion title="Basic example">
+ ```bash
+ curl -X POST "https://context7.com/api/v1/add" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "docsRepoUrl": "https://github.com/okken/pytest-check",
+ "projectTitle": "PyTest Check",
+ "branch": "main"
+ }'
+ ```
+ </Accordion>
+
+ <Accordion title="With specific branch">
+ ```bash
+ curl -X POST "https://context7.com/api/v1/add" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "docsRepoUrl": "https://github.com/pallets/flask",
+ "projectTitle": "Flask",
+ "branch": "2.0.x"
+ }'
+ ```
+ </Accordion>
+
+ <Accordion title="With included folders">
+ ```bash
+ curl -X POST "https://context7.com/api/v1/add" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "docsRepoUrl": "https://github.com/okken/pytest-check",
+ "branch": "main",
+ "folders": ["docs", "examples"]
+ }'
+ ```
+ </Accordion>
+
+ <Accordion title="With excluded folders">
+ ```bash
+ curl -X POST "https://context7.com/api/v1/add" \
+ -H "Authorization: Bearer CONTEXT7_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "docsRepoUrl": "https://github.com/psf/requests",
+ "projectTitle": "Requests",
+ "branch": "main",
+ "excludeFolders": ["tests", "examples"]
+ }'
+ ```
+ </Accordion>
+</AccordionGroup>
+
+#### Response
+
+```json
+{
+ "message": "Parsing process started for https://github.com/okken/pytest-check",
+ "status": "processing",
+ "docsRepoUrl": "https://github.com/okken/pytest-check",
+ "projectName": "/okken/pytest-check",
+ "description": "A pytest plugin that allows multiple failures per test.",
+ "projectTitle": "auto-detected",
+ "folders": ["docs", "examples"],
+ "excludeFolders": ["archive"],
+ "excludeFiles": [
+ "CHANGELOG.md",
+ "changelog.md",
+ "CHANGELOG.mdx",
+ "changelog.mdx",
+ "LICENSE.md",
+ "license.md",
+ "CODE_OF_CONDUCT.md",
+ "code_of_conduct.md"
+ ],
+ "metadata": {
+ "authentication": "paid"
+ }
+}
+```
+
+## Rate Limits
+
+- **Without API key**: Limited requests per IP
+- **With API key**: Higher limits based on your plan
+
+## Error Codes
+
+| Code | Description |
+|------|-------------|
+| 200 | Success |
+| 401 | Unauthorized - Invalid or missing API key |
+| 404 | Not Found - Library or endpoint doesn't exist |
+| 429 | Too Many Requests - Rate limit exceeded |
+| 500 | Internal Server Error |
+
+## Best Practices
+
+1. **Use appropriate token limits**: Request only the amount of documentation you need
+2. **Specify topics**: Use the `topic` parameter to get more relevant results
+3. **Cache responses**: Store documentation locally to reduce API calls
+4. **Handle rate limits**: Implement exponential backoff for rate limit errors
+5. **Use specific versions**: When possible, specify exact versions for consistent results
+
+## SDK and Libraries
+
+For easier integration, consider using:
+
+- **MCP Server**: `@upstash/context7-mcp` - Model Context Protocol integration
+- **Direct API**: Use the REST endpoints documented above
+
+## Support
+
+For API support and questions:
+- Documentation: [docs.context7.com](https://docs.context7.com)
+- GitHub Issues: [github.com/upstash/context7/issues](https://github.com/upstash/context7/issues)
+- Discord: [upstash.com/discord](https://upstash.com/discord)
diff --git a/docs/development.mdx b/docs/development.mdx
deleted file mode 100644
index c514b579..00000000
--- a/docs/development.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: "Development"
-description: "Build and run the Context7 MCP server locally."
----
-
-## Setup
-
-```bash
-bun i
-```
-
-## Build
-
-```bash
-bun run build
-```
-
-## Run
-
-```bash
-bun run dist/index.js
-```
-
-## CLI flags
-
-- `--transport <stdio|http>`
-- `--port <number>`
-- `--api-key <key>`
-
-
diff --git a/docs/docs.json b/docs/docs.json
index 116151c9..d90e13bb 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -9,42 +9,18 @@
"dark": "#0F172A"
},
"navigation": {
- "dropdowns": [
- {
- "dropdown": "Documentation",
- "icon": "book",
- "description": "Context7 MCP usage and setup",
- "groups": [
- {
- "group": "Getting started",
- "pages": [
- "index",
- "quickstart",
- "installation"
- ]
- },
- {
- "group": "Usage",
- "pages": [
- "tools",
- "tips"
- ]
- },
- {
- "group": "Reference",
- "pages": [
- "development",
- "troubleshooting",
- "adding-projects"
- ]
- }
- ]
- }
+ "pages": [
+ "getting-started",
+ "how-to",
+ "library-owners",
+ "api",
+ "mcp",
+ "security"
]
},
"logo": {
- "light": "/context7-logo.svg",
- "dark": "/context7-logo.svg",
+ "light": "/logo/logo.svg",
+ "dark": "/logo/logo.svg",
"href": "https://context7.com"
},
"navbar": {
@@ -67,79 +43,49 @@
"footer": {
"socials": {
"x": "https://x.com/context7ai",
- "linkedin": "https://www.linkedin.com/company/example",
"github": "https://github.com/upstash/context7",
- "slack": "https://upstash.com/discord"
+ "discord": "https://upstash.com/discord"
},
"links": [
{
"header": "Resources",
"items": [
{
- "label": "Customers",
- "href": "https://example.com/customers"
+ "label": "Website",
+ "href": "https://context7.com"
},
{
- "label": "Enterprise",
- "href": "https://example.com/enterprise"
+ "label": "Submit a Library",
+ "href": "https://context7.com/add-library"
},
{
- "label": "Request Preview",
- "href": "https://example.com/preview"
+ "label": "Dashboard",
+ "href": "https://context7.com/dashboard"
}
]
},
{
- "header": "Company",
+ "header": "Community",
"items": [
{
- "label": "Careers",
- "href": "https://example.com/careers"
+ "label": "GitHub",
+ "href": "https://github.com/upstash/context7"
},
{
- "label": "Blog",
- "href": "https://example.com/blog"
+ "label": "Discord",
+ "href": "https://upstash.com/discord"
},
{
- "label": "Privacy Policy",
- "href": "https://example.com/legal/privacy"
+ "label": "Twitter",
+ "href": "https://x.com/context7ai"
}
]
}
]
},
- "integrations": {
- "ga4": {
- "measurementId": "G-XXXXXXXXXX"
- },
- "koala": {
- "publicApiKey": "pk_example_key_123"
- },
- "telemetry": {
- "enabled": true
- },
- "cookies": {
- "key": "example_cookie_key",
- "value": "example_cookie_value"
- }
- },
- "contextual": {
- "options": [
- "copy",
- "view",
- "chatgpt",
- "claude"
- ]
- },
- "errors": {
- "404": {
- "redirect": false,
- "title": "I can't be found",
- "description": "What ever **happened** to this _page_?"
- }
- },
- "exclude": [
- "README.*.md",
- "README.*.mdx"
- ]
+ "feedback": {
+ "thumbsRating": true,
+ "suggestEdit": true,
+ "raiseIssue": true
+ }
}
\ No newline at end of file
diff --git a/docs/getting-started.mdx b/docs/getting-started.mdx
new file mode 100644
index 00000000..1b534c89
--- /dev/null
+++ b/docs/getting-started.mdx
@@ -0,0 +1,251 @@
+---
+title: Getting Started
+description: Up-to-date code docs for any prompt
+---
+
+# Context7 MCP
+
+Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source  and places them directly into your prompt.
+
+## Why Context7?
+
+### Without Context7
+
+LLMs rely on outdated or generic information about the libraries you use. You get:
+
+- Code examples are outdated and based on year-old training data
+- Hallucinated APIs that don't even exist
+- Generic answers for old package versions
+
+### With Context7
+
+Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source  and places them directly into your prompt.
+
+Add `use context7` to your prompt in Cursor:
+
+```txt
+Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to `/login`. use context7
+```
+
+```txt
+Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7
+```
+
+Context7 fetches up-to-date code examples and documentation right into your LLM's context.
+
+1. Write your prompt naturally
+2. Tell the LLM to `use context7`
+3. Get working code answers
+
+No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.
+
+## Installation
+
+### Requirements
+
+- Node.js >= v18.0.0
+- Cursor, Claude Code, VSCode, Windsurf or another MCP Client
+- Context7 API Key (Optional) for higher rate limits and private repositories (Get yours at [context7.com/dashboard](https://context7.com/dashboard))
+
+<AccordionGroup>
+ <Accordion title="Install via Smithery" icon="sparkles">
+ To install Context7 MCP Server for any client automatically via [Smithery](https://smithery.ai/server/@upstash/context7-mcp):
+
+ ```bash
+ npx -y @smithery/cli@latest install @upstash/context7-mcp --client <CLIENT_NAME> --key <YOUR_SMITHERY_KEY>
+ ```
+
+ You can find your Smithery key in the [Smithery.ai webpage](https://smithery.ai/server/@upstash/context7-mcp).
+ </Accordion>
+
+ <Accordion title="Install in Cursor" icon="cursor">
+ Go to: `Settings` � `Cursor Settings` � `MCP` � `Add new global MCP server`
+
+ Pasting the following configuration into your Cursor `~/.cursor/mcp.json` file is the recommended approach. You may also install in a specific project by creating `.cursor/mcp.json` in your project folder.
+
+ Since Cursor 1.0, you can click the install button below for instant one-click installation.
+
+ **Cursor Remote Server Connection**
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "url": "https://mcp.context7.com/mcp",
+ "headers": {
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
+ }
+ }
+ }
+ }
+ ```
+
+ **Cursor Local Server Connection**
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+ }
+ }
+ }
+ ```
+ </Accordion>
+
+ <Accordion title="Install in Claude Code" icon="code">
+ Run this command:
+
+ **Claude Code Remote Server Connection**
+
+ ```sh
+ claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: YOUR_API_KEY"
+ ```
+
+ **Claude Code Local Server Connection**
+
+ ```sh
+ claude mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
+ ```
+ </Accordion>
+
+ <Accordion title="Install in Amp" icon="bolt">
+ Run this command in your terminal:
+
+ **Without API Key (Basic Usage)**
+
+ ```sh
+ amp mcp add context7 https://mcp.context7.com/mcp
+ ```
+
+ **With API Key (Higher Rate Limits & Private Repos)**
+
+ ```sh
+ amp mcp add context7 --header "CONTEXT7_API_KEY=YOUR_API_KEY" https://mcp.context7.com/mcp
+ ```
+ </Accordion>
+
+ <Accordion title="Install in Windsurf" icon="wind">
+ Add this to your Windsurf MCP config file:
+
+ **Windsurf Remote Server Connection**
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "serverUrl": "https://mcp.context7.com/mcp",
+ "headers": {
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
+ }
+ }
+ }
+ }
+ ```
+
+ **Windsurf Local Server Connection**
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+ }
+ }
+ }
+ ```
+ </Accordion>
+
+ <Accordion title="Install in VS Code" icon="code">
+ Add this to your VS Code MCP config file:
+
+ **VS Code Remote Server Connection**
+
+ ```json
+ "mcp": {
+ "servers": {
+ "context7": {
+ "type": "http",
+ "url": "https://mcp.context7.com/mcp",
+ "headers": {
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
+ }
+ }
+ }
+ }
+ ```
+
+ **VS Code Local Server Connection**
+
+ ```json
+ "mcp": {
+ "servers": {
+ "context7": {
+ "type": "stdio",
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+ }
+ }
+ }
+ ```
+ </Accordion>
+
+ <Accordion title="Install in Cline" icon="robot">
+ You can easily install Context7 through the [Cline MCP Server Marketplace](https://cline.bot/mcp-marketplace):
+
+ 1. Open **Cline**
+ 2. Click the hamburger menu icon (0) to enter the **MCP Servers** section
+ 3. Use the search bar within the **Marketplace** tab to find _Context7_
+ 4. Click the **Install** button
+
+ Or you can directly edit MCP servers configuration:
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "url": "https://mcp.context7.com/mcp",
+ "type": "streamableHttp",
+ "headers": {
+ "Authorization": "Bearer YOUR_API_KEY"
+ }
+ }
+ }
+ }
+ ```
+ </Accordion>
+
+ <Accordion title="Install in Zed" icon="zap">
+ It can be installed via [Zed Extensions](https://zed.dev/extensions?query=Context7) or you can add this to your Zed `settings.json`:
+
+ ```json
+ {
+ "context_servers": {
+ "Context7": {
+ "source": "custom",
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+ }
+ }
+ }
+ ```
+ </Accordion>
+
+ <Accordion title="Other Clients" icon="ellipsis">
+ Context7 supports many more clients including:
+ - Augment Code
+ - Roo Code
+ - Gemini CLI
+ - Claude Desktop
+ - Opencode
+ - OpenAI Codex
+ - JetBrains AI Assistant
+ - Kiro
+ - Trae
+ - And many more...
+
+ Check our [GitHub repository](https://github.com/upstash/context7) for detailed installation instructions for each client.
+ </Accordion>
+</AccordionGroup>
diff --git a/docs/how-to.mdx b/docs/how-to.mdx
new file mode 100644
index 00000000..778d4e94
--- /dev/null
+++ b/docs/how-to.mdx
@@ -0,0 +1,177 @@
+---
+title: How To
+description: Learn how to get the most out of Context7
+---
+
+# How To Use Context7
+
+Learn how to maximize Context7's capabilities with these practical guides.
+
+## Adding a Project
+
+You can add your favorite libraries and frameworks to Context7 to help developers get up-to-date documentation.
+
+### Quick Method
+
+The easiest way to add a library is through our web interface:
+
+1. Visit [context7.com/add-library](https://context7.com/add-library?tab=github)
+2. Provide the GitHub repository URL
+3. Context7 will automatically parse and index the project's documentation
+
+### Advanced Configuration
+
+For more control over how Context7 parses your library, add a `context7.json` file to your repository root:
+
+```json
+{
+ "$schema": "https://context7.com/schema/context7.json",
+ "projectTitle": "Your Library Name",
+ "description": "Brief description of your library",
+ "folders": ["docs", "guides"],
+ "excludeFolders": ["src", "tests"],
+ "excludeFiles": ["CHANGELOG.md"],
+ "rules": ["Best practice or guideline here"],
+ "previousVersions": [
+ {
+ "tag": "v1.0.0",
+ "title": "version 1.0.0"
+ }
+ ]
+}
+```
+
+See the [Library Owners](/library-owners) guide for detailed configuration options.
+
+## Add Rule to Use Context7 in Your Agent
+
+If you don't want to add `use context7` to every prompt, you can define a simple rule in your MCP client's rule section to auto-invoke Context7 on any code question.
+
+### Where to Add Rules
+
+<AccordionGroup>
+ <Accordion title="Windsurf" icon="wind">
+ Add your rule to the `.windsurfrules` file in your project root.
+ </Accordion>
+
+ <Accordion title="Cursor" icon="cursor">
+ Go to `Cursor Settings` � `Rules` and add your rule there.
+ </Accordion>
+
+ <Accordion title="Claude Code" icon="code">
+ Add your rule to the `CLAUDE.md` file in your project root.
+ </Accordion>
+</AccordionGroup>
+
+### Example Rule
+
+```txt
+Always use context7 when I need code generation, setup or configuration steps, or
+library/API documentation. This means you should automatically use the Context7 MCP
+tools to resolve library id and get library docs without me having to explicitly ask.
+```
+
+<Note>
+You can customize this rule to match your specific use cases and workflow preferences.
+</Note>
+
+## Using a Special Library ID
+
+If you already know exactly which library you want to use, add its Context7 ID to your prompt. This allows Context7 MCP server to skip the library-matching step and directly retrieve documentation.
+
+### How to Use Library IDs
+
+Include the library ID in your prompt with the `/` prefix:
+
+```txt
+Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.
+```
+
+```txt
+Create a rate limiter using Redis. use library /upstash/ratelimit for implementation.
+```
+
+```txt
+Set up a Next.js API route with middleware. use library /vercel/next.js for documentation.
+```
+
+### Benefits
+
+- **Faster responses**: Skips the library resolution step
+- **Precise documentation**: Ensures you get docs for the exact library you need
+- **Better context**: LLM knows exactly which library's conventions to follow
+
+### Finding Library IDs
+
+1. Search for your library on [context7.com](https://context7.com)
+2. The library ID is shown in the URL and on the library page
+3. Format: `/owner/repository` (e.g., `/mongodb/docs`, `/facebook/react`)
+
+## Using HTTPS Proxy
+
+If you are behind an HTTP proxy, Context7 uses the standard `https_proxy` / `HTTPS_PROXY` environment variables.
+
+### Configuration
+
+Set the environment variable before starting your MCP client:
+
+<AccordionGroup>
+ <Accordion title="Linux/macOS" icon="terminal">
+ ```bash
+ export https_proxy=http://proxy.example.com:8080
+ export HTTPS_PROXY=http://proxy.example.com:8080
+ ```
+
+ For authentication:
+ ```bash
+ export https_proxy=http://username:[email protected]:8080
+ ```
+ </Accordion>
+
+ <Accordion title="Windows (Command Prompt)" icon="windows">
+ ```cmd
+ set https_proxy=http://proxy.example.com:8080
+ set HTTPS_PROXY=http://proxy.example.com:8080
+ ```
+
+ For authentication:
+ ```cmd
+ set https_proxy=http://username:[email protected]:8080
+ ```
+ </Accordion>
+
+ <Accordion title="Windows (PowerShell)" icon="windows">
+ ```powershell
+ $env:https_proxy = "http://proxy.example.com:8080"
+ $env:HTTPS_PROXY = "http://proxy.example.com:8080"
+ ```
+
+ For authentication:
+ ```powershell
+ $env:https_proxy = "http://username:[email protected]:8080"
+ ```
+ </Accordion>
+
+ <Accordion title="MCP Configuration" icon="gear">
+ You can also add proxy settings directly in your MCP configuration:
+
+ ```json
+ {
+ "mcpServers": {
+ "context7": {
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"],
+ "env": {
+ "https_proxy": "http://proxy.example.com:8080",
+ "HTTPS_PROXY": "http://proxy.example.com:8080"
+ }
+ }
+ }
+ }
+ ```
+ </Accordion>
+</AccordionGroup>
+
+<Note>
+Both lowercase `https_proxy` and uppercase `HTTPS_PROXY` are supported. Context7 will check both.
+</Note>
\ No newline at end of file
diff --git a/docs/index.mdx b/docs/index.mdx
deleted file mode 100644
index c20a3fd6..00000000
--- a/docs/index.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: "Introduction"
-description: "Up-to-date, version-specific code docs in your prompts."
----
-
-Context7 MCP pulls fresh docs and examples into your coding assistant so you can:
-
-- Avoid outdated snippets and hallucinated APIs
-- Reference the exact version you use
-- Stay focused on building
-
-Get started with the Quickstart or install Context7 in your editor.
\ No newline at end of file
diff --git a/docs/installation.mdx b/docs/installation.mdx
deleted file mode 100644
index 17ec8ff1..00000000
--- a/docs/installation.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: "Installation"
-description: "Install and connect the Context7 MCP server in your editor."
----
-
-## Requirements
-
-- Node.js >= 18
-- An MCP-capable editor (Cursor, Claude Code, VS Code, Windsurf, etc.)
-- Optional: Context7 API key for higher limits and private repos (`https://context7.com/dashboard`)
-
-## Cursor (remote server)
-
-```json
-{
- "mcpServers": {
- "context7": {
- "url": "https://mcp.context7.com/mcp",
- "headers": { "CONTEXT7_API_KEY": "YOUR_API_KEY" }
- }
- }
-}
-```
-
-## Cursor (local server)
-
-```json
-{
- "mcpServers": {
- "context7": {
- "command": "npx",
- "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
- }
- }
-}
-```
-
-For other clients (Claude Code, Zed, VS Code, etc.), see their examples in README.
-
-
diff --git a/docs/library-owners.mdx b/docs/library-owners.mdx
new file mode 100644
index 00000000..bba8586a
--- /dev/null
+++ b/docs/library-owners.mdx
@@ -0,0 +1,149 @@
+---
+title: Library Owners
+description: Add your library to Context7 and help developers get up-to-date documentation
+---
+
+# 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"
+ }
+ ]
+}
+```
+
+<Note>
+**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.
+</Note>
+
+## Field Descriptions
+
+- **`projectTitle`** (string): Suggested display name for your project in Context7. Only used when LLM can not generate a name with high confidence.
+
+- **`description`** (string): Suggested description for your project in Context7. Only used when LLM can not generate a name 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 documentation. If empty, Context7 will scan the entire repository for relevant documentation files. Note: Root-level markdown files are always included regardless of this setting.
+
+- **`excludeFolders`** (array): Patterns to exclude folders and paths from documentation parsing. Supports simple names, paths, and glob patterns (see Exclusion Patterns section below).
+
+- **`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.
+
+- **`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
+
+### Exclusion Patterns
+
+The `excludeFolders` 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 folder only at repository root (e.g., excludes `/xyz` but 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 src directory
+
+Examples:
+
+- `"node_modules"` - Excludes all node_modules folders anywhere
+- `"./build"` - Excludes build folder only at root (not `src/build`)
+- `"app-sdk/v2.3"` - Excludes 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 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
+
+## 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:
+
+ ```json
+ "previousVersions": [
+ {
+ "tag": "v2.0.0",
+ "title": "version 2.0.0"
+ }
+ ]
+ ```
+
+ <Note>
+ The `tag` value must exactly match an existing Git tag in your GitHub repository.
+ </Note>
+
+2. **Refresh your library**: Go to your library page on Context7 and trigger a refresh to index the new version.
+
+## 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/docs/logo/logo.png b/docs/logo/logo.png
new file mode 100644
index 00000000..43ad8207
Binary files /dev/null and b/docs/logo/logo.png differ
diff --git a/docs/logo/logo.svg b/docs/logo/logo.svg
new file mode 100644
index 00000000..fda298ad
--- /dev/null
+++ b/docs/logo/logo.svg
@@ -0,0 +1,8 @@
+<svg width="130" height="28" viewBox="0 0 130 28" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="28" height="28" rx="4" fill="black" style="fill:black;fill-opacity:1;"/>
+<path d="M10.5724 15.2565C10.5724 17.5025 9.6613 19.3778 8.17805 21.1047H11.6319L11.6319 22.7786H6.33459V21.1895C7.95557 19.3566 8.58065 17.8628 8.58065 15.2565L10.5724 15.2565Z" fill="white" style="fill:white;fill-opacity:1;"/>
+<path d="M17.4276 15.2565C17.4276 17.5025 18.3387 19.3778 19.822 21.1047H16.3681V22.7786H21.6654V21.1895C20.0444 19.3566 19.4194 17.8628 19.4194 15.2565H17.4276Z" fill="white" style="fill:white;fill-opacity:1;"/>
+<path d="M10.5724 12.7435C10.5724 10.4975 9.66131 8.62224 8.17807 6.89532L11.6319 6.89532V5.22137L6.33461 5.22137V6.81056C7.95558 8.64343 8.58066 10.1373 8.58066 12.7435L10.5724 12.7435Z" fill="white" style="fill:white;fill-opacity:1;"/>
+<path d="M17.4276 12.7435C17.4276 10.4975 18.3387 8.62224 19.822 6.89532L16.3681 6.89532L16.3681 5.22138L21.6654 5.22138V6.81056C20.0444 8.64343 19.4194 10.1373 19.4194 12.7435H17.4276Z" fill="white" style="fill:white;fill-opacity:1;"/>
+<path d="M42.1 21.32C38.6 21.32 36.6 18.5 36.6 13.92C36.6 9.32 38.6 6.48 42.1 6.48C44.94 6.48 46.82 8.44 47.28 11.94L44.02 12.08C43.78 10.28 43.08 9.28 42.1 9.28C40.7 9.28 39.9 10.94 39.9 13.92C39.9 16.88 40.7 18.52 42.1 18.52C43.06 18.52 43.82 17.48 44.06 15.56L47.32 15.7C46.86 19.28 44.98 21.32 42.1 21.32ZM53.5922 21.24C50.5122 21.24 48.4322 19.04 48.4322 15.62C48.4322 12.2 50.5122 10 53.5922 10C56.6722 10 58.7522 12.2 58.7522 15.62C58.7522 19.04 56.6722 21.24 53.5922 21.24ZM53.5922 18.58C54.8722 18.58 55.5922 17.56 55.5922 15.62C55.5922 13.68 54.8722 12.66 53.5922 12.66C52.3122 12.66 51.5922 13.68 51.5922 15.62C51.5922 17.56 52.3122 18.58 53.5922 18.58ZM60.5444 21V10.24H63.3244L63.3844 12.16C63.9444 10.68 65.0844 10 66.5844 10C68.8444 10 69.8244 11.62 69.8244 14.02V21H66.7644V14.68C66.7644 13.2 66.3044 12.56 65.3444 12.56C64.4244 12.56 63.6044 13.32 63.6044 14.84V21H60.5444ZM78.2166 21C75.6766 21 74.5566 19.88 74.5566 17.5V12.62H71.6166V10.24H74.5566V7.72H77.6166V10.24H81.4966V12.62H77.6166V17.16C77.6166 18.14 78.0766 18.62 79.0766 18.62H81.4966V21H78.2166ZM88.4088 21.24C85.3888 21.24 83.2488 19.04 83.2488 15.62C83.2488 12.3 85.3488 10 88.3888 10C91.4088 10 93.5288 12.28 93.5288 15.68V16.42H86.3688C86.5088 17.8 87.3088 18.58 88.4888 18.58C89.3488 18.58 90.0088 18.14 90.2688 17.42L93.2888 17.64C92.5088 20 90.8688 21.24 88.4088 21.24ZM86.4288 14.46H90.2488C90.1288 13.28 89.4288 12.66 88.3488 12.66C87.2688 12.66 86.5688 13.3 86.4288 14.46ZM94.5009 21L98.2809 15.5L94.6609 10.24H97.9409L99.9609 13.4L101.961 10.24H105.241L101.681 15.5L105.421 21H102.161L99.9609 17.56L97.7809 21H94.5009ZM112.993 21C110.453 21 109.333 19.88 109.333 17.5V12.62H106.393V10.24H109.333V7.72H112.393V10.24H116.273V12.62H112.393V17.16C112.393 18.14 112.853 18.62 113.853 18.62H116.273V21H112.993ZM120.305 21C120.305 16.72 122.065 13 124.945 9.66H118.185V6.8H128.105V9.52C124.945 13.1 123.685 16.1 123.685 21H120.305Z" fill="black" style="fill:black;fill-opacity:1;"/>
+</svg>
diff --git a/docs/mcp.mdx b/docs/mcp.mdx
new file mode 100644
index 00000000..1ee3308f
--- /dev/null
+++ b/docs/mcp.mdx
@@ -0,0 +1,282 @@
+---
+title: MCP Server
+description: Technical documentation for Context7 MCP Server implementation
+---
+
+# MCP Server
+
+Context7 implements the Model Context Protocol (MCP) to provide up-to-date library documentation directly to AI coding assistants.
+
+## Overview
+
+The Context7 MCP Server is a lightweight service that bridges AI assistants with Context7's documentation database. It provides two main tools that work together to fetch relevant, version-specific documentation.
+
+### Server Information
+
+- **Name**: Context7
+- **Version**: 1.0.13
+- **Protocol**: Model Context Protocol (MCP)
+- **Transport**: Supports both `stdio` and `http`
+
+## Available Tools
+
+### 1. resolve-library-id
+
+Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
+
+#### When to Use
+
+You **MUST** call this function before `get-library-docs` to obtain a valid Context7-compatible library ID, **UNLESS** the user explicitly provides a library ID in the format `/org/project` or `/org/project/version` in their query.
+
+#### Input Schema
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `libraryName` | string | Yes | Library name to search for and retrieve a Context7-compatible library ID |
+
+#### Selection Process
+
+The tool analyzes the query and returns the most relevant match based on:
+
+1. **Name similarity** to the query (exact matches prioritized)
+2. **Description relevance** to the query's intent
+3. **Documentation coverage** (prioritize libraries with higher Code Snippet counts)
+4. **Trust score** (consider libraries with scores of 7-10 more authoritative)
+
+#### Response Format
+
+Each result includes:
+
+- **Library ID**: Context7-compatible identifier (format: `/org/project`)
+- **Name**: Library or package name
+- **Description**: Short summary
+- **Code Snippets**: Number of available code examples
+- **Trust Score**: Authority indicator (0-10)
+- **Versions**: List of available versions (format: `/org/project/version`)
+
+#### Example Usage
+
+```json
+{
+ "libraryName": "next.js"
+}
+```
+
+**Response:**
+
+```
+Available Libraries (top matches):
+
+Library ID: /vercel/next.js
+Name: Next.js
+Description: The React Framework for Production
+Code Snippets: 1,234
+Trust Score: 10
+Versions: ["/vercel/next.js/v14.0.0", "/vercel/next.js/v13.5.0"]
+```
+
+### 2. get-library-docs
+
+Fetches up-to-date documentation for a library using a Context7-compatible library ID.
+
+#### When to Use
+
+Call this function after obtaining a library ID from `resolve-library-id`, or when the user provides a library ID directly in the format `/org/project` or `/org/project/version`.
+
+#### Input Schema
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `context7CompatibleLibraryID` | string | Yes | Exact Context7-compatible library ID (e.g., `/mongodb/docs`, `/vercel/next.js`, `/supabase/supabase`) |
+| `topic` | string | No | Topic to focus documentation on (e.g., `hooks`, `routing`) |
+| `tokens` | number | No | Maximum number of tokens of documentation to retrieve (default: 5000, minimum: 1000) |
+
+#### Response
+
+Returns documentation in plain text format, optimized for AI consumption. The documentation includes:
+
+- API references
+- Code examples
+- Configuration guides
+- Best practices
+- Version-specific information
+
+#### Example Usage
+
+```json
+{
+ "context7CompatibleLibraryID": "/vercel/next.js",
+ "topic": "middleware",
+ "tokens": 5000
+}
+```
+
+## Transport Types
+
+Context7 MCP Server supports two transport protocols:
+
+### stdio (Default)
+
+Standard input/output transport for local MCP clients.
+
+**Use case**: Local installations with Cursor, VS Code, Claude Code, etc.
+
+**Configuration example:**
+
+```json
+{
+ "mcpServers": {
+ "context7": {
+ "command": "npx",
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
+ }
+ }
+}
+```
+
+### http
+
+HTTP/HTTPS transport for remote server connections.
+
+**Use case**: Remote deployments, cloud installations, multiple client connections.
+
+**Configuration example:**
+
+```json
+{
+ "mcpServers": {
+ "context7": {
+ "url": "https://mcp.context7.com/mcp",
+ "headers": {
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
+ }
+ }
+ }
+}
+```
+
+**Endpoints:**
+
+- `/mcp` - Main MCP endpoint (StreamableHTTP)
+- `/sse` - Server-Sent Events endpoint (GET)
+- `/messages` - SSE message endpoint (POST)
+- `/ping` - Health check endpoint
+
+<Warning>
+The Server-Sent Events (SSE) transport protocol is deprecated and its endpoint will be removed in upcoming releases. Please use HTTP or stdio transport methods instead.
+</Warning>
+
+## CLI Arguments
+
+The Context7 MCP server accepts the following command-line arguments:
+
+| Argument | Values | Default | Description |
+|----------|--------|---------|-------------|
+| `--transport` | `stdio` \| `http` | `stdio` | Transport protocol to use |
+| `--port` | number | `3000` | Port for HTTP transport (only with `--transport http`) |
+| `--api-key` | string | - | API key for authentication (only with `--transport stdio`) |
+
+### Examples
+
+**HTTP transport on port 8080:**
+
+```bash
+npx @upstash/context7-mcp --transport http --port 8080
+```
+
+**stdio transport with API key:**
+
+```bash
+npx @upstash/context7-mcp --transport stdio --api-key YOUR_API_KEY
+```
+
+<Note>
+- The `--api-key` flag is not allowed when using `--transport http`. Use header-based authentication instead.
+- The `--port` flag is not allowed when using `--transport stdio`.
+</Note>
+
+## Authentication
+
+### API Keys
+
+Context7 supports optional API key authentication for:
+
+- Higher rate limits
+- Access to private repositories
+- Usage tracking
+
+Get your API key at [context7.com/dashboard](https://context7.com/dashboard).
+
+### Header Support
+
+For HTTP transport, the server checks the following headers in order:
+
+1. `Authorization: Bearer <token>`
+2. `Context7-API-Key: <key>`
+3. `X-API-Key: <key>`
+4. `context7-api-key: <key>`
+5. `x-api-key: <key>`
+
+## Error Handling
+
+The server returns descriptive error messages for common scenarios:
+
+| Error Code | Description |
+|------------|-------------|
+| 401 | Unauthorized - Invalid or missing API key |
+| 404 | Library not found - Invalid library ID |
+| 429 | Rate limited - Too many requests |
+| 500 | Internal server error |
+
+## Rate Limits
+
+- **Without API key**: Limited requests per IP
+- **With API key**: Higher limits based on your plan
+
+## Proxy Support
+
+Context7 automatically detects and uses HTTP/HTTPS proxy settings from environment variables:
+
+- `HTTPS_PROXY` / `https_proxy`
+- `HTTP_PROXY` / `http_proxy`
+
+See [How To - Using HTTPS Proxy](/how-to#using-https-proxy) for configuration details.
+
+## Development
+
+### Running Locally
+
+```bash
+# Install dependencies
+bun i
+
+# Build
+bun run build
+
+# Run with stdio transport
+bun run dist/index.js --transport stdio --api-key YOUR_API_KEY
+
+# Run with HTTP transport
+bun run dist/index.js --transport http --port 3000
+```
+
+### Testing with MCP Inspector
+
+```bash
+npx -y @modelcontextprotocol/inspector npx @upstash/context7-mcp
+```
+
+## Best Practices
+
+1. **Always resolve library IDs first**: Call `resolve-library-id` before `get-library-docs` unless you have an explicit library ID
+2. **Use appropriate token limits**: Higher token counts provide more context but consume more resources
+3. **Specify topics**: Use the `topic` parameter to focus documentation on specific areas
+4. **Handle errors gracefully**: Check for error responses and provide fallback behavior
+5. **Cache results**: Consider caching documentation responses to reduce API calls
+
+## Source Code
+
+The Context7 MCP server is open source:
+
+- GitHub: [github.com/upstash/context7](https://github.com/upstash/context7)
+- NPM: [@upstash/context7-mcp](https://www.npmjs.com/package/@upstash/context7-mcp)
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx
deleted file mode 100644
index 8bc10f43..00000000
--- a/docs/quickstart.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: "Quickstart"
-description: "Use Context7 MCP to fetch up-to-date code docs in your prompts."
----
-
-## Use in a prompt
-
-Add "use context7" to any coding prompt so your assistant fetches fresh docs and examples:
-
-```txt
-Create a Next.js middleware that checks for a valid JWT in cookies and redirects unauthenticated users to /login. use context7
-```
-
-```txt
-Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7
-```
-
-## How it works
-
-- Resolves library IDs and pulls versioned code docs/examples into context.
-- Reduces hallucinations and outdated snippets.
-
-## Next steps
-
-- See Installation to connect Context7 MCP in your editor.
-- Browse Tools and Tips for advanced usage.
-
-
diff --git a/docs/security.mdx b/docs/security.mdx
new file mode 100644
index 00000000..57244d7a
--- /dev/null
+++ b/docs/security.mdx
@@ -0,0 +1,215 @@
+---
+title: Security
+description: Security and privacy practices for Context7
+---
+
+# Security and Privacy
+
+Context7 takes security and privacy seriously. This page outlines our security practices, data handling, and compliance measures.
+
+## Privacy-First Architecture
+
+### Query Privacy
+
+**Your queries never leave your machine.**
+
+When you use Context7 through the MCP client:
+
+1. Your query is analyzed locally to extract topics and relevant keywords
+2. Only these generated topics are sent to the Context7 server
+3. Your original query and code remain on your local machine
+4. The server has no access to your actual prompts or conversations
+
+<Note>
+The MCP client processes your queries locally and only transmits topic information needed to retrieve relevant documentation. Your full prompts, code, and context remain private.
+</Note>
+
+### Data Storage
+
+**Context7 does not store your source files.**
+
+- We only index and store **documentation** and **code examples** from public repositories
+- Your private code, projects, and source files are never uploaded or stored
+- All indexed content is stored in a secure vector database optimized for retrieval
+
+**What we store:**
+- Public library documentation
+- Public code examples from documentation
+- Metadata about indexed libraries
+
+**What we don't store:**
+- Your source code
+- Your queries or prompts
+- Your private repositories (unless explicitly authorized)
+- Your conversations with AI assistants
+
+## Infrastructure Security
+
+### SOC 2 Compliance
+
+Context7 runs on **SOC 2 compliant infrastructure** provided by Upstash.
+
+- Type II SOC 2 certified infrastructure
+- Regular security audits and assessments
+- Continuous monitoring and compliance checks
+- Industry-standard security controls
+
+### Managed by Upstash
+
+Context7's infrastructure is managed by the experienced Upstash team:
+
+- 24/7 infrastructure monitoring
+- Automated security patching
+- DDoS protection and mitigation
+- Redundant backups and disaster recovery
+- Enterprise-grade reliability and uptime
+
+### Upstash Security Practices
+
+All security practices and certificates of Upstash apply to Context7 projects:
+
+- **Data Encryption**: Encryption at rest and in transit (TLS 1.2+)
+- **Network Security**: VPC isolation, firewall rules, and network segmentation
+- **Access Control**: Role-based access control (RBAC) and least privilege principles
+- **Audit Logging**: Comprehensive logging of all system activities
+- **Incident Response**: Documented incident response procedures
+- **Vulnerability Management**: Regular security scanning and penetration testing
+
+Learn more about Upstash security: [upstash.com/trust](https://upstash.com/trust)
+
+## Authentication and Access Control
+
+### API Key Security
+
+- API keys use cryptographic random generation
+- Keys are hashed and encrypted in our database
+- Keys can be rotated at any time from your dashboard
+- Rate limiting prevents abuse and unauthorized access
+
+### Enterprise SSO
+
+**Single Sign-On (SSO) is available for Enterprise plans.**
+
+Supported SSO providers:
+- SAML 2.0
+- OAuth 2.0
+- OpenID Connect (OIDC)
+
+Enterprise features include:
+- Centralized user management
+- Team access controls
+- Audit logs for compliance
+- Custom authentication policies
+
+Contact our sales team at [context7.com](https://context7.com) for Enterprise plan details.
+
+## Data Protection
+
+### Privacy by Design
+
+- **Data Minimization**: We only collect and store what's necessary
+- **Purpose Limitation**: Data is used only for documentation retrieval
+- **Storage Limitation**: Automated cleanup of outdated data
+- **Transparency**: Clear documentation of what we collect and why
+
+### GDPR Compliance
+
+For European users, Context7 provides:
+- Right to access your data
+- Right to delete your data
+- Data portability options
+- Clear consent mechanisms
+- Privacy-first data processing
+
+## Rate Limiting and Abuse Prevention
+
+- IP-based rate limiting for anonymous requests
+- API key-based rate limiting with tiered limits
+- Automatic detection and blocking of abusive patterns
+- Protection against DDoS and scraping attacks
+
+## Secure Development Practices
+
+- Regular security code reviews
+- Automated dependency scanning
+- Secure CI/CD pipelines
+- Principle of least privilege for all systems
+- Security testing in development lifecycle
+
+## Reporting Security Issues
+
+If you discover a security vulnerability, please report it responsibly:
+
+1. **Do not** publicly disclose the issue
+2. Email security details to: [GitHub Security](https://github.com/upstash/context7/security)
+3. Include detailed steps to reproduce the issue
+4. Allow reasonable time for us to address the issue
+
+We take all security reports seriously and will respond promptly.
+
+## Transparency and Compliance
+
+### Open Source
+
+The Context7 MCP server is open source:
+- Code is publicly available on GitHub
+- Community can audit and contribute
+- Transparent implementation and practices
+
+Repository: [github.com/upstash/context7](https://github.com/upstash/context7)
+
+### Compliance Certifications
+
+Context7 benefits from Upstash's compliance certifications:
+- SOC 2 Type II
+- GDPR compliant
+- ISO 27001 (in progress)
+- CCPA compliant
+
+## Best Practices for Users
+
+### Secure Your API Keys
+
+- Never commit API keys to version control
+- Use environment variables for key storage
+- Rotate keys regularly
+- Use different keys for different environments
+- Revoke unused or compromised keys immediately
+
+### Private Repositories
+
+For private repository access:
+- Only grant minimum required permissions
+- Use dedicated API keys for private repos
+- Regularly audit access permissions
+- Consider using GitHub Apps with fine-grained permissions
+
+### Network Security
+
+- Use HTTPS for all API communications (enforced)
+- Configure proxy settings securely if behind a firewall
+- Monitor API usage for unusual patterns
+- Implement request timeouts and retries
+
+## Data Retention
+
+- **Library Documentation**: Retained while library is active and public
+- **API Logs**: Retained for 30 days for debugging and analytics
+- **User Data**: Retained according to your account status
+- **Deleted Data**: Permanently removed within 30 days of deletion request
+
+## Questions and Support
+
+For security-related questions:
+- Review our documentation at [docs.context7.com](https://docs.context7.com)
+- Contact us through [GitHub Issues](https://github.com/upstash/context7/issues)
+- Join our [Discord Community](https://upstash.com/discord)
+- Enterprise customers: Contact your dedicated support team
+
+For privacy policy details, visit: [context7.com/privacy](https://context7.com/privacy)
+
+---
+
+**Last Updated**: January 2025
+
+We continuously improve our security practices. Check this page regularly for updates.
diff --git a/docs/tips.mdx b/docs/tips.mdx
deleted file mode 100644
index e86117f9..00000000
--- a/docs/tips.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: "Tips"
-description: "Get the most out of Context7 MCP."
----
-
-## Add a rule
-
-```txt
-Always use context7 when I need code generation, setup or configuration steps, or
-library/API documentation.
-```
-
-## Use library ID directly
-
-```txt
-Implement basic authentication with Supabase. use library /supabase/supabase
-```
-
-## HTTPS proxy
-
-Respects `https_proxy` / `HTTPS_PROXY` environment variables.
-
-
diff --git a/docs/tools.mdx b/docs/tools.mdx
deleted file mode 100644
index 66d8def1..00000000
--- a/docs/tools.mdx
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: "Tools"
-description: "Context7 MCP tools available to your coding assistant."
----
-
-## resolve-library-id
-
-Resolves a general library name to a Context7 ID.
-
-- input: `libraryName`
-- output: Context7-compatible ID (e.g., `/vercel/next.js`)
-
-## get-library-docs
-
-Fetches docs/snippets for a library.
-
-- input: `context7CompatibleLibraryID` (required), `topic` (optional), `tokens` (optional)
-- behavior: returns up-to-date code examples and docs
-
-
diff --git a/docs/troubleshooting.mdx b/docs/troubleshooting.mdx
deleted file mode 100644
index d811c3ba..00000000
--- a/docs/troubleshooting.mdx
+++ /dev/null
@@ -1,38 +0,0 @@
----
-title: "Troubleshooting"
-description: "Common fixes for MCP setup issues."
----
-
-## Module not found
-
-Use bunx instead of npx:
-
-```json
-{
- "mcpServers": {
- "context7": { "command": "bunx", "args": ["-y", "@upstash/context7-mcp"] }
- }
-}
-```
-
-## ESM resolution issues
-
-```json
-{
- "mcpServers": {
- "context7": { "command": "npx", "args": ["-y", "--node-options=--experimental-vm-modules", "@upstash/[email protected]"] }
- }
-}
-```
-
-## TLS/cert issues
-
-```json
-{
- "mcpServers": {
- "context7": { "command": "npx", "args": ["-y", "--node-options=--experimental-fetch", "@upstash/context7-mcp"] }
- }
-}
-```
-
-
diff --git a/docs/README.ar.md b/i18n/README.ar.md
similarity index 100%
rename from docs/README.ar.md
rename to i18n/README.ar.md
diff --git a/docs/README.de.md b/i18n/README.de.md
similarity index 100%
rename from docs/README.de.md
rename to i18n/README.de.md
diff --git a/docs/README.es.md b/i18n/README.es.md
similarity index 100%
rename from docs/README.es.md
rename to i18n/README.es.md
diff --git a/docs/README.fr.md b/i18n/README.fr.md
similarity index 100%
rename from docs/README.fr.md
rename to i18n/README.fr.md
diff --git a/docs/README.id-ID.md b/i18n/README.id-ID.md
similarity index 100%
rename from docs/README.id-ID.md
rename to i18n/README.id-ID.md
diff --git a/docs/README.it.md b/i18n/README.it.md
similarity index 100%
rename from docs/README.it.md
rename to i18n/README.it.md
diff --git a/docs/README.ja.md b/i18n/README.ja.md
similarity index 100%
rename from docs/README.ja.md
rename to i18n/README.ja.md
diff --git a/docs/README.ko.md b/i18n/README.ko.md
similarity index 100%
rename from docs/README.ko.md
rename to i18n/README.ko.md
diff --git a/docs/README.pt-BR.md b/i18n/README.pt-BR.md
similarity index 100%
rename from docs/README.pt-BR.md
rename to i18n/README.pt-BR.md
diff --git a/docs/README.ru.md b/i18n/README.ru.md
similarity index 100%
rename from docs/README.ru.md
rename to i18n/README.ru.md
diff --git a/docs/README.tr.md b/i18n/README.tr.md
similarity index 100%
rename from docs/README.tr.md
rename to i18n/README.tr.md
diff --git a/docs/README.uk.md b/i18n/README.uk.md
similarity index 100%
rename from docs/README.uk.md
rename to i18n/README.uk.md
diff --git a/docs/README.vi.md b/i18n/README.vi.md
similarity index 100%
rename from docs/README.vi.md
rename to i18n/README.vi.md
diff --git a/docs/README.zh-CN.md b/i18n/README.zh-CN.md
similarity index 100%
rename from docs/README.zh-CN.md
rename to i18n/README.zh-CN.md
diff --git a/docs/README.zh-TW.md b/i18n/README.zh-TW.md
similarity index 100%
rename from docs/README.zh-TW.md
rename to i18n/README.zh-TW.md