Context8 is a cloud-first error solution vault for Vibe Coding agents: store fixes with context, search fast, and share solutions with the community. Think of it as a StackOverflow for AI-assisted coding. Local mode is disabled; configure a remote URL if you run your own server.
- βοΈ Cloud-first sync (remote-only)
- π Hybrid search (semantic + keyword matching)
- π οΈ CLI + MCP integration for coding assistants
- π€ Community-ready sharing via public solutions
- π¦ Version tracking for environment and dependencies
- MCP server package (recommended for MCP clients):
context8-mcp - Short CLI wrapper (optional):
context8(delegates tocontext8-mcp)
Choose the method that works best for you:
Perfect for remote mode with cloud sync. Just configure with your API key:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "your-api-key-here"
}
}
}
}Get your API key at https://www.context8.org (requires email verification)
The remote URL (
https://api.context8.org) is set as default - no need to specify it!
Install once, use everywhere (remote-only):
-
Install globally:
npm install -g context8
-
Configure remote access:
context8 remote-config --remote-url https://api.context8.org --api-key <your-api-key>
-
Add to your MCP client:
For most MCP clients (JSON format):
{ "mcpServers": { "context8": { "command": "context8", "timeout": 30000 } } }For OpenAI Codex (TOML format):
[mcp_servers.context8] command = "context8" args = [] startup_timeout_ms = 30000
That's it! This package now runs remote-only.
Check version:
context8 --versionVerify connection and get config paths:
context8 diagnoseThis command will show:
- β Your installation paths (ready to copy-paste into MCP configs)
- β Package version
- β Remote connectivity status
- β Number of solutions stored
The output includes ready-to-use config snippets for both JSON and TOML formats!
- Node.js >= v18.0.0
- Cursor, Claude Code, VSCode, Windsurf or another MCP Client
- npm or compatible package manager (npx, bunx, etc.)
- Local mode is disabled; no local DB dependencies are required.
Important
Stdio MCP only; cloud-first
- β
Install via
npx,bunx, ornpm install -g - β Stdio transport (no HTTP server mode)
- β
Remote config stored in
~/.context8/config.json - β
Cloud/remote mode available via
CONTEXT8_REMOTE_URL+CONTEXT8_REMOTE_API_KEY
Tip
Recommended Post-Setup: Add a Rule to Auto-Use Context8
After installing Context8, add a rule in your MCP client to automatically search Context8 when encountering errors:
Example Rule:
When I encounter an error or bug, automatically search Context8 for similar solutions
before suggesting fixes. Use the search-solutions tool to find relevant past solutions.Note
Remote-only
- Remote: Set
CONTEXT8_REMOTE_API_KEY(URL defaults tohttps://api.context8.org). - Self-hosted: Set
CONTEXT8_REMOTE_URLto your server and provide your API key.
Simplified remote config (any MCP client):
{
"env": {
"CONTEXT8_REMOTE_API_KEY": "<your-api-key>"
}
}Or with custom remote server:
{
"env": {
"CONTEXT8_REMOTE_URL": "https://your-server.com",
"CONTEXT8_REMOTE_API_KEY": "<your-api-key>"
}
}Installing via Smithery
To install Context8 MCP Server for any client automatically via Smithery:
npx -y @smithery/cli@latest install context8 --client <CLIENT_NAME>Install in Cursor
Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server
Paste the following configuration into your Cursor ~/.cursor/mcp.json file. 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.
This one-click config includes:
command:npxargs:["-y","context8-mcp"]env:CONTEXT8_REMOTE_API_KEY=<YOUR_CONTEXT8_API_KEY>description:Context8 MCP official release (remote-first error solution vault)
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}Note: The remote URL defaults to
https://api.context8.org- you only need to setCONTEXT8_REMOTE_API_KEY!API key must be created via https://www.context8.org (email-verified user). Local mode is disabled.
Install in Claude Code
Run this command:
claude mcp add context8 -- context8claude mcp add \
--env CONTEXT8_REMOTE_API_KEY=<your-api-key> \
-- context8 npx -y context8-mcpYou can also use the short env flag:
claude mcp add -e CONTEXT8_REMOTE_API_KEY=<your-api-key> -- context8 npx -y context8-mcpNote: The remote URL defaults to
https://api.context8.org- you only need to setCONTEXT8_REMOTE_API_KEY!API key must be created via https://www.context8.org (email-verified user). Local mode is disabled.
Install in Amp
amp mcp add context8 npx -y context8-mcpInstall in Windsurf
Add this to your Windsurf MCP config file:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}Install in VS Code
The VS Code deeplink carries the same command/args/env/description payload as the Cursor button.
Add this to your VS Code MCP config file:
"mcp": {
"servers": {
"context8": {
"type": "stdio",
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}"mcp": {
"servers": {
"context8": {
"type": "stdio",
"command": "context8",
"args": [],
"startupTimeout": 30000
}
}
}Install in Cline
- Open Cline.
- Click the hamburger menu icon (β°) to enter the MCP Servers section.
- Choose Local Servers tab.
- Click the Edit Configuration button.
- Add context8 to
mcpServers:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}Install in Zed
Add this to your Zed settings.json:
{
"context_servers": {
"Context8": {
"source": "custom",
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"context_servers": {
"Context8": {
"source": "custom",
"command": "context8",
"args": []
}
}
}Install in Augment Code
-
Click the hamburger menu.
-
Select Settings.
-
Navigate to the Tools section.
-
Click the + Add MCP button.
-
Enter the following command:
npx -y context8-mcp -
Add environment variables:
CONTEXT8_REMOTE_API_KEY=YOUR_API_KEY
-
Name the MCP: Context8.
-
Click the Add button.
Add to your settings.json:
"augment.advanced": {
"mcpServers": [
{
"name": "context8",
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
]
}"augment.advanced": {
"mcpServers": [
{
"name": "context8",
"command": "context8",
"args": [],
"timeout": 30000
}
]
}Install in Kilo Code
Create .kilocode/mcp.json in your project:
{
"mcpServers": {
"context8": {
"type": "stdio",
"command": "npx",
"args": ["-y", "context8-mcp"],
"alwaysAllow": [],
"disabled": false
}
}
}After saving, go to Settings β MCP Servers and click Refresh MCP Servers.
Install in Google Antigravity
Add this to your Antigravity MCP config file:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Roo Code
Add this to your Roo Code MCP configuration file:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Gemini CLI
Open ~/.gemini/settings.json and add:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Qwen Coder
Open ~/.qwen/settings.json and add:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Claude Desktop
Open Claude Desktop developer settings and edit your claude_desktop_config.json file:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}Install in Opencode
{
"mcp": {
"context8": {
"type": "local",
"command": ["npx", "-y", "context8-mcp"],
"enabled": true
}
}
}Install in OpenAI Codex
-
Install globally:
npm install -g context8
-
Add via Codex CLI (one-liner):
codex mcp add context8 -- context8
-
Get your config paths:
context8 diagnose
This will show ready-to-copy config snippets for both recommended and alternative setups!
-
Add to your Codex config (copy from diagnose output):
[mcp_servers.context8] command = "context8" args = [] startup_timeout_ms = 30000
This is the cleanest approachβno environment variables needed in the config file.
codex mcp add context8 --env CONTEXT8_REMOTE_API_KEY=YOUR_API_KEY -- npx -y context8-mcpOr add it manually:
[mcp_servers.context8]
args = ["-y", "context8-mcp"]
command = "npx"
startup_timeout_ms = 20_000
[mcp_servers.context8.env]
CONTEXT8_REMOTE_API_KEY = "YOUR_API_KEY"Note: The remote URL defaults to
https://api.context8.org- you only need to setCONTEXT8_REMOTE_API_KEY!
Install in JetBrains AI Assistant
- In JetBrains IDEs, go to
Settings->Tools->AI Assistant->Model Context Protocol (MCP) - Click
+ Add. - Select As JSON option.
- Add this configuration:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}- Click
Applyto save.
Install in Kiro
- Navigate
Kiro>MCP Servers - Click
+ Add. - Paste this configuration:
{
"mcpServers": {
"Context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
},
"disabled": false,
"autoApprove": []
}
}
}{
"mcpServers": {
"Context8": {
"command": "context8",
"args": [],
"disabled": false,
"autoApprove": []
}
}
}- Click
Save.
Install in Trae
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {
"CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"context8": {
"command": "context8",
"timeout": 30000
}
}
}Using Bun or Deno
{
"mcpServers": {
"context8": {
"command": "bunx",
"args": ["-y", "context8-mcp"]
}
}
}{
"mcpServers": {
"context8": {
"command": "deno",
"args": [
"run",
"--allow-env",
"--allow-net",
"--allow-read",
"--allow-write",
"npm:context8"
]
}
}
}Using Docker
Create a Dockerfile:
FROM node:18-alpine
WORKDIR /app
RUN npm install -g context8
CMD ["context8"]Build and configure:
docker build -t context8 .Then use in your MCP config:
{
"mcpServers": {
"context8": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "$HOME/.context8:/root/.context8", "context8"]
}
}
}Note: The -v flag mounts your Context8 config directory so remote settings persist.
Install in Windows
The configuration on Windows uses cmd wrapper:
{
"mcpServers": {
"context8": {
"command": "cmd",
"args": ["/c", "npx", "-y", "context8-mcp"],
"disabled": false,
"autoApprove": []
}
}
}Install in Amazon Q Developer CLI
Add to your Amazon Q Developer CLI configuration:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Warp
- Navigate
Settings>AI>Manage MCP servers. - Click
+ Add. - Paste:
{
"Context8": {
"command": "npx",
"args": ["-y", "context8-mcp"],
"env": {},
"working_directory": null,
"start_on_launch": true
}
}- Click
Save.
Install in Copilot Coding Agent
Repository β Settings β Copilot β Coding agent β MCP configuration:
{
"mcpServers": {
"context8": {
"type": "stdio",
"command": "npx",
"args": ["-y", "context8-mcp"],
"tools": [
"save-error-solution",
"search-solutions",
"get-solution-detail",
"batch-get-solutions",
"delete-solution"
]
}
}
}Install in Copilot CLI
Open ~/.copilot/mcp-config.json and add:
{
"mcpServers": {
"context8": {
"type": "local",
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in LM Studio
Or manually:
- Navigate to
Program>Install>Edit mcp.json. - Paste:
{
"mcpServers": {
"Context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}- Click
Save.
Install in Visual Studio 2022
{
"inputs": [],
"servers": {
"context8": {
"type": "stdio",
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Crush
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"context8": {
"type": "stdio",
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in BoltAI
Open Settings > Plugins and add:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Rovo Dev CLI
acli rovodev mcpThen add:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Zencoder
- Go to Zencoder menu (...)
- Select Agent tools
- Click Add custom MCP
- Add configuration:
{
"command": "npx",
"args": ["-y", "context8-mcp"]
}- Click Install
Install in Qodo Gen
- Open Qodo Gen chat panel
- Click Connect more tools
- Click + Add new MCP
- Add:
{
"mcpServers": {
"context8": {
"command": "npx",
"args": ["-y", "context8-mcp"]
}
}
}Install in Perplexity Desktop
- Navigate
Perplexity>Settings>Connectors - Click
Add Connector>Advanced - Server Name:
Context8 - Paste:
{
"args": ["-y", "context8-mcp"],
"command": "npx",
"env": {}
}- Click
Save.
Install in Factory
droid mcp add context8 "npx -y context8-mcp"Install in Emdash
Emdash supports Context8 MCP. Configure your coding agent to connect to Context8 MCP using the appropriate configuration from the sections above.
Context8 MCP provides the following tools:
-
save-error-solution: Save an error with its solution, root cause, and environment detailstitle(required): Concise, generic technical titleerrorMessage(required): The error message or descriptionerrorType(required): One offeature_request,question_support,api_integration,ui_ux,build_ci,install_setup,docs_request,compatibility,licensing,data_quality,ops_infra,othercontext(required): When/where it happened (generic, no private info)rootCause(required): Why it happened (generic, technical)solution(required): How to fix it (generic steps)tags(required): Tags for categorizationerrorSubtype(optional): Subtype likegithub_actions,vercel,npmcodeChanges(optional): Abstracted code changesconversationLanguage(optional): Language of the conversationprogrammingLanguage(optional): Primary programming languagevibecodingSoftware(optional): Client/tool usedisPublic(optional): Public visibility (remote only)projectPath(optional): Generic project type onlyenvironment(optional): Environment and dependency versions (JSON)
-
search-solutions: Search for similar errors using hybrid semantic + keyword searchquery(required): Search query (error message or description)limit(optional, default 5): Maximum number of results (1-20)minScore(optional, default 0.3): Minimum similarity score (0-1)
-
search-solutions-expanded: Run multiple queries and merge results (HyDE-style)queries(required): List of query variants (error + root cause + fix steps + keywords)limit(optional): Max merged resultsperQueryLimit(optional): Max results per query before mergemode(optional): semantic | sparse | hybrid- Deprecated alias:
search-solutions-multi
-
get-solution-detail: Get full details of a specific solutionid(required): Solution ID
-
batch-get-solutions: Get details for multiple solutions at onceids(required): Comma-separated solution IDs
-
delete-solution: Delete a solution by IDid(required): Solution ID to delete
I just fixed a TypeScript error. Let me save it to Context8:
Error: "Property 'map' does not exist on type 'string'"
Solution: The variable was incorrectly typed as string instead of array. Changed type from string to string[]
Root Cause: TypeScript inference failed because the initial value was an empty string
Environment: TypeScript 5.3.3, Node.js 20.10.0The AI assistant will use save-error-solution to store this in your remote vault.
Search Context8 for solutions about "cannot find module" errorsThe AI will use search-solutions to find relevant past solutions with similar errors.
With the recommended rule set up, simply paste an error:
I'm getting this error:
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:5432
What could be wrong?The AI will automatically search Context8 for similar errors before suggesting solutions.
- Location: your configured remote server (default
https://api.context8.org) - Access: via API with
CONTEXT8_REMOTE_API_KEY - Self-hosted: set
CONTEXT8_REMOTE_URLto your deployment
Store environment details with each solution:
{
"node": "20.10.0",
"typescript": "5.3.3",
"next": "14.1.0",
"react": "18.2.0"
}This helps identify version-specific issues and solutions.
Context8 also provides a CLI for direct remote access to your configured remote vault.
context8 list --limit 20 --offset 0
# or: npx -y context8-mcp list --limit 20 --offset 0Lists remote solutions (requires remote URL; API key may be required by your server).
context8 search "FastAPI CORS blocked" --limit 5 --mode hybrid
# or: npx -y context8-mcp search "FastAPI CORS blocked" --limit 5 --mode hybridcontext8 delete <solution-id>
# or: npx -y context8-mcp delete <solution-id>Check for newer versions and upgrade the global install:
context8 update
# or: context8-mcp updateThis command checks npm for the latest published version and installs it globally.
Set up your AI assistant to automatically search Context8 when you encounter errors:
When I share an error message or encounter a bug, automatically:
1. Search Context8 using search-solutions for similar past errors
2. If found, show me the stored solutions and their context
3. If not found, help me solve it and then save the solution to Context8Use consistent tags to categorize solutions:
typescript,react,nodebuild-error,runtime-error,type-errordatabase,api,frontend
Always include environment versions when saving solutions:
Node: 20.10.0
TypeScript: 5.3.3
Framework: Next.js 14.1.0git clone https://github.com/yourusername/context8
cd context8
npm installnpm run buildnpx . --helpContext8 MCP runs as a stdio MCP server when invoked without arguments. The following CLI commands are available:
context8 --version(or-v) β Display version numbercontext8 diagnoseβ Show installation paths with ready-to-use config snippets (JSON/TOML), remote connectivity status, and solution count (if permitted). Use this to get the exact paths for MCP client configurations!context8 remote-configβ Save or view remote URL/API key for remote modecontext8 listβ List recent solutions (see CLI Usage section above)context8 search-solutions "<query>" [--limit N --mode hybrid|semantic|sparse](alias:search) β Search the remote vaultcontext8 search-solutions-expanded --query "<q1>" --query "<q2>" [--limit N --per-query-limit N --mode ... --rrf-k N]β Multi-query merge search (HyDE/RRF)context8 search-solutions-multi ...β Deprecated alias of expanded searchcontext8 get-solution-detail <solutionId>β Fetch full details for one solutioncontext8 batch-get-solutions <id1> <id2> ...(or--ids a,b,c) β Fetch full details for multiple solutionscontext8 save-error-solution --json '<payload>'(or--file payload.json) β Save a solution using MCP-equivalent schemacontext8 delete-solution <id>(alias:delete) β Delete a solution by ID (remote)context8 setup-clients [--api-key <key> --scope local|user|project --clients codex,claude,goose,amp --dry-run]β Install Context8 MCP into supported clients using their CLI commandscontext8 updateβ Check for package updates
AI-first CLI mapping guide:
- See
/Users/aaronpang/Library/Mobile Documents/com~apple~CloudDocs/Context8/context8-mcp/SKILL.mdfor direct MCP-tool-to-CLI mapping and execution templates.
CONTEXT8_DEFAULT_LIMITβ Default search result limit (optional, defaults to 25)CONTEXT8_REMOTE_URLβ Remote Context8 server URL (optional, defaults tohttps://api.context8.org)CONTEXT8_REMOTE_API_KEYβ API key for remote server (required for write operations)
Simplified remote mode: Just set CONTEXT8_REMOTE_API_KEY - the URL will default to the official server!
You can also persist the remote URL/API key in ~/.context8/config.json using context8 remote-config. Environment variables override the saved config when both are set.
- Get an API key at https://www.context8.org (API key must belong to an email-verified user).
- Save remote target locally:
context8 remote-config --remote-url https://your-context8 --api-key <key>(writes to~/.context8/config.json; flags > env > saved file). - Network guardrails: per-request timeout defaults to 10s; override with
--timeout <ms>(e.g.,--timeout 15000). - Accurate total counts require backend support for
GET /solutions/count; older servers will fall back to an approximate search-based count. - API keys must be created via the
/apikeysroute and belong to an email-verified user; useX-API-Key: <plaintext>in requests (searchquerymust be non-empty or backend returns 422). - Simplified MCP env block (TOML style):
[mcp_servers.context8.env] CONTEXT8_REMOTE_API_KEY = "<your-api-key>" # CONTEXT8_REMOTE_URL defaults to "https://api.context8.org" - no need to set it!
MCP Server Failed to Start / Path Issues
If your MCP client fails to start Context8, use the diagnose command to get the correct paths:
npx -y context8-mcp diagnose
# or (if globally installed): context8 diagnoseThis will show:
- Installation paths - The exact paths to use in your config
- Ready-to-use config snippets - Copy-paste snippets for both JSON and TOML formats
- Recommended vs Alternative configs - Choose the one that works for your setup
Common solutions:
- β
Use
"command": "npx"with"args": ["-y", "context8-mcp"](recommended) - β
Use
"command": "context8"(or"context8-mcp") with"args": [](if globally installed) - β
Use
"command": "node"with the full path from diagnose output (alternative) - β Make sure the path shown in diagnose exists and is accessible
Module Not Found Errors
Try using bunx instead of npx:
{
"mcpServers": {
"context8": {
"command": "bunx",
"args": ["-y", "context8-mcp"]
}
}
}Auth/401 or 422 on search
- Ensure you are using an API key created via
/apikeysfor an email-verified user. - For search,
querymust be non-empty (min length 1) or backend returns 422. - If using a remote URL, check that
CONTEXT8_REMOTE_URLandCONTEXT8_REMOTE_API_KEYare set, and no trailing slash is present.
Deployment security
- Set strong
JWT_SECRET(and related secrets) in your deployment; defaults like"change_me"are insecure and for dev only. - Ensure only verified users/API keys can access
/solutionsand/search.
Search Not Finding Results
- Check if solutions are actually saved:
context8 list(ornpx -y context8-mcp list) - Try different search keywords (shorter query terms often work better)
- Try
--mode sparseto force keyword matching - Verify your API key has access and your
CONTEXT8_REMOTE_URLhas no trailing slash
- Model Context Protocol - Open standard for AI-application integration
MIT License - see LICENSE for details
Contributions are welcome! Please feel free to submit a Pull Request.
If you find Context8 useful, please consider giving it a star on GitHub!
Built with β€οΈ for developers who want to remember their solutions