
Codeweave
io.github.semihkayan由 GitHub 账号 semihkayan 发布v0.1.20更新于 Oct 27, 2026
Save tokens while coding — your AI agent gets structured code context, not file dumps.
概览
本地 MCP 服务器,为代码库建立索引,让 AI 助手用语义检索获取代码上下文,而不是整份文件塞进上下文。
- 可以做什么
- 按语义检索已索引的函数、类和方法,结合向量、关键词与结构密度排序
- 手动触发或刷新项目索引,通常文件监听会自动增量重建
- 查看索引健康状态:文件与函数数量、嵌入状态、调用图统计和语言分布
- 在 monorepo 中按工作区检索,或一次跨所有工作区搜索
- 适用场景
- 适合助手在较大的 Python、TypeScript、JavaScript、Go、Rust、Java 或 C# 代码库上工作,希望以更少 token 找到相关函数而非通读文件时。主要用于 Claude Code、VS Code 等 MCP 客户端的本地开发场景。
- 运行要求
- 以本地进程运行,通过 npx 或全局 npm 安装;需要 Node.js 20 及以上。语义检索需要 Ollama 和 qwen3-embedding:0.6b 模型,首次运行会下载;没有 Ollama 时仅回退到全文检索。项目需先建立索引,并在 MCP 客户端中配置启动该服务器。
安装
在 SourceWeft 中
- 打开 控制台中的 Codeweave,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@codeweave/mcp
Give your AI agent structured code understanding — not just file dumps.
[npm version] [license] [node version] [supported languages] [status]
CodeWeave is an MCP server that gives AI agents cheap, precise code intelligence. Instead of dumping entire files into context, your agent queries local indexes — AST, call graph, type graph, hybrid semantic search — and gets back only what it needs.
Less tokens. More relevant context. Better decisions.
The semantic search pipeline is the heart of the system: a 6-stage hybrid engine combining vector embeddings, full-text search, and structural density scoring. Tested extensively across large production codebases — Java monoliths, TypeScript monorepos, Python ML pipelines, Go microservices — with consistently strong retrieval accuracy.
Actively developed. New tools and improvements ship regularly. Contributions and feedback are welcome.
Quick Start
That's it. The setup wizard handles everything:
- Installs
@codeweave/mcpglobally - Installs Ollama if needed
- Downloads the embedding model
- Configures your MCP client (Claude Code, VS Code)
- Indexes your project
Note: The first run requires a one-time download of Ollama and the embedding model. This takes a few minutes but only happens once.
Open your project in Claude Code or VS Code and start asking questions.
Tools
3 tools organized around the code understanding workflow:
How It Works
- Parse — tree-sitter extracts every function, class, method, and interface across 7 languages
- Embed — Qwen3-Embedding-0.6B generates vector embeddings for semantic search
- Index — LanceDB stores vectors with BM25 full-text index alongside
- Graph — Call graph tracks who-calls-whom with type-aware resolution; type graph tracks inheritance and implementations (powers ranking and index-status reporting)
- Watch — File watcher detects changes and incrementally reindexes affected files
- Serve — 3 tools exposed over MCP protocol (stdio), ready before indexing completes
Semantic Search
The search pipeline is where CodeWeave really shines. It's not just vector similarity — it's a multi-stage system designed to surface the most relevant and important code:
6-Stage Pipeline:
- Exact name match — Fast path for known function names (score 0.95+)
- Vector search — Embed the query, find semantically similar functions (over-fetches 3x for reranking headroom)
- Full-text search — BM25 keyword matching catches what embeddings miss
- RRF merge — Reciprocal Rank Fusion combines both result lists without needing score calibration
- Exact match boost — Functions whose name matches the query get priority
- Density reranking — Structural signals determine information density, pushing trivial code down
Density Scoring uses 7 language-agnostic structural signals:
Penalties prevent noise from dominating results:
- Accessors (getters/setters) — pure data access, no behavior
- Constructors — many params inflate scores, but they're just assignments
- Test files — large bodies don't mean important behavior (unless you're searching for tests)
Graceful degradation: If Ollama is unavailable, search falls back to full-text only.
Why These Technologies
Every technology choice serves the core goal: local, fast, zero-config code understanding.
Supported Languages
Every language parser also provides:
- Noise filtering — built-in lists of standard library calls (e.g.,
console.log,fmt.Println,System.out.println) that get filtered from dependency analysis - Structural hints — AST-confirmed classifications (constructor, abstract, getter/setter, test) that feed into density scoring
Configuration
CodeWeave works zero-config out of the box. For customization, create .code-context/config.yaml:
CLI Tools
Manual Setup
If you prefer step-by-step instead of npx @codeweave/mcp:
4. Configure your MCP client
Claude Code — add .mcp.json to your project root:
VS Code — add .vscode/mcp.json:
Monorepo Support
CodeWeave auto-detects workspaces in monorepos by scanning for manifest files (package.json, build.gradle, pom.xml, go.mod, Cargo.toml, pyproject.toml, etc.):
Each workspace gets its own isolated index, call graph, type graph, and vector store. Tools accept an optional workspace parameter — omit it to search across all workspaces.
Git Worktree Support
CodeWeave automatically detects git worktrees (including Claude Code's /worktree). On first start in a worktree, it copies the main repo's cache for a fast warm start (~2s instead of 30s+). After that, each worktree maintains its own fully isolated index.
- Automatic — no configuration needed
- Isolated — worktree changes don't affect the main repo's cache
- Incremental — only files that differ from the main branch are re-parsed and re-embedded
Requirements
- Node.js 20+
- Ollama — for semantic search embeddings. Install via the setup wizard or manually from ollama.com. Without Ollama, semantic search falls back to full-text only.
Status
CodeWeave is under active development. The core indexing pipeline and all 3 tools are stable and tested across production codebases in all 7 supported languages.
Feedback, bug reports, and contributions are welcome — open an issue at github.com/semihkayan/codeweave-mcp.
License
来源:README.md,提交 c1de322
工具
0版本历史
1- v0.1.20最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分