Contextweaver logo

Contextweaver

Indexes codebases for hybrid semantic and exact-match retrieval, symbol lookup, file browsing, and context expansion through MCP.

Install Contextweaver

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "contextweaver-2": {
      "command": "npx",
      "args": [
        "-y",
        "@chiway/contextweaver"
      ],
      "env": {
        "EMBEDDINGS_API_KEY": "YOUR_VALUE_HERE",
        "EMBEDDINGS_BASE_URL": "YOUR_VALUE_HERE",
        "EMBEDDINGS_MODEL": "YOUR_VALUE_HERE",
        "EMBEDDINGS_MAX_CONCURRENCY": "YOUR_VALUE_HERE",
        "EMBEDDINGS_DIMENSIONS": "YOUR_VALUE_HERE",
        "RERANK_API_KEY": "YOUR_VALUE_HERE",
        "RERANK_BASE_URL": "YOUR_VALUE_HERE",
        "RERANK_MODEL": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @chiway/contextweaver

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The contextweaver MCP server indexes local codebases and retrieves relevant code using hybrid vector and lexical search. It expands results with nearby chunks, related symbols, and optionally imported files, then packs results within a token-aware character limit. MCP tools also expose indexed file listings, heuristic symbol references, likely definitions, and index statistics. Reach for it when an AI coding assistant needs repository-aware code retrieval across supported programming languages.

Use cases

  • Search a local repository with natural-language code questions
  • Find definitions and references for symbols
  • Browse indexed files by language or path pattern
  • Expand retrieved code with nearby and imported context
  • Inspect indexing and search health statistics

Key features

  • Hybrid vector and lexical code retrieval
  • Tree-sitter-based semantic chunking
  • Neighbor, breadcrumb, and import context expansion
  • Symbol definition and reference lookup
  • File structure browsing
  • Index and health statistics

Tools5

What Contextweaver lets your agent do. Expand a tool for its parameters.

Self-reported~72 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 77d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 3d ago via OSV.dev · @chiway/contextweaver (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit5mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Contextweaver works

What contextweaver does

The contextweaver MCP server turns a local codebase into a searchable index for AI coding assistants. Its primary retrieval path combines vector similarity with lexical matching, then merges the result sets using reciprocal rank fusion. This supports both natural-language questions and exact technical terms such as class, function, or method names.

Code is divided into semantic chunks using Tree-sitter parsing. The project lists support for TypeScript, JavaScript, Python, Go, Java, Rust, C, C++, C#, and additional languages. Retrieved context can include neighboring chunks, related items under the same breadcrumb path, and files reached through imports when import expansion is enabled.

The MCP surface includes codebase-retrieval, list-files, find-references, get-symbol-definition, and stats. The latter four provide structure browsing, heuristic symbol lookup, and operational information alongside semantic search.

How it works

Run indexing from a project root or provide a project path explicitly. The first query can trigger indexing automatically, while later changes can be handled incrementally. The optional watch command observes filesystem changes and starts debounced incremental scans.

Search uses embeddings, full-text matching, and reranking. A dynamic cutoff determines how many results to retain, while a total-character limit controls the size of the returned context. The retrieval pipeline also has an in-process LRU query cache; cache entries are invalidated when the index or relevant search configuration changes.

The index stores vectors and location metadata in LanceDB while source content remains in SQLite-backed file storage.

Setup and configuration

Install the package globally with npm or pnpm, then run contextweaver init or cw init to create ~/.contextweaver/.env. Node.js 20 or newer is required. Embedding and reranking configuration must be supplied, including API keys, service URLs, and model names. Search weights, result limits, character limits, import expansion, and ignored paths are configurable through environment variables.

Index a project with contextweaver index, optionally passing a path or --force. Start the MCP transport with contextweaver mcp. The repository shows a Claude Desktop configuration and VS Code installation links using the contextweaver mcp command.

Tools and capabilities

  • codebase-retrieval: searches with semantic and exact-match signals, reranking, context expansion, and result packing.
  • list-files: reports indexed paths, languages, and file sizes, with CLI support for glob, language, and count filters.
  • find-references: finds heuristic text references to a symbol and can exclude the definition.
  • get-symbol-definition: locates likely definition blocks, with an optional path hint.
  • stats: reports indexing, search, and health information through MCP or the CLI.

The contextweaver MCP server also provides command-line mirrors for search, file listing, symbol definitions, references, statistics, migration management, and filesystem watching.

Limitations and notes

Retrieval quality depends on the configured embedding and reranking services, so those services and their credentials are needed for semantic search. Symbol references are described as heuristic text matches, and definitions are described as likely blocks rather than compiler-verified symbols. Import expansion is configurable and can add cross-file context.

The documented setup is local command-line indexing with a local MCP process. Ignored paths can be configured, and excluded paths do not trigger watch-mode scans.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Contextweaver

contextweaver is an MCP server that connects AI coding assistants to indexed local codebases. Its main tools provide hybrid semantic and exact-match retrieval, indexed file listing, heuristic symbol reference search, likely symbol definitions, and indexing, search, and health statistics.

Install it globally with npm or pnpm, then initialize its configuration with `contextweaver init`. The documented commands are `npm install -g @chiway/contextweaver` or `pnpm add -g @chiway/contextweaver`; Node.js 20 or newer is required.

Run `contextweaver index` from the project root, or pass the project path to the command. Use `contextweaver index --force` for a full re-index. The first retrieval query can also trigger indexing automatically.

It requires an embedding API key and a reranker API key for the documented semantic retrieval setup. Configure `EMBEDDINGS_API_KEY` and `RERANK_API_KEY` in `~/.contextweaver/.env`, along with the corresponding service URLs and model names.

It exposes five documented tools: `codebase-retrieval`, `list-files`, `find-references`, `get-symbol-definition`, and `stats`. They cover hybrid code search, indexed file browsing, heuristic references, likely definitions, and indexing or health statistics.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewContextweaver AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/contextweaver-2?style=directory)](https://allmcps.com/mcp/contextweaver-2)
HTML Embed
<a href="https://allmcps.com/mcp/contextweaver-2"><img src="https://allmcps.com/api/badge/contextweaver-2?style=directory" alt="Contextweaver on AllMCPs" /></a>