Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
QuartzUnit avatar

Embgrep

  • Updated April 15, 2026
  • QuartzUnit/embgrep

Embgrep is an MCP server that provides local embedding-powered semantic search over files with no external services.

About

Embgrep is a Model Context Protocol server that brings local semantic search to your codebase: embeddings let an agent locate files and passages by intent instead of brittle string matches. Developers running Claude Code, Cursor, or similar hosts install the PyPI package, register stdio MCP, and use it while building unfamiliar features, reviewing before ship, or iterating on bugs in operate. Because it advertises zero external services, it suits air-gapped, privacy-sensitive, or cost-conscious workflows where you do not want to pipe repository content to a hosted code search API. Pair it with normal grep for literals; use embgrep when the question is conceptual (‘payment webhook handling’, ‘retry backoff’) and exact tokens are unknown.

  • Embedding-powered grep: meaning-based search across local files
  • Zero external services in the server description—indexes and search stay on your machine
  • embgrep PyPI package (0.1.0) with stdio MCP transport
  • Complements literal ripgrep when symbols and wording differ from how you ask
  • GitHub source QuartzUnit/embgrep for self-hosted agent setups

Embgrep by the numbers

  • Data as of Jul 7, 2026 (Skillselion catalog sync)
terminal
claude mcp add embgrep -- uvx embgrep

Add your badge

Show developers this MCP server is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Packageembgrep
TransportSTDIO
AuthNone
Last updatedApril 15, 2026
RepositoryQuartzUnit/embgrep

What it does

Give your coding agent embedding-powered semantic search over local files so it finds relevant code without exact-match grep or cloud index services.

Who is it for?

Best when you want private, local semantic code search wired into MCP agents alongside your normal editor workflow.

Skip if: Skip if you only search logs in production observability stacks, or and need org-wide cross-repo search with centralized team permissions.

What you get

After registering embgrep, your agent can semantically search the local tree so you find related implementations faster without a cloud code index.

  • Agent-accessible semantic search over configured local paths
  • Private search workflow with no required external search service
  • Faster navigation hooks for build, review, and fix loops

By the numbers

  • MCP server version 0.1.0
  • PyPI identifier embgrep, stdio transport
  • Repository QuartzUnit/embgrep on GitHub
README.md

embgrep

한국어 문서 · llms.txt

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

pip install embgrep              # core (fastembed + numpy)
pip install embgrep[cli]         # + click/rich CLI
pip install embgrep[mcp]         # + FastMCP server
pip install embgrep[all]         # everything

Quick Start

Python API

from embgrep import EmbGrep

eg = EmbGrep()

# Index a directory
eg.index("./my-project", patterns=["*.py", "*.md"])

# Semantic search
results = eg.search("database connection pooling", top_k=5)
for r in results:
    print(f"{r.file_path}:{r.line_start}-{r.line_end} (score: {r.score:.4f})")
    print(f"  {r.chunk_text[:80]}...")

# Incremental update (only changed files)
eg.update()

# Index statistics
status = eg.status()
print(f"{status.total_files} files, {status.total_chunks} chunks, {status.index_size_mb} MB")

eg.close()

CLI

# Index a project
embgrep index ./my-project --patterns "*.py,*.md"

# Search
embgrep search "error handling patterns"

# Filter by file type
embgrep search "async database query" --path-filter "%.py"

# Check status
embgrep status

# Update changed files
embgrep update

Convenience functions

import embgrep

embgrep.index("./src")
results = embgrep.search("authentication middleware")
status = embgrep.status()
embgrep.update()

MCP Server

Add to your Claude Desktop / MCP client configuration:

{
  "mcpServers": {
    "embgrep": {
      "command": "embgrep-mcp"
    }
  }
}

Or with uvx:

{
  "mcpServers": {
    "embgrep": {
      "command": "uvx",
      "args": ["--from", "embgrep[mcp]", "embgrep-mcp"]
    }
  }
}

MCP Tools

Tool Description
index_directory Index files in a directory for semantic search
semantic_search Search indexed files using natural language
index_status Get current index statistics
update_index Incremental update — re-index changed files only

How It Works

flowchart TD
    A["📁 Files"] --> B["Smart Chunking\ncode: function-level\ndocs: heading-level"]
    B --> C["fastembed\nlocal embeddings"]
    C --> D["SQLite\nvector index"]
    D --> E["🔍 Query"]
    E --> F["Cosine Similarity\nranked results"]
    F --> G["✅ Matches\nwith context"]
  1. 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
  2. Embedding — Each chunk is converted to a 384-dimensional vector using BGE-small-en-v1.5 via ONNX Runtime (no PyTorch needed)

  3. Storage — Embeddings are stored as BLOBs in a local SQLite database

  4. Search — Query text is embedded and compared against all chunks using cosine similarity

Configuration

Parameter Default Description
db_path ~/.local/share/embgrep/embgrep.db SQLite database location
model BAAI/bge-small-en-v1.5 fastembed model name
max_chunk_size 1000 chars Maximum chunk size for fixed-size splitting
top_k 5 Number of search results

QuartzUnit Ecosystem

Package Description
markgrab HTML/YouTube/PDF/DOCX to LLM-ready markdown
snapgrab URL to screenshot + metadata
docpick OCR + LLM document structure extraction
browsegrab Local LLM browser agent
feedkit RSS feed collection + MCP
embgrep Local semantic search for files

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.

Recommended MCP Servers

How it compares

Local semantic file-search MCP server, not a document OCR extractor or RSS research feed kit.

FAQ

Who is embgrep for?

Developers using MCP-enabled agents who want meaning-based code search on their machine without subscribing to external embedding search APIs.

When should I use embgrep?

Use it when you are navigating or refactoring a codebase and need to locate concepts, patterns, or related modules that literal grep will not catch.

How do I add embgrep to my agent?

Install embgrep from PyPI (0.1.0), add it as an MCP stdio server with identifier embgrep in your host JSON, restart, and invoke its search tools from the agent.

Developer Toolsintegrationsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.