Skip to content

context8/context8-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Install MCP Server Install in VS Code (npx)

Context8 MCP - Official Release

NPM Version (MCP) NPM Version (CLI) MIT licensed

🎯 What is Context8?

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.

Key Features

  • ☁️ 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

πŸ› οΈ Installation (remote-only)

Package Names

  • MCP server package (recommended for MCP clients): context8-mcp
  • Short CLI wrapper (optional): context8 (delegates to context8-mcp)

⚑ Quick Start

Choose the method that works best for you:

Option 1: Using npx (Simplest - Remote)

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!

Option 2: Global Installation (Remote-only)

Install once, use everywhere (remote-only):

  1. Install globally:

    npm install -g context8
  2. Configure remote access:

    context8 remote-config --remote-url https://api.context8.org --api-key <your-api-key>
  3. 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 --version

Verify connection and get config paths:

context8 diagnose

This 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!


Requirements

  • 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, or npm 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 to https://api.context8.org).
  • Self-hosted: Set CONTEXT8_REMOTE_URL to 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.

Install MCP Server

This one-click config includes:

  • command: npx
  • args: ["-y","context8-mcp"]
  • env: CONTEXT8_REMOTE_API_KEY=<YOUR_CONTEXT8_API_KEY>
  • description: Context8 MCP official release (remote-first error solution vault)

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}

Note: The remote URL defaults to https://api.context8.org - you only need to set CONTEXT8_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:

Option 2: global install (remote-only)

claude mcp add context8 -- context8

Option 1: npx (remote mode)

claude mcp add \
  --env CONTEXT8_REMOTE_API_KEY=<your-api-key> \
  -- context8 npx -y context8-mcp

You can also use the short env flag:

claude mcp add -e CONTEXT8_REMOTE_API_KEY=<your-api-key> -- context8 npx -y context8-mcp

Note: The remote URL defaults to https://api.context8.org - you only need to set CONTEXT8_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-mcp
Install in Windsurf

Add this to your Windsurf MCP config file:

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}
Install in VS Code

Install in VS Code (npx)

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:

Option 1: npx (remote mode)

"mcp": {
  "servers": {
    "context8": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

"mcp": {
  "servers": {
    "context8": {
      "type": "stdio",
      "command": "context8",
      "args": [],
      "startupTimeout": 30000
    }
  }
}
Install in Cline
  1. Open Cline.
  2. Click the hamburger menu icon (☰) to enter the MCP Servers section.
  3. Choose Local Servers tab.
  4. Click the Edit Configuration button.
  5. Add context8 to mcpServers:

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}
Install in Zed

Add this to your Zed settings.json:

Option 1: npx (remote mode)

{
  "context_servers": {
    "Context8": {
      "source": "custom",
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "context_servers": {
    "Context8": {
      "source": "custom",
      "command": "context8",
      "args": []
    }
  }
}
Install in Augment Code

Using the Augment Code UI

  1. Click the hamburger menu.

  2. Select Settings.

  3. Navigate to the Tools section.

  4. Click the + Add MCP button.

  5. Enter the following command:

    npx -y context8-mcp
    
  6. Add environment variables:

    • CONTEXT8_REMOTE_API_KEY=YOUR_API_KEY
  7. Name the MCP: Context8.

  8. Click the Add button.

Manual Configuration

Add to your settings.json:

Option 1: npx (remote mode)

"augment.advanced": {
  "mcpServers": [
    {
      "name": "context8",
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  ]
}

Option 2: global install (remote-only)

"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:

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}
Install in Opencode
{
  "mcp": {
      "context8": {
        "type": "local",
      "command": ["npx", "-y", "context8-mcp"],
      "enabled": true
    }
  }
}
Install in OpenAI Codex

Option 2: global install (remote-only)

  1. Install globally:

    npm install -g context8
  2. Add via Codex CLI (one-liner):

    codex mcp add context8 -- context8
  3. Get your config paths:

    context8 diagnose

    This will show ready-to-copy config snippets for both recommended and alternative setups!

  4. 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.

Option 1: npx (remote mode)

codex mcp add context8 --env CONTEXT8_REMOTE_API_KEY=YOUR_API_KEY -- npx -y context8-mcp

Or 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 set CONTEXT8_REMOTE_API_KEY!

Install in JetBrains AI Assistant
  1. In JetBrains IDEs, go to Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP)
  2. Click + Add.
  3. Select As JSON option.
  4. Add this configuration:

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}
  1. Click Apply to save.
Install in Kiro
  1. Navigate Kiro > MCP Servers
  2. Click + Add.
  3. Paste this configuration:

Option 1: npx (remote mode)

{
  "mcpServers": {
    "Context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "Context8": {
      "command": "context8",
      "args": [],
      "disabled": false,
      "autoApprove": []
    }
  }
}
  1. Click Save.
