← Back to directory
C

ContextWeaver

Community
A Codebase Context Engine Woven for AI Agents
Category
Dev Tools #219 of 438
Stars
★ 296 Popular
Transport
stdio (local process)
Runtime
Node.js 20+
Credentials
API key / credential required
License
MIT
Last commit
Tools
1
53FMRS · D

Overall positive. Hybrid search and context expansion effectively improve retrieval quality, but reliance on external APIs may be a concern for privacy-sensitive environments. Setup is simple, suitable for AI-assisted development.

Strongest · Documentation 13/20 Weakest · Security and permissions 8/20

Reliability
10/20
Security and permissions
8/20
Maintenance
12/20
Documentation
13/20
Setup experience
10/20
Why each score
Reliability 10/20
Source shows a clear module structure and complete implementations of search, indexing, and MCP server. However, static review cannot verify actual execution, and no automated tests or CI config were found, so reproducibility of key paths is uncertain. MCP server initialization and tool definitions exist but error handling depth is unverified.
Security and permissions 8/20
API keys are required as environment variables and not hardcoded. But there's no documentation on key permission scopes, and the server relies on external network services (SiliconFlow) with potential data exfiltration risk. No malicious behavior or credential theft detected.
Maintenance 12/20
Repository is active with 294 stars and recent commits, but no release management is evident. MIT license present, but no security response channel or dependency update policy. Governance gaps exist.
Documentation 13/20
README provides detailed installation, configuration, and MCP integration guides, including tool parameters and environment variables. However, troubleshooting guidance and API cost details are missing. Docs align with source structure but have implicit assumptions.
Setup experience 10/20
Provides global install and one-command MCP server startup, plus Claude Desktop config example. But platform compatibility and step-by-step troubleshooting are lacking.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesUses the networkConnects to a database

Best for

  • AI-assisted programming tools requiring semantic code retrieval.
  • Developers looking to reduce manual code searching.
  • Agent applications that need cross-file dependency understanding.

Not for

  • IDE plugins needing real-time code editing or modification.
  • Offline environments without access to external embedding APIs.
  • Scenarios requiring search over extremely large codebases (millions of files).

Required permissions

  • Needs to access the codebase file system (read).
  • Needs to call external Embedding and Reranker APIs (network requests).
  • Needs to write to the config directory ~/.contextweaver for storing indexes and logs.

Risks and side effects

  • API key leakage risk: store keys in the config file securely.
  • Index building may consume significant memory and CPU, especially on large codebases.
  • Retrieved results may contain sensitive code; output access should be controlled.

Setup

Before you start

Runtime:Node.js 20+

EMBEDDINGS_API_KEY requiredsecret API key for the Embedding service, required; obtain from a provider such as SiliconFlow.
EMBEDDINGS_BASE_URL required Embedding API endpoint, required; e.g. https://api.siliconflow.cn/v1/embeddings.
EMBEDDINGS_MODEL required Embedding model name, required; e.g. BAAI/bge-m3.
RERANK_API_KEY requiredsecret API key for the Reranker service, required; obtain from a provider such as SiliconFlow.
RERANK_BASE_URL required Reranker API endpoint, required; e.g. https://api.siliconflow.cn/v1/rerank.
RERANK_MODEL required Reranker model name, required; e.g. BAAI/bge-reranker-v2-m3.
Other optional settings (4)
EMBEDDINGS_MAX_CONCURRENCY optional Embedding concurrency, optional, default 10.
EMBEDDINGS_DIMENSIONS optional Vector dimensions, optional, default 1024.
RERANK_TOP_N optional Number of reranked results to return, optional, default 20.
IGNORE_PATTERNS optional Extra ignore patterns, optional, comma-separated, e.g. .venv,node_modules.
  1. Install globally: npm install -g @hsingjui/contextweaver or pnpm add -g @hsingjui/contextweaver.
  2. Initialize config: run contextweaver init to create ~/.contextweaver/.env, then fill in Embedding and Reranker API keys and models.
  3. Index your repository: run contextweaver index in the root directory.
  4. Start MCP server: run contextweaver mcp.
claude_desktop_config.json
{
  "mcpServers": {
    "contextweaver": {
      "command": "contextweaver",
      "args": [
        "mcp"
      ]
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "contextweaver": {
      "command": "contextweaver",
      "args": [
        "mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add contextweaver -- contextweaver mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Run `contextweaver index` on a codebase, then start `contextweaver mcp`; the `codebase-retrieval` tool should appear in the client's tool list, and a successful retrieval query confirms the connection.

Troubleshooting

  1. Check that ~/.contextweaver/.env is correctly configured with API keys and model names.
  2. Ensure the repository path is correct and readable.
  3. View logs at ~/.contextweaver/logs/app.YYYY-MM-DD.log; run with LOG_LEVEL=debug for details.
  4. If index seems stale, run contextweaver index --force to rebuild.

Things to try

Once connected, you can ask your AI assistant things like:

  • Use codebase-retrieval to find how the user authentication flow is implemented in this repo
  • Locate the database connection logic, using the technical terms DatabasePool,Connection
  • Find where route registration is handled in this project
  • Search for the error-handling middleware implementation and explain its structure

Tools 1

codebase-retrieval read-only
Retrieves the most relevant code snippets from the repository based on a semantic request and optional technical terms, including surrounding context.

Use cases

AI coding assistants that need to quickly understand large codebase structures and specific functionality implementations.
Developers who want to query the codebase using natural language, e.g., 'How is the user authentication flow implemented?'
Integrating MCP into IDEs or chat tools to provide repo retrieval capabilities to agents.

Supported clients

Claude Desktop

Listed from the project's documentation, not tested by this site.

Overview

ContextWeaver is an MCP-based semantic code retrieval engine that uses hybrid search (vector + lexical), AST-based semantic chunking, three-stage context expansion, and token-aware packing to provide precise, relevant code context for LLMs. Supports TypeScript, JavaScript, Python, Go, Java, Rust.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision 42375d315e18 Data synced 2026-10-19 Read the FMRS scoring method