C

Contextweaver

by wchiway · io.github.wchiway/contextweaver

ContextWeaver is a semantic retrieval engine for AI coding assistants. It combines hybrid search, intelligent context expansion, and token-aware packing to deliver precise code snippets to LLMs.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-wchiway-contextweaver": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "RERANK_MODEL": "<VALUE>",
        "RERANK_TOP_N": "20",
        "CW_SEARCH_WLEX": "0.4",
        "CW_SEARCH_WVEC": "0.6",
        "RERANK_API_KEY": "<VALUE>",
        "IGNORE_PATTERNS": "<VALUE>",
        "RERANK_BASE_URL": "<VALUE>",
        "EMBEDDINGS_MODEL": "<VALUE>",
        "EMBEDDINGS_API_KEY": "<VALUE>",
        "EMBEDDINGS_BASE_URL": "<VALUE>",
        "CW_SEARCH_SMART_MAX_K": "8",
        "EMBEDDINGS_DIMENSIONS": "1024",
        "CW_SEARCH_RERANK_TOP_N": "10",
        "CW_SEARCH_VECTOR_TOP_K": "80",
        "CW_SEARCH_MAX_TOTAL_CHARS": "48000",
        "EMBEDDINGS_MAX_CONCURRENCY": "10",
        "CW_SEARCH_IMPORT_FILES_PER_SEED": "3"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
RERANK_MODEL Yes Reranker model name
RERANK_TOP_N No Rerank return count Default: 20
CW_SEARCH_WLEX No Lexical weight Default: 0.4
CW_SEARCH_WVEC No Vector weight (fusion stage) Default: 0.6
RERANK_API_KEY Yes Reranker API key
IGNORE_PATTERNS No Extra ignore patterns
RERANK_BASE_URL Yes Reranker API URL
EMBEDDINGS_MODEL Yes Embedding model name
EMBEDDINGS_API_KEY Yes Embedding API key
EMBEDDINGS_BASE_URL Yes Embedding API URL
CW_SEARCH_SMART_MAX_K No Smart TopK hard upper bound Default: 8
EMBEDDINGS_DIMENSIONS No Vector dimensions Default: 1024
CW_SEARCH_RERANK_TOP_N No Results kept after rerank Default: 10
CW_SEARCH_VECTOR_TOP_K No Vector recall candidates Default: 80
CW_SEARCH_MAX_TOTAL_CHARS No Token budget in chars Default: 48000
EMBEDDINGS_MAX_CONCURRENCY No Embedding concurrency Default: 10
CW_SEARCH_IMPORT_FILES_PER_SEED No E3 import files per seed Default: 3

Similar servers