embecode
Local-first MCP server for semantic + keyword hybrid code search. Zero external services, no API keys required.
README
embecode
Local-first MCP server for semantic + keyword hybrid code search. Zero external services. No API keys required.
Usage
# From your project root
uvx embecode
# Or with an explicit path
uvx embecode --path /path/to/repo
Add to your MCP client config (Claude Desktop, Cursor, Cline, etc.):
{
"mcpServers": {
"embecode": {
"command": "uvx",
"args": ["embecode"]
}
}
}
Tools
| Tool | Description |
|---|---|
search_code |
Hybrid semantic + keyword search over your codebase |
index_status |
Check indexing progress, file count, and last updated time |
How it works
- Parses files into AST chunks via tree-sitter (cAST algorithm)
- Embeds chunks locally with sentence-transformers (
nomic-embed-text-v1.5) - Stores vectors + FTS index in a single DuckDB file at
~/.cache/embecode/ - Fuses BM25 and dense vector results with Reciprocal Rank Fusion
- Watches for file changes via watchfiles and re-indexes incrementally
Development
# Install dependencies
uv sync
# Run tests
uv run pytest
# Lint and format
uv run ruff check src/ tests/
uv run ruff format src/ tests/
Benchmarks
Two benchmark classes live in tests/test_performance.py and use pytest-benchmark:
| Class | DB | What it measures |
|---|---|---|
TestSearchBenchmark |
Mock (in-memory dict) | Searcher + RRF code path only — no real DB or model |
TestSearchBenchmarkReal |
Real DuckDB (VSS + FTS) | Actual query latency: cosine-similarity scan, BM25, and fusion |
Run the real benchmarks:
pytest tests/test_performance.py::TestSearchBenchmarkReal -v --benchmark-only --no-cov -s
The first run builds a 200-file synthetic index into .bench_db/ (~20s). Subsequent runs reuse it and start immediately. Delete .bench_db/ to force a rebuild.
Run the mock benchmarks (no setup cost, useful for isolating Searcher logic overhead):
pytest tests/test_performance.py::TestSearchBenchmark -v --benchmark-only --no-cov -s
Reading the output:
Each test prints a per-phase timing breakdown from SearchTimings on the last benchmark round:
phase breakdown (last run): {'embedding_ms': 0.0, 'vector_search_ms': 78.5, 'bm25_search_ms': 6.5, 'fusion_ms': 0.01, 'total_ms': 85.0}
pytest-benchmark then prints a summary table with min, max, mean, median, and stddev across all rounds.
Requires Python 3.12.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.