com.knitli/codeweaver MCP Server
com.knitli/codeweaver
Semantic code search for AI agents with hybrid AST-aware understanding across 166 languages.
What is the com.knitli/codeweaver MCP server?
CodeWeaver is a semantic code search MCP server that gives AI agents precise, structural context from codebases through hybrid search (semantic + AST + keyword). It supports 166+ languages with AST-level understanding for 27 of them, and reduces token usage by 60–80% compared to keyword-only search.
CodeWeaver provides industrial-grade code context infrastructure for AI agents like Claude. Instead of generic keyword grep results, it delivers exact structural matches through hybrid semantic search, AST awareness, and language-specific chunking. It's designed for reliability with automatic local fallback, works airgapped, and uses 100% dependency injection for extensibility.
How to install com.knitli/codeweaver
Copy-paste configuration for popular MCP clients.
CODEWEAVER_CONFIG_FILESpecify a custom config file path for CodeWeaver. Only needed if not using the default locations.
CODEWEAVER_DEBUGEnable debug mode for CodeWeaver.
CODEWEAVER_EMBEDDING_API_KEYsecretSpecify the API key for the embedding provider, if required. Note: {', '.join([p for p in _providers_for_kind('embedding') if p.])}
CODEWEAVER_EMBEDDING_MODELSpecify the embedding model to use.
CODEWEAVER_EMBEDDING_PROVIDERSpecify the embedding provider to use.
CODEWEAVER_HOSTSet the server host for CodeWeaver.
CODEWEAVER_LOG_LEVELSet the log level for CodeWeaver (e.g., DEBUG, INFO, WARNING, ERROR).
CODEWEAVER_MCP_PORTSet the MCP server port for CodeWeaver if using http transport for mcp. Not required if using the default port (9328), or stdio transport.
CODEWEAVER_PORTSet the port for the codeweaver management server (information and management endpoints).
CODEWEAVER_PROFILEUse a premade provider settings profile for CodeWeaver.
CODEWEAVER_PROJECT_NAMESet the project name for CodeWeaver.
CODEWEAVER_PROJECT_PATHSet the project path for CodeWeaver.
CODEWEAVER_RERANKING_API_KEYsecretSpecify the API key for the reranking provider, if required.
CODEWEAVER_RERANKING_MODELSpecify the reranking model to use.
CODEWEAVER_RERANKING_PROVIDERSpecify the reranking provider to use.
CODEWEAVER_SPARSE_EMBEDDING_MODELSpecify the sparse embedding model to use.
CODEWEAVER_SPARSE_EMBEDDING_PROVIDERSpecify the sparse embedding provider to use.
CODEWEAVER_VECTOR_STORE_API_KEYsecretSpecify the API key for the vector store, if required.
CODEWEAVER_VECTOR_STORE_PORTSpecify the port for the vector store.
CODEWEAVER_VECTOR_STORE_PROVIDERSpecify the vector store provider to use.
CODEWEAVER_VECTOR_STORE_URLSpecify the URL for the vector store.
CODEWEAVER__TELEMETRY__DISABLE_TELEMETRYDisable telemetry data collection.
CODEWEAVER__TELEMETRY__TOOLS_OVER_PRIVACYOpt-in to potentially identifying collection of query and search result data. This is invaluable for helping us improve CodeWeaver's search capabilities. If privacy is a higher priority, do not enable this setting.
HTTPS_PROXYHTTP proxy for requests (Used by: Azure, Azure, Voyage)
OPENAI_API_KEYsecretAPI key for OpenAI-compatible services (not necessarily an API key *for* OpenAI). The OpenAI client also requires an API key, even if you don't actually need one for your provider (like local Ollama). So provide a dummy key if needed. (Used by: Azure, Cerebras, Deepseek, Fireworks, Github, Groq, Heroku, Moonshot, Ollama, Openai, Openrouter, Perplexity, Together, Vercel, X Ai)
OPENAI_LOGOne of: 'debug', 'info', 'warning', 'error' (Used by: Azure, Cerebras, Deepseek, Fireworks, Github, Groq, Heroku, Moonshot, Ollama, Openai, Openrouter, Perplexity, Together, Vercel, X Ai)
SSL_CERT_FILEPath to the SSL certificate file for requests (Used by: Azure, Azure, Voyage)
AI_GATEWAY_API_KEYsecretAPI key for Vercel service
AWS_ACCOUNT_IDAWS Account ID for Bedrock service
AWS_REGIONAWS region for Bedrock service
AWS_SECRET_ACCESS_KEYsecretAWS Secret Access Key for Bedrock service
AZURE_COHERE_API_KEYsecretAPI key for Azure Cohere service (cohere models on Azure)
AZURE_COHERE_ENDPOINTEndpoint for Azure Cohere service (cohere models on Azure)
AZURE_COHERE_REGIONRegion for Azure Cohere service
AZURE_OPENAI_API_KEYsecretAPI key for Azure OpenAI service (OpenAI models on Azure)
AZURE_OPENAI_ENDPOINTEndpoint for Azure OpenAI service (OpenAI models on Azure)
AZURE_OPENAI_REGIONRegion for Azure OpenAI service (OpenAI models on Azure)
COHERE_API_KEYYour Cohere API Key
CO_API_URLHost URL for Cohere service
DEEPSEEK_API_KEYsecretAPI key for DeepSeek service
GEMINI_API_KEYYour Google Gemini API Key
GOOGLE_API_KEYYour Google API Key
HF_HUB_VERBOSITYLog level for Hugging Face Hub client
HF_TOKENAPI key/token for Hugging Face service
INFERENCE_KEYsecretAPI key for Heroku service
INFERENCE_URLHost URL for Heroku service
MISTRAL_API_KEYYour Mistral API Key
QDRANT__LOG_LEVELLog level for Qdrant service
QDRANT__SERVICE__API_KEYsecretAPI key for Qdrant service
QDRANT__SERVICE__ENABLE_TLSEnable TLS for Qdrant service, expects truthy or false value (e.g. 1 for on, 0 for off).
QDRANT__SERVICE__HOSTHostname of the Qdrant service; do not use for URLs with schemes (e.g. 'http://')
QDRANT__SERVICE__HTTP_PORTPort number for the Qdrant service
QDRANT__TLS__CERTPath to the TLS certificate file for Qdrant service. Only needed if using a self-signed certificate. If you're using qdrant-cloud, you don't need this.
TAVILY_API_KEYYour Tavily API Key
TOGETHER_API_KEYsecretAPI key for Together service
VERCEL_OIDC_TOKENsecretOIDC token for Vercel service
VOYAGE_API_KEYsecretAPI key for Voyage service
Tools & capabilities
Tools this server exposes to the agent.
find_code— Hybrid semantic and AST-aware code search across your codebase, supporting 166+ languages with precise structural understanding.
Use cases
- Help Claude find the exact functions that validate OAuth tokens across your codebase without noise
- Reduce token usage by 60–80% when providing code context to AI agents by returning only relevant structural matches
- Search code semantically across 166+ languages with AST-level understanding for 27 languages
- Set up a fully local, airgapped code search system with no cloud dependencies using FastEmbed and local Qdrant
- Swap between embedding providers (Voyage AI, OpenAI, local FastEmbed) without code changes using dependency injection
com.knitli/codeweaver MCP server FAQ
CodeWeaver provides semantic code search for AI agents using hybrid search (semantic vectors + AST + keyword matching). It understands code structure across 166+ languages and returns precise context instead of noisy keyword results, reducing token usage by 60–80%.
CodeWeaver is open-source under MIT or Apache-2.0 license. The 'quickstart' profile uses only free, local tools (FastEmbed + Qdrant). The 'recommended' profile uses Voyage AI embeddings, which has a free tier.
Install via PyPI (`uv add code-weaver`), then run `cw init --profile quickstart` for local-only setup or `cw init --profile recommended` for higher precision. Start the daemon with `cw start`. It exposes an MCP server that Cursor and Claude can connect to.
The 'quickstart' profile requires no authentication and runs fully local. The 'recommended' profile requires a Voyage AI API key (free tier available). You can also configure other embedding providers like OpenAI.
CodeWeaver is no longer actively maintained by Knitli, but the code is open-source (MIT/Apache-2.0) and available for forking. It is well-tested and functional.
CodeWeaver supports 166+ languages for semantic search and language-aware chunking. AST-level structural understanding is available for 27 languages including Python, JavaScript, Java, Go, Rust, and others.
README (reference)
Source of truth, from the repository.
<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/knitli/codeweaver/refs/heads/main/docs-site/src/assets/codeweaver-reverse.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/knitli/codeweaver/refs/heads/main/docs-site/src/assets/codeweaver-primary.svg"> <img alt="CodeWeaver logo" src="https://raw.githubusercontent.com/knitli/codeweaver/refs/heads/main/docs-site/src/assets/codeweaver-primary.svg" height="150px" width="150px"> </picture>[!WARNING]
CodeWeaver is no longer maintained
We're really proud of CodeWeaver and think it's pretty awesome, but we can't maintain it anymore.
We're focused on something else.
CodeWeaver is (was?) a sophisticated, smart, code search tool with wide provider support. and it's still licensed under your choice of MIT or Apache-2.0.
So please, fork it and build something great!
CodeWeaver
Exquisite Context for Agents — Infrastructure that is Extensible, Predictable, and Resilient.
Documentation • Installation • Features • Comparison
</div>What It Does
CodeWeaver gives Claude and other AI agents precise context from your codebase. Not keyword grep. Not whole-file dumps. Actual structural understanding through hybrid semantic search.
CodeWeaver is Professional Context Infrastructure. With 100% Dependency Injection (DI) and a Pydantic-driven configuration system, it provides the reliability and extensibility required for industrial-grade AI deployments.
Example:
Without CodeWeaver:
Claude: "Let me search for 'auth'... here are 50 files mentioning authentication"
Result: Generic code, wrong context, wasted tokens
With CodeWeaver:
You: "Where do we validate OAuth tokens?"
Claude gets: The exact 3 functions across 2 files, with surrounding context
Result: Precise answers, focused context, 60-80% token reduction
CodeWeaver is no longer in alpha!
Early Release (0.x): CodeWeaver is in active development. APIs may change between minor versions. It's very well-tested but still in 'it works on my machine' territory. Use it, break it, help shape it.
How CodeWeaver Stacks Up
Quick Reference Matrix
| Feature | CodeWeaver | Legacy Search Tools |
|---|---|---|
| Search Type | Hybrid (Semantic + AST + Keyword) | Keyword Only |
| Context Quality | Exquisite / High-Precision | Noisy / Irrelevant |
| Extensibility | DI-Driven (Zero-Code Provider Swap) | Hardcoded |
| Reliability | Resilient (Automatic Local Fallback) | Fails on API Timeout |
| Token Usage | Optimized (60–80% Reduction) | Wasted on Noise |
🚀 Getting Started
Quick Install
# Add CodeWeaver to your project
uv add code-weaver
# Initialize with a profile (recommended uses Voyage AI)
cw init --profile recommended
# Verify setup
cw doctor
# Start the background daemon
cw start
📝 Note:
cw initsupports different Profiles:
recommended: High-precision search (Voyage AI + Qdrant)quickstart: 100% local, private, and free (FastEmbed + Local Qdrant)Want full offline? See the Local-Only Guide.
🐳 Prefer Docker? See Docker setup guide →
✨ Features
<table> <tr> <td width="50%">🔍 Exquisite Context
- Hybrid search (sparse + dense vectors)
- AST-level understanding (27 languages)
- Reciprocal Rank Fusion (RRF)
- Language-aware chunking (166+ languages)
🛡️ Industrial Resilience
- Automatic local fallback (FastEmbed)
- Circuit breaker pattern for APIs
- Works airgapped (no cloud required)
- Pydantic-driven validation at boot-time
🧩 Universal Extensibility
- 100% DI-driven architecture
- 17+ integrated providers
- Custom provider API
- Zero-code provider swapping
🛠️ Developer Experience
- Live indexing with file watching
- Diagnostic tool (
cw doctor) - Multiple CLI aliases (
cw/codeweaver) - Selectable profiles for easy setup
💭 Philosophy: Context is Oxygen
AI agents face too much irrelevant context, causing token waste, missed patterns, and hallucinations. CodeWeaver addresses this with one focused capability: structural + semantic code understanding that you control.
- Curation over Collection: Give agents exactly what they need, nothing more.
- Privacy-First: Your code stays local if you want it to.
- Infrastructure over Tooling: Built to be the reliable foundation for your AI stack.
📖 Read the detailed rationale →
<div align="center">
Official Documentation: docs.knitli.com/codeweaver/
Built with ❤️ by Knitli
</div> <!-- Badges --> <!-- Other links -->Related MCP servers
Query and audit AppSheet apps in natural language via Knotrik's pre-scanned definitions.

Team docs served to AI agents over MCP - search, Markdown reads, version pinning, read audit.
View repository →
KnowJudges
Source-linked research on U.S. judges, courts, cases, and judicial analytics.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
Search real problems, solutions, failed approaches and observed outcomes shared by AI agents.
View repository →Search, retrieve, create, and update visual knowledge maps in a user's KnowMapped account.