Skip to main content

Extensible MCP server for semantic code search with plugin architecture supporting multiple embedding providers, vector databases, and data sources.

Project description

CodeWeaver logo

CodeWeaver

The missing abstraction layer between AI and your code

Python Version License Alpha Release MCP Compatible

InstallationFeaturesHow It WorksDocumentationContributing


🎯 What is CodeWeaver?

CodeWeaver gives both humans and AI a deep, structural understanding of your project — not just text search, but real context: symbols, blocks, relationships, intent. MCP is just the delivery mechanism; CodeWeaver is the capability.

If you want AI that actually knows your code instead of guessing, this is the foundation.

⚠️ Alpha Release: CodeWeaver is in active development. Use it, break it, shape it, help make it better.


🔍 Why CodeWeaver Exists

The Problems

Problem Impact
🔴 Poor Context = Poor Results Agents are better at generating new code than understanding existing structure
💸 Massive Inefficiency Agents read the same huge files repeatedly (50%+ context waste is common)
🔧 Wrong Abstraction Tools built for humans, not for how agents actually work
🔒 No Ownership Existing solutions locked into specific IDEs or agent clients like Claude Code

The result: Shallow, inconsistent, fragile context. And you don't control it.

CodeWeaver's Approach

One focused capability: Structural + semantic code understanding ✅ Hybrid search built for code, not text ✅ Works offline, airgapped, or degradedDeploy it however you wantOne great tool instead of 30 mediocre ones

📖 Read the detailed rationale →


🚀 Getting Started

Quick Install

Using the CLI with uv:

# Add CodeWeaver to your project
uv add --prerelease allow --dev code-weaver

# Initialize config and MCP setup
cw init

# Verify setup
cw doctor

# Start the server
cw server

📝 Note: cw init defaults to CodeWeaver's recommended profile, which requires:

🐳 Prefer Docker? See Docker setup guide →

MCP Configuration

CodeWeaver uses stdio transport by default, which proxies to the HTTP backend daemon. First start the daemon with codeweaver start, then MCP clients can connect via stdio.

cw init will add CodeWeaver to your project's .mcp.json:

{
  "mcpServers": {
    "codeweaver": {
      "type": "stdio",
      "cmd": "uv",
      "args": ["run", "codeweaver", "server"],
      "env": {"SOME_API_KEY_FOR_PROVIDERS": "value"}
    }
  }
}
{
  "mcpServers": {
    "codeweaver": {
      "type": "http",
      "url": "http://127.0.0.1:9328/mcp"
    }
  }
}

✨ Features

🧠 Smart Search

  • Hybrid search (sparse + dense)
  • AST-level understanding
  • Semantic relationships
  • Context-aware chunking

🌐 Language Support

  • 26 languages with full AST/semantic
  • 166+ languages with intelligent chunking
  • Family heuristics for smart parsing

🔄 Resilient & Offline

  • Automatic fallback to local models
  • Works offline/airgapped
  • Health monitoring with graceful degradation
  • Better degraded than others' primary mode

⚙️ Flexible Configuration

  • ~15 config sources (TOML/YAML/JSON)
  • Cloud secret stores (AWS/Azure/GCP)
  • Hierarchical merging
  • Environment overrides

🔌 Provider Support

🛠️ Developer Experience

  • Live indexing with file watching
  • Low CPU overhead
  • Full CLI (cw / codeweaver)
  • Health, metrics, status endpoints

🏗️ How It Works

CodeWeaver combines AST-level understanding, semantic relationships, and hybrid embeddings (sparse + dense) to deliver both contextual and literal understanding of your codebase.

The goal: give AI the fragments it should see, not whatever it can grab.

Architecture Highlights

┌─────────────────────────────────────────────────────────┐
│                    Your Codebase                        │
└────────────────┬────────────────────────────────────────┘
                 │
                 ▼
        ┌────────────────┐
        │  Live Indexing  │ ← AST parsing + semantic analysis
        └────────┬───────┘
                 │
                 ▼
    ┌────────────────────────┐
    │   Hybrid Vector Store   │ ← Sparse + Dense embeddings
    └────────┬───────────────┘
             │
             ▼
    ┌─────────────────┐
    │  Reranking Layer │ ← Relevance optimization (heuristic and reranking model)
    └────────┬────────┘
             │
             ▼
    ┌──────────────────┐
    │   MCP Interface   │ ← Simple "find_code" tool (`find_code("authentication api")`)
    └────────┬─────────┘
             │
             ▼
       ┌─────────┐
       │   AI    │
       └─────────┘

CLI Commands

cw start     # Start daemon in background (or --foreground)
cw stop      # Stop the daemon
cw server    # Run the MCP server (stdio by default)
cw doctor    # Full setup diagnostic
cw index     # Run indexing without server
cw init      # Set up MCP + config
cw list      # List providers, models, capabilities
cw status    # Live server status, health, index state
cw search    # Test the search engine
cw config    # View resolved configuration

Running as a System Service