Install in Trae

Option 1: npx (remote mode)

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"],
      "env": {
        "CONTEXT8_REMOTE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: global install (remote-only)

{
  "mcpServers": {
    "context8": {
      "command": "context8",
      "timeout": 30000
    }
  }
}
Using Bun or Deno

Bun

{
  "mcpServers": {
    "context8": {
      "command": "bunx",
      "args": ["-y", "context8-mcp"]
    }
  }
}

Deno

{
  "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
  1. Navigate Settings > AI > Manage MCP servers.
  2. Click + Add.
  3. Paste:
{
  "Context8": {
    "command": "npx",
    "args": ["-y", "context8-mcp"],
    "env": {},
    "working_directory": null,
    "start_on_launch": true
  }
}
  1. 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

Add MCP Server context8 to LM Studio

Or manually:

  1. Navigate to Program > Install > Edit mcp.json.
  2. Paste:
{
  "mcpServers": {
    "Context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"]
    }
  }
}
  1. 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 mcp

Then add:

{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"]
    }
  }
}
Install in Zencoder
  1. Go to Zencoder menu (...)
  2. Select Agent tools
  3. Click Add custom MCP
  4. Add configuration:
{
  "command": "npx",
  "args": ["-y", "context8-mcp"]
}
  1. Click Install
Install in Qodo Gen
  1. Open Qodo Gen chat panel
  2. Click Connect more tools
  3. Click + Add new MCP
  4. Add:
{
  "mcpServers": {
    "context8": {
      "command": "npx",
      "args": ["-y", "context8-mcp"]
    }
  }
}
Install in Perplexity Desktop
  1. Navigate Perplexity > Settings > Connectors
  2. Click Add Connector > Advanced
  3. Server Name: Context8
  4. Paste:
{
  "args": ["-y", "context8-mcp"],
  "command": "npx",
  "env": {}
}
  1. 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.

πŸ”¨ Available Tools

Context8 MCP provides the following tools:

