
Embgrep
io.github.ArkNill由 GitHub 账号 ArkNill 发布v0.1.0更新于 Oct 24, 2026
Local semantic search — embedding-powered grep for files, zero external services.
概览
Embgrep 是一个本地 MCP 服务器,可将文件索引为向量嵌入,让助手对代码库或文档进行语义搜索。
- 可以做什么
- 它提供四个工具:index_directory 用于索引目录中的文件,semantic_search 用于以自然语言查询已索引文件,index_status 用于查看索引统计信息,update_index 用于仅对变更文件进行增量重建索引。文件会按函数级或标题级切分为片段,使用 fastembed 与 ONNX Runtime 在本地生成嵌入,并以向量形式存入单个 SQLite 文件。搜索按余弦相似度排序,返回文件路径、行号范围和得分。
- 适用场景
- 当助手需要按含义而非精确关键词查找代码或文档时适用,例如定位认证中间件或数据库连接池相关逻辑。适合本地项目,希望在不把文件内容发送到云端服务、也不额外运行向量数据库的情况下进行语义搜索。
- 运行要求
- 作为本地进程在用户机器上运行,从 PyPI 安装 embgrep 并附带 mcp 扩展(例如通过 uvx)。需要带 fastembed 和 numpy 的 Python 环境,首次使用时下载 BAAI/bge-small-en-v1.5 模型。无需 API 密钥、账号或外部服务。索引默认存储在 ~/.local/share/embgrep/embgrep.db。
安装
在 SourceWeft 中
- 打开 控制台中的 Embgrep,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
embgrep
Local semantic search — embedding-powered grep for files, zero external services.
[PyPI] [Python] [License: MIT]
Search your codebase and documentation by meaning, not just keywords. embgrep indexes files into local embeddings and lets you run semantic queries — no API keys, no cloud services, no vector database servers.
Features
- Local embeddings — Uses fastembed (ONNX Runtime), no API keys needed
- SQLite storage — Single-file index, no external vector DB
- Incremental indexing — Only re-indexes changed files (SHA-256 hash comparison)
- Smart chunking — Function-level splitting for code, heading-level for docs
- MCP native — 4-tool FastMCP server for LLM agent integration
- 15+ file types —
.py,.js,.ts,.java,.go,.rs,.md,.txt,.yaml,.json,.toml, and more
Install
Quick Start
Python API
CLI
Convenience functions
MCP Server
Add to your Claude Desktop / MCP client configuration:
Or with uvx:
MCP Tools
How It Works
-
Chunking — Files are split into semantically meaningful chunks:
- Code files (
.py,.js,.ts, etc.): split by function/class boundaries - Documents (
.md,.txt): split by headings or paragraph breaks - Config files: fixed-size chunking
- Code files (
-
Embedding — Each chunk is converted to a 384-dimensional vector using BGE-small-en-v1.5 via ONNX Runtime (no PyTorch needed)
-
Storage — Embeddings are stored as BLOBs in a local SQLite database
-
Search — Query text is embedded and compared against all chunks using cosine similarity
Configuration
QuartzUnit Ecosystem
Used in
- newswatch — RSS news monitoring pipeline (feedkit → markgrab → embgrep → diffgrab)
License
MIT
Part of the QuartzUnit ecosystem — composable Python libraries for data collection, extraction, search, and AI agent safety.
来源:README.md,提交 3e4f6da
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分