Install CodeWeaver to start automatically on login:

cw init service          # Install and enable (systemd/launchd)
cw init service --uninstall  # Remove the service

📖 Full CLI Guide →


📊 Current Status (Alpha)

Stability Snapshot: Strong Core, Prickly Edges

Component Status Notes
🔄 Live indexing & file watching ⭐⭐⭐⭐ Runs continuously; reliable
🌳 AST-based chunking ⭐⭐⭐⭐ Full semantic/AST for 26 languages
📝 Context-aware chunking ⭐⭐⭐⭐ 166+ languages, heuristic AST-lite
🔌 Provider integration ⭐⭐⭐ Voyage/FastEmbed reliable, others vary
🛡️ Automatic fallback ⭐⭐⭐ Seamless offline/degraded mode
💻 CLI ⭐⭐⭐⭐ Core commands fully wired and tested
🐳 Docker build ⭐⭐⭐ Skip local Qdrant setup entirely
🔗 MCP interface ⭐⭐⭐ Core ops reliable, some edge cases
🌐 HTTP endpoints ⭐⭐⭐ Health, metrics, state, versions stable

Legend: ⭐⭐⭐⭐ = solid | ⭐⭐⭐ = works with quirks | ⭐⭐ = experimental | ⭐ = chaos gremlin


🗺️ Roadmap

The enhancement issues describe detailed plans. Short version:

  • 📚 Way better docs – comprehensive guides and tutorials
  • 🤖 AI-powered context curation – agents identify purpose and intent
  • 🔧 Data provider integration – Tavily, DuckDuckGo, Context7, and more
  • 💉 True DI system – replace existing registry
  • 🕸️ Advanced orchestration – integrate pydantic-graph

What Will Stay: One Tool

One tool. We give AI agents one simple tool: find_code.

Agents just need to explain what they need. No complex schemas. No novella-length prompts.


📚 Documentation

For Users

For Developers

Product Philosophy


🤝 Contributing

PRs, issues, weird edge cases, feature requests — all welcome!

This is still early, and the best time to help shape the direction.

How to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. ✨ Make your changes
  4. ✅ Add tests if applicable
  5. 📝 Update documentation
  6. 🚀 Submit a PR

You'll need to agree to our Contributor License Agreement.

Found a Bug?

🐛 Report it here – include as much detail as possible!


🔗 Links

Project

Company

Support the Project

We're a one-person company at the moment... and make no money... if you like CodeWeaver and want to keep it going, please consider sponsoring me 😄


📦 Package Info

  • Python package: code-weaver 👈❗ note the hyphen
  • CLI commands: cw / codeweaver
  • Python requirement: ≥3.12 (tested on 3.12, 3.13, 3.14)
  • Entry point: codeweaver.cli.app:main

📄 License

Licensed under MIT OR Apache 2.0 — you choose! Some vendored code is Apache 2.0 only and some is MIT only. Everything is permissively licensed.

The project follows the REUSE specification. Every file has detailed licensing information, and we regularly generate a software bill of materials.


📊 Telemetry

The default includes very anonymized telemetry to improve CodeWeaver. See the implementation or read the README.

Opt out: export CODEWEAVER__TELEMETRY__DISABLE_TELEMETRY=true

Opt in to detailed feedback (helps us improve): export CODEWEAVER__TELEMETRY__TOOLS_OVER_PRIVACY=true

📋 See our privacy policy


⚠️ API Stability

Warning: The API will change. Our priority right now is giving you and your coding agent an awesome tool.

To deliver on that, we can't get locked into API contracts while we're in alpha. We also want you to be able to extend and build on CodeWeaver — once we get to stable releases.


Built with ❤️ by Knitli

⬆ Back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_weaver-0.1.0a3.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_weaver-0.1.0a3-py3-none-any.whl (987.9 kB view details)

Uploaded Python 3

File details

Details for the file code_weaver-0.1.0a3.tar.gz.

File metadata

  • Download URL: code_weaver-0.1.0a3.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for code_weaver-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 4d68c4c732708851545a403b85feb51e8b6442c97ac1644b3fd0729e5eade459
MD5 325e7f6a69359edbc57ffa5623cb4fa1
BLAKE2b-256 4766019a1326ba61905c11997fa1852b842b0f61f1ea7f32b1b78ccd273ea0df

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_weaver-0.1.0a3.tar.gz:

Publisher: release.yml on knitli/codeweaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file code_weaver-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: code_weaver-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 987.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for code_weaver-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 9558ff1a461c4e479e950a7701f660b6b2c21761395d3b60c4ac3d5712ba1896
MD5 87d0ee25f9d033118bd733f4392c890d
BLAKE2b-256 450fd7c42f5473e88ba90319bb84a7efb739de900507d1d0a90ab59a4cf87ba8

See more details on using hashes here.

Provenance

The following attestation bundles were made for code_weaver-0.1.0a3-py3-none-any.whl:

Publisher: release.yml on knitli/codeweaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page