cowork-semantic-search
cowork-semantic-search
If you find this useful, consider giving it a ⭐ — it helps others discover the project.
Local semantic search for your documents. No API keys. No cloud. Works with any MCP client.

Why
AI coding tools are powerful, but they have blind spots when it comes to your local files:
Frozen knowledge -- training data has a cutoff. Your latest reports, notes, and contracts don't exist in the model's world.
Context window limits -- you can't paste 500 documents into a prompt.
No cross-file search -- your AI tool can read one file at a time, but can't search across your entire document library for the relevant pieces.
This plugin bridges that gap. It indexes your local documents into a small, fast vector database. When you ask a question, it retrieves only the relevant pieces -- so your AI tool can answer with your actual data.
Your documents --> chunked --> embedded --> local vector DB
|
Your question --> embedded --> similarity search --> relevant chunks --> AI answersRelated MCP server: rag-mcp
Features
Fully offline -- one-time model download (~120MB), then no network calls. No data leaves your machine.
Incremental indexing -- SHA-256 content hashing. Only changed files get reprocessed. Re-indexing 1000 files where 3 changed takes seconds.
Multilingual -- handles 50+ languages natively. Search in one language, find results in another.
Hybrid search -- combines semantic similarity with full-text keyword search via Reciprocal Rank Fusion. Catches what pure vector search misses.
Multiple formats -- txt, md, pdf, docx, pptx, csv out of the box.
Any MCP client -- works with Claude Code, Cursor, Windsurf, Cline, and any other MCP-compatible tool.
Zero infrastructure -- LanceDB stores everything as local files. No server, no Docker, no database to manage.
Supported Formats
Format | Extension | Details |
Plain text |
| UTF-8 with fallback |
Markdown |
| Raw text preserved |
| Page-level extraction with metadata | |
Word |
| Full paragraph extraction |
PowerPoint |
| Slide-level extraction with metadata |
CSV |
| Row-based text extraction |
Quick Start
1. Install
git clone https://github.com/ZhuBit/cowork-semantic-search.git
cd cowork-semantic-search
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[all]"2. Configure your MCP client
Add the server to your MCP client's config. Replace paths with your own.
{
"mcpServers": {
"semantic-search": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "server.main"],
"cwd": "/absolute/path/to/cowork-semantic-search",
"env": {
"PYTHONPATH": "/absolute/path/to/cowork-semantic-search"
}
}
}
}{
"mcpServers": {
"semantic-search": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "server.main"],
"env": {
"PYTHONPATH": "/absolute/path/to/cowork-semantic-search"
}
}
}
}{
"mcpServers": {
"semantic-search": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "server.main"],
"env": {
"PYTHONPATH": "/absolute/path/to/cowork-semantic-search"
}
}
}
}Open Cline > MCP Servers icon > Configure > Advanced MCP Settings, then add:
{
"mcpServers": {
"semantic-search": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "server.main"],
"env": {
"PYTHONPATH": "/absolute/path/to/cowork-semantic-search"
}
}
}
}3. Restart your MCP client and go
"Index all documents in ~/Documents/projects"
"Search for 'quarterly revenue report'"
First run downloads the embedding model (~120MB), then everything runs offline.
Example: Search Your Obsidian Vault
If you keep notes in Obsidian (or any folder of markdown files), this plugin turns your AI tool into a search engine for your knowledge base.
You: "Index my vault at ~/Documents/ObsidianVault"
AI: Indexed 847 files -> 3,291 chunks in 42s
You: "What did I write about API rate limiting?"
AI: Found 6 relevant chunks across 3 files:
- notes/backend/rate-limiting-strategies.md
- projects/acme-api/design-decisions.md
- daily/2025-11-03.md
...
You: "Find anything about the client meeting last November, use hybrid search"
AI: Found 4 results using hybrid search (vector + keyword):
- meetings/2025-11-12-acme-kickoff.md
- daily/2025-11-12.md
...Works the same with PDFs, Word docs, PowerPoints, and CSVs -- just point it at a folder.
Tools
Tool | Description |
| Index or re-index all documents in a folder. Incremental -- skips unchanged files. |
| Search indexed documents using natural language. Supports |
| Show total chunks, file count, and list of indexed files. |
| Force re-index a single file, bypassing the hash cache. |
How It Works
Parse -- extract text from each document, preserving structure (pages, slides)
Chunk -- split into ~400 character overlapping pieces for precise retrieval
Embed -- convert each chunk into a 384-dimensional vector using
paraphrase-multilingual-MiniLM-L12-v2Store -- save chunks + vectors in a LanceDB database (a local file, no server needed)
Search -- embed your query, find nearest chunks by cosine similarity, optionally combine with full-text keyword search via RRF
Advanced Usage
from server.indexer import index_folder
from server.search import semantic_search
# Index a folder
result = index_folder("/path/to/docs")
print(f"{result['files_indexed']} files -> {result['total_chunks']} chunks")
# Search
results = semantic_search("project deadline", mode="hybrid")
for r in results["results"]:
print(f" {r['file_name']}: {r['text'][:100]}...")Architecture
server/
main.py # MCP server + tool definitions
parsers.py # Per-format text extraction
chunker.py # Text splitting with metadata
indexer.py # Discovery, hashing, embedding pipeline
store.py # LanceDB vector store + FTS + hybrid search
search.py # Query embedding + search orchestrationComponent | Choice | Why |
MCP framework | FastMCP | Clean tool definitions, async support |
Embeddings | sentence-transformers | Offline, multilingual, fast |
Vector DB | LanceDB | Serverless, embedded, FTS built-in |
Chunking | langchain-text-splitters | Battle-tested recursive splitting |
PyMuPDF | Fast, accurate extraction | |
DOCX | python-docx | Lightweight, no system deps |
PPTX | python-pptx | Slide-level extraction |
Development
source .venv/bin/activate
pytest tests/ -v56 tests covering parsers, chunking, indexing, search, and MCP tool integration.
Contributions welcome -- open an issue or submit a PR.
Roadmap
ONNX runtime for faster embeddings (drop PyTorch dependency)
Configurable chunk size and overlap via tool params
Multi-folder named indexes
Metadata filtering (date ranges, tags, custom fields)
Watch mode (auto-reindex on file changes)
Support
If this is useful to you, consider giving it a ⭐ — it helps others find the project.
License
AGPL-3.0 -- free to use, modify, and self-host. If you offer this as a network service, you must share your source code. See LICENSE for details.
Available Tools
4 toolsget_index_statusARead-only
Get status information about the current search index.
Returns total chunks, list of indexed files with chunk counts, and file type distribution.
Inputs: db_path. Returns: object
index_folderAIdempotent
Index or re-index all documents in a folder for semantic search.
Scans the folder for supported document types (.txt, .md, .pdf, .docx, .pptx, .csv), extracts text, splits into chunks, computes embeddings, and stores them in a local vector database. Only processes files that have changed since the last indexing run. Safe to call multiple times — unchanged files are skipped automatically.
Inputs: folder_path (required), recursive, file_types. Returns: object
reindex_fileAIdempotent
Force re-index a single file, ignoring the content hash cache.
Deletes existing chunks for this file, re-parses, re-chunks, re-embeds, and stores new chunks. Useful when you know a file has changed or when parsing was updated.
Inputs: file_path (required), db_path. Returns: object
semantic_searchARead-only
Search indexed documents using natural language.
Finds the most relevant document chunks matching the query using semantic similarity. Returns ranked results with source file paths and relevance scores.
Use mode='hybrid' to combine vector search with full-text search via Reciprocal Rank Fusion for better keyword + semantic matching.
The folder must be indexed first with index_folder.
Inputs: query (required), mode, top_k, file_type, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Tools cover distinct lifecycle stages: status check, folder indexing, querying, and forced single-file reindexing. The only mild overlap is between index_folder and reindex_file, but descriptions clarify bulk vs. targeted cache-bypassing use.
Three of four names follow verb_noun snake_case (get_index_status, index_folder, reindex_file). semantic_search is an adjective_noun outlier, but the overall pattern remains readable and consistent.
Four tools is a tight, well-scoped set for a focused semantic-search server. Each operation (index, query, status, targeted reindex) maps to a distinct user need without bloat.
Core index/search/reindex/status flows are covered, but there is no delete or remove-from-index operation. Deleted or moved files would leave stale chunks, creating a notable lifecycle gap.
Maintenance
Related MCP Connectors
A search engine that learns from your grades. Store text, records, images or embeddings.
Read and search folders on your own computer with explicit consent. Files are never uploaded.
Ingest, manage, and retrieve documents for RAG-powered AI applications
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Related MCP Servers
- AlicenseAqualityAmaintenancePrivacy-first local document search using semantic search. Runs entirely on your machine with no cloud services, supporting PDF, DOCX, TXT, and Markdown files.94,098 npm429MIT
- FlicenseAqualityDmaintenanceEnables indexing local documents (PDF, Markdown, text, code) into a knowledge base and querying them via semantic search using local embeddings, all running privately on your machine.4-
- FlicenseNot gradedqualityDmaintenanceEnables semantic search over personal files using natural language, with optional AI summarization, all running locally.-
- AlicenseNot gradedqualityDmaintenanceProvides local semantic search over files using embeddings, enabling directory indexing and natural language queries without external services.23 PyPIMIT