Core Error Solution Tools

  • save-error-solution: Save an error with its solution, root cause, and environment details

    • title (required): Concise, generic technical title
    • errorMessage (required): The error message or description
    • errorType (required): One of feature_request, question_support, api_integration, ui_ux, build_ci, install_setup, docs_request, compatibility, licensing, data_quality, ops_infra, other
    • context (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 categorization
    • errorSubtype (optional): Subtype like github_actions, vercel, npm
    • codeChanges (optional): Abstracted code changes
    • conversationLanguage (optional): Language of the conversation
    • programmingLanguage (optional): Primary programming language
    • vibecodingSoftware (optional): Client/tool used
    • isPublic (optional): Public visibility (remote only)
    • projectPath (optional): Generic project type only
    • environment (optional): Environment and dependency versions (JSON)
  • search-solutions: Search for similar errors using hybrid semantic + keyword search

    • query (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 results
    • perQueryLimit (optional): Max results per query before merge
    • mode (optional): semantic | sparse | hybrid
    • Deprecated alias: search-solutions-multi
  • get-solution-detail: Get full details of a specific solution

    • id (required): Solution ID
  • batch-get-solutions: Get details for multiple solutions at once

    • ids (required): Comma-separated solution IDs
  • delete-solution: Delete a solution by ID

    • id (required): Solution ID to delete

πŸ’‘ Usage Examples

Save an Error Solution

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.0

The AI assistant will use save-error-solution to store this in your remote vault.

Search for Solutions

Search Context8 for solutions about "cannot find module" errors

The AI will use search-solutions to find relevant past solutions with similar errors.

Automatic Search on 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.

πŸ“¦ Data Storage & Management

Remote Storage

  • Location: your configured remote server (default https://api.context8.org)
  • Access: via API with CONTEXT8_REMOTE_API_KEY
  • Self-hosted: set CONTEXT8_REMOTE_URL to your deployment

Environment Version Tracking

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.

πŸ–₯️ CLI Usage

Context8 also provides a CLI for direct remote access to your configured remote vault.

List Solutions

context8 list --limit 20 --offset 0
# or: npx -y context8-mcp list --limit 20 --offset 0

Lists remote solutions (requires remote URL; API key may be required by your server).

Search Solutions

context8 search "FastAPI CORS blocked" --limit 5 --mode hybrid
# or: npx -y context8-mcp search "FastAPI CORS blocked" --limit 5 --mode hybrid

Delete a Solution

context8 delete <solution-id>
# or: npx -y context8-mcp delete <solution-id>

Update Package

Check for newer versions and upgrade the global install:

context8 update
# or: context8-mcp update

This command checks npm for the latest published version and installs it globally.

πŸ›Ÿ Tips

Add Automatic Search Rule

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 Context8

Tag Your Solutions

Use consistent tags to categorize solutions:

  • typescript, react, node
  • build-error, runtime-error, type-error
  • database, api, frontend

Store Version Info

Always include environment versions when saving solutions:

Node: 20.10.0
TypeScript: 5.3.3
Framework: Next.js 14.1.0

πŸ”§ Development

Setup

git clone https://github.com/yourusername/context8
cd context8
npm install

Build

npm run build

Run Locally

npx . --help

CLI Commands

Context8 MCP runs as a stdio MCP server when invoked without arguments. The following CLI commands are available:

  • context8 --version (or -v) – Display version number
  • context8 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 mode
  • context8 list – List recent solutions (see CLI Usage section above)
  • context8 search-solutions "<query>" [--limit N --mode hybrid|semantic|sparse] (alias: search) – Search the remote vault
  • context8 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 search
  • context8 get-solution-detail <solutionId> – Fetch full details for one solution
  • context8 batch-get-solutions <id1> <id2> ... (or --ids a,b,c) – Fetch full details for multiple solutions
  • context8 save-error-solution --json '<payload>' (or --file payload.json) – Save a solution using MCP-equivalent schema
  • context8 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 commands
  • context8 update – Check for package updates

AI-first CLI mapping guide:

  • See /Users/aaronpang/Library/Mobile Documents/com~apple~CloudDocs/Context8/context8-mcp/SKILL.md for direct MCP-tool-to-CLI mapping and execution templates.

Environment Variables

  • CONTEXT8_DEFAULT_LIMIT – Default search result limit (optional, defaults to 25)
  • CONTEXT8_REMOTE_URL – Remote Context8 server URL (optional, defaults to https://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.

Remote configuration

  • 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 /apikeys route and belong to an email-verified user; use X-API-Key: <plaintext> in requests (search query must 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!

🚨 Troubleshooting

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 diagnose

This will show:

  1. Installation paths - The exact paths to use in your config
  2. Ready-to-use config snippets - Copy-paste snippets for both JSON and TOML formats
  3. 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 /apikeys for an email-verified user.
  • For search, query must be non-empty (min length 1) or backend returns 422.
  • If using a remote URL, check that CONTEXT8_REMOTE_URL and CONTEXT8_REMOTE_API_KEY are 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 /solutions and /search.
Search Not Finding Results
  1. Check if solutions are actually saved: context8 list (or npx -y context8-mcp list)
  2. Try different search keywords (shorter query terms often work better)
  3. Try --mode sparse to force keyword matching
  4. Verify your API key has access and your CONTEXT8_REMOTE_URL has no trailing slash

πŸ”— Related Projects

πŸ“„ License

MIT License - see LICENSE for details

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

⭐ Star History

If you find Context8 useful, please consider giving it a star on GitHub!


Built with ❀️ for developers who want to remember their solutions

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors