Context7 Platform -- Up-to-date docs for AI agents
example docs
enesakare41d88e874df
diff --git a/docs/adding-projects.mdx b/docs/adding-projects.mdxnew file mode 100644index 00000000..8ab657a6--- /dev/null+++ b/docs/adding-projects.mdx@@ -0,0 +1,10 @@+---+title: "Adding Projects"+description: "How to add or update libraries in Context7."+---++See the detailed guide:++- `docs/adding-projects.md`++diff --git a/docs/development.mdx b/docs/development.mdxnew file mode 100644index 00000000..c514b579--- /dev/null+++ b/docs/development.mdx@@ -0,0 +1,30 @@+---+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.jsonnew file mode 100644index 00000000..116151c9--- /dev/null+++ b/docs/docs.json@@ -0,0 +1,145 @@+{+ "$schema": "https://mintlify.com/docs.json",+ "theme": "maple",+ "name": "Context7 MCP",+ "description": "Up-to-date code docs for any prompt.",+ "colors": {+ "primary": "#3B82F6",+ "light": "#F8FAFC",+ "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"+ ]+ }+ ]+ }+ ]+ },+ "logo": {+ "light": "/context7-logo.svg",+ "dark": "/context7-logo.svg",+ "href": "https://context7.com"+ },+ "navbar": {+ "links": [+ {+ "label": "Discord",+ "href": "https://upstash.com/discord"+ },+ {+ "label": "GitHub",+ "href": "https://github.com/upstash/context7"+ }+ ],+ "primary": {+ "type": "button",+ "label": "Install MCP",+ "href": "https://context7.com"+ }+ },+ "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"+ },+ "links": [+ {+ "header": "Resources",+ "items": [+ {+ "label": "Customers",+ "href": "https://example.com/customers"+ },+ {+ "label": "Enterprise",+ "href": "https://example.com/enterprise"+ },+ {+ "label": "Request Preview",+ "href": "https://example.com/preview"+ }+ ]+ },+ {+ "header": "Company",+ "items": [+ {+ "label": "Careers",+ "href": "https://example.com/careers"+ },+ {+ "label": "Blog",+ "href": "https://example.com/blog"+ },+ {+ "label": "Privacy Policy",+ "href": "https://example.com/legal/privacy"+ }+ ]+ }+ ]+ },+ "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"+ ]+ }\ No newline at end of filediff --git a/docs/index.mdx b/docs/index.mdxnew file mode 100644index 00000000..c20a3fd6--- /dev/null+++ b/docs/index.mdx@@ -0,0 +1,12 @@+---+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 filediff --git a/docs/installation.mdx b/docs/installation.mdxnew file mode 100644index 00000000..17ec8ff1--- /dev/null+++ b/docs/installation.mdx@@ -0,0 +1,40 @@+---+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/quickstart.mdx b/docs/quickstart.mdxnew file mode 100644index 00000000..8bc10f43--- /dev/null+++ b/docs/quickstart.mdx@@ -0,0 +1,28 @@+---+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/tips.mdx b/docs/tips.mdxnew file mode 100644index 00000000..e86117f9--- /dev/null+++ b/docs/tips.mdx@@ -0,0 +1,23 @@+---+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.mdxnew file mode 100644index 00000000..66d8def1--- /dev/null+++ b/docs/tools.mdx@@ -0,0 +1,20 @@+---+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.mdxnew file mode 100644index 00000000..d811c3ba--- /dev/null+++ b/docs/troubleshooting.mdx@@ -0,0 +1,38 @@+---+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"] }+ }+}+```++