qmcp
qmcp is a Qdrant-backed MCP server for semantic search, indexing, and maintenance of code/documentation collections.
Run semantic searches with filters for language, chunk type, symbol name, and score threshold.
Index directories and perform full or incremental reindexing.
List, inspect, and delete Qdrant collections.
Start, ensure, or stop file watchers for live auto-reindexing.
Clean up stale vectors and compare Qdrant state against the filesystem.
Diagnose collections and list indexed files with pagination and file-type filters.
Check server status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@qmcp search for code related to OAuth authentication"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
qmcp - QDrant MCP Server for OpenCode
Semantic search server for code and documentation using Qdrant vector database.
Language: English | Русский
Features
Semantic Search: Find code and documentation using natural language queries
Multi-language Support: Python, Go, JavaScript, TypeScript, Java, C#, Markdown
Markdown Section Chunking: Markdown files are split into per-section chunks (
##/###headers) with precise line ranges - search points at the exact section instead of the whole file, and file tails beyond 10 KB are indexed tooCompact Search Responses: Search returns pointer fields only (
file_path,line_start,line_end,type,name) - enough for a targeted read, without bloating the contextLive Updates: File watcher for automatic reindexing
Incremental Indexing: Only index changed files
Gitignore Support: Respects
.gitignore- excludesnode_modules,__pycache__,.venv, build artifacts, etc.Cleanup: Remove stale vectors for deleted/changed files
Diagnostics: Introspection tools to understand what's indexed
OpenCode Skill: Natural language interface for Qdrant management
Related MCP server: Tea Rags MCP
Installation
Via PyPI (Recommended)
pip install qmcp-qdrantVia uv
uv tool install qmcp-qdrantFrom Source
git clone https://github.com/BigKAA/qmcp.git
cd qmcp
make installUpdating
Via uv (Recommended)
uv tool upgrade qmcp-qdrantVia pip
pip install --upgrade qmcp-qdrantQuick Start
1. Ensure Qdrant is running
For Kubernetes deployment, see Qdrant on Kubernetes.
2. Add MCP Server to OpenCode
opencode mcp add qmcp-qdrant qmcp-qdrant⚠️ Note: Environment variables must be set in
~/.config/opencode/opencode.jsonconfig file.
Configuration
Environment Variable | Default | Description |
|
| Qdrant server URL |
| (none) | Qdrant API key (optional) |
|
| MCP transport: |
|
| Bind address for HTTP transports |
|
| Embedding model |
| (system temp) | Custom directory for model cache |
|
| ONNX inference threads per process |
|
| Baseline paths to watch on startup (HTTP transports only, see |
|
| Start the watcher on server startup. |
|
| Shut down an idle stdio server after this many seconds without MCP traffic; the client respawns it on the next call. |
|
| Idle period that must pass before a stdio server replaced by a newer sibling exits |
|
| Batch size for indexing |
|
| Directory for cross-process locks and the stdio instance registry |
|
| Debounce delay |
|
| Logging level |
|
| Log format ( |
💡 Model Cache: Set
EMBEDDING_CACHE_DIRto persist models across restarts. First launch downloads the model (~13MB), subsequent launches use cached version.
💡 Multiple clients, one machine: every MCP client spawns its own qmcp process, and each holds its own embedding model. qmcp deduplicates indexing across processes with file locks (
INDEX_LOCK_DIR), elects a single machine-wide watcher leader (see Process Lifecycle), and caps ONNX threads (EMBEDDING_THREADS, default 4) so N processes cannot saturate every core. KeepWATCH_PATHSscoped to trees you actively work in - with the event-driven watcher (FSEvents/inotify) even a monorepo-scale path costs ~0 idle CPU, since nothing is re-walked periodically.
💡 WATCH_PATHS examples:
Single path:
WATCH_PATHS=/home/user/projectMultiple paths:
WATCH_PATHS=/home/user/project,/home/user/docsJSON array:
WATCH_PATHS=["/home/user/project", "/home/user/docs"]
3. That's It!
OpenCode will automatically discover and use the semantic search tools.
Manual Configuration (Alternative)
If opencode mcp add doesn't work, edit ~/.config/opencode/opencode.json directly:
{
"mcp": {
"qmcp-qdrant": {
"type": "local",
"command": ["qmcp-qdrant"],
"environment": {
"QDRANT_URL": "http://192.168.218.190:6333",
"WATCH_PATHS": "/home/user/shared-docs,/home/user/shared-snippets"
}
}
}
}For Python module:
{
"mcp": {
"qmcp-qdrant": {
"type": "local",
"command": ["python", "-m", "qmcp.server"],
"environment": {
"QDRANT_URL": "http://192.168.218.190:6333",
"WATCH_PATHS": "/home/user/shared-docs,/home/user/shared-snippets"
}
}
}
}Indexing Notes
⚠️ Important: Full indexing and reindexing of large projects can take a significant amount of time (minutes to hours depending on project size).
For large codebases, prefer:
Incremental reindex (
mode="incremental") - only updates changed files based on content hashesFile watcher - enables automatic live updates when files change
Markdown Chunking
Markdown files are chunked per section (headers ## and ### by default). Oversized sections (> 8 KB) are additionally split by paragraph boundaries, never inside code fences. Each chunk carries precise line_start/line_end, so qdrant_search results point to the exact section for a targeted read.
Files without headers fall back to a single document chunk (paragraph-split when oversized).
⚠️ BREAKING (existing collections): The chunk schema changed (per-section chunks instead of one chunk per markdown file). Existing markdown collections must be fully reindexed after upgrading:
qdrant_reindex(path="/path/to/project", collection="docs", mode="full")Incremental reindex will not migrate unchanged files - they keep the old single-chunk layout until a full reindex runs.
Score Threshold Note
The default score_threshold=0.7 is calibrated for bge-* embedding models. For paraphrase-multilingual-* models the top score is typically ~0.64, so the default threshold filters out everything - lower the threshold explicitly for those models.
Automatic Indexing Strategy
qmcp supports automatic indexing on two levels:
Server startup level (HTTP daemon) — a shared
streamable-httpdaemon starts a watcher forWATCH_PATHSon startup, because it is the single machine-wide indexer. A per-connection stdio server does not autostart a watcher (N clients would mean N filesystem pollers); override withWATCH_AUTOSTART=true.Workspace session level — agents check the watcher state for the current workspace and call
qdrant_watch_ensure(paths=[workspace_root])when the workspace path is missing. For stdio servers this is the primary way watching gets enabled.
Recommended flow for every new workspace:
status = qdrant_get_status()
# If watcher is not active or the current repo is not covered,
# safely extend the watcher without dropping other projects.
qdrant_watch_ensure(paths=["/absolute/path/to/current/workspace"])qdrant_watch_ensure merges the current workspace with already watched paths and WATCH_PATHS, making it safe for a single global MCP shared by multiple projects. When several qmcp processes watch the same paths, a cross-process leader lock ensures exactly one of them runs the platform observer; the rest idle in standby with no observer at all (watcher_role in qdrant_get_status shows leader/standby) and are promoted automatically when the leader dies.
Process Lifecycle and Resource Hygiene
A stdio MCP server is spawned per client connection, and clients do not always
clean up: an abandoned connection delivers no EOF when the terminal or
supervisor inherited the pipe fd, and a living parent that reconnects leaves
the old copy running. Accumulated copies each held an embedding model and a
filesystem poller (the 2026-11 CPU overheat incident: 7 concurrent copies,
~126% CPU, 15 GB of memory pressure). stdio servers now bound their own
lifetime with three guards (all disabled for streamable-http/sse, whose
lifetime belongs to the service manager):
Guard | Trigger | Default |
Orphan | Parent process died ( | always on |
Idle | No inbound MCP traffic for | 1800 s ( |
Replacement | A newer instance from the same client registered, and this one idle for | 300 s grace |
Details:
Activity is recorded by an MCP middleware wrapping every inbound message (handshake, pings, tool calls), so a silent-but-alive connection stays alive, while an abandoned one (no messages at all) lets the server exit; in-flight requests and indexing tasks postpone the exit.
Clients respawn their server on the next tool call, so an idle exit is invisible in normal use.
After
run()returns (client disconnected), the entry points hard-exit the process so no lingering thread can keep a dead connection alive.The watcher is single-instance machine-wide (leader lock in
INDEX_LOCK_DIR), so even leftover copies cannot multiply the watching cost.
Diagnostics and manual cleanup of pre-0.3.5 leftovers:
# find running copies
ps -eo pid,ppid,%cpu,etime,command | grep -E 'qmcp(-qdrant)?' | grep -v grep
# reap them (active clients respawn on the next call)
kill <PID...>Deployment: Shared HTTP Daemon (Recommended for Multi-Client Workstations)
With stdio every MCP client (OpenCode, Zed, ZCode, CLI agents) spawns its own
qmcp process - per-connection processes by design, which is what the guards
above keep hygienic. For a workstation with several MCP clients the
recommended alternative is one shared streamable-http daemon: one
process, one embedding model, one watcher, and no per-connection processes to
orphan at all.
TRANSPORT=streamable-http HOST=127.0.0.1 PORT=8000 \
WATCH_PATHS=/Users/me/projects,/Users/me/docs \
qmcp-qdrantClients then connect by URL instead of a command (OpenCode example):
{
"mcp": {
"qmcp-qdrant": {
"type": "remote",
"url": "http://127.0.0.1:8000/mcp"
}
}
}macOS: launchd
~/Library/LaunchAgents/com.qmcp.qdrant.plist - starts on login, restarts on
crash, logs to ~/Library/Logs/qmcp.log:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.qmcp.qdrant</string>
<key>ProgramArguments</key>
<array>
<string>/Users/me/.local/bin/qmcp-qdrant</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>TRANSPORT</key><string>streamable-http</string>
<key>HOST</key><string>127.0.0.1</string>
<key>PORT</key><string>8000</string>
<key>QDRANT_URL</key><string>http://192.168.218.190:6333</string>
<key>WATCH_PATHS</key><string>/Users/me/projects,/Users/me/docs</string>
</dict>
<key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
<key>StandardErrorPath</key><string>/Users/me/Library/Logs/qmcp.log</string>
</dict>
</plist>launchctl load ~/Library/LaunchAgents/com.qmcp.qdrant.plistLinux: systemd (user unit)
~/.config/systemd/user/qmcp.service:
[Unit]
Description=qmcp - Qdrant MCP server (shared daemon)
[Service]
Environment=TRANSPORT=streamable-http
Environment=HOST=127.0.0.1
Environment=PORT=8000
Environment=WATCH_PATHS=/home/me/projects,/home/me/docs
ExecStart=/home/me/.local/bin/qmcp-qdrant
Restart=on-failure
[Install]
WantedBy=default.targetsystemctl --user enable --now qmcp⚠️ Security: bind to
127.0.0.1- the daemon has no authentication and anyone who can reach the port can search and modify your indexes.
MCP Tools
Search & Indexing
Tool | Description |
| Semantic search in code/docs |
| Index a directory |
| Reindex (full or incremental) |
💡 Tip: Use
qdrant_searchwith filters for precise results:
chunk_type— filter by code type (function_def, class_def,section, document)
symbol_name— find exact symbol by name (for markdown: section header text)
language— filter by programming languageResults are compact pointers (
score,file_path,type,name,line_start,line_end) - use them for a targeted file read instead of loading whole files.See docs/STRUCTURED_METADATA.md for detailed examples.
Collection Management
Tool | Description |
| List all collections |
| Get collection info |
| Delete collection |
Diagnostics & Introspection
Tool | Description |
| Full collection diagnostics - vectors, files, types, issues |
| Paginated list of indexed files with metadata |
| Compare Qdrant state with filesystem (orphans, missing, modified) |
Maintenance
Tool | Description |
| Clean stale vectors (dry-run supported) |
| Start file watcher |
| Ensure workspace path is watched without dropping other projects |
| Stop file watcher |
| Server status |
Diagnostic Tools Usage Examples
# Diagnose a collection - see what's indexed, file types, issues
qdrant_diagnose_collection(collection="myproject")
# List indexed files with pagination
qdrant_list_indexed_files(collection="myproject", limit=50, offset=0)
# Filter by file type
qdrant_list_indexed_files(collection="myproject", file_type=".py")
# Compare Qdrant state with filesystem
qdrant_diff_collection(collection="myproject", repo_path="/path/to/repo")OpenCode Skill
The project includes an OpenCode skill for natural language management of Qdrant.
Installation
# Copy skill to OpenCode skills directory
cp -r skills/qmcp-manager ~/.config/opencode/skills/Usage
Once installed, OpenCode will automatically activate the skill when you ask questions like:
Query | What Happens |
| Diagnoses collection and shows stats |
| Lists all collections with vector counts |
| Finds and previews deletion of orphaned vectors |
| Full diagnostics with issues and file list |
| Shows orphans, missing, and modified files |
| Lists files on disk but not indexed |
| Compares hashes to detect changes |
Workflows Provided by Skill
Quick Status - Check collection state with
qdrant_list_collectionsFull Diagnostics - Detailed analysis with
qdrant_diagnose_collectionDiff - Compare Qdrant with filesystem using
qdrant_diff_collectionSafe Cleanup - Preview with dry-run, then confirm deletion
Smart Reindex - Incremental updates based on file hashes
Skill Location
skills/qmcp-manager/SKILL.mdManage MCP Servers
opencode mcp list # List all MCP servers
opencode mcp debug qmcp-qdrant # Debug connection issues
opencode mcp logout qmcp-qdrant # Remove MCP serverDevelopment
make install # Install dependencies
make test # Run tests
make lint # Lint code
make format # Format code
make mcp-dev # Run with MCP inspectorTroubleshooting
If you encounter issues, see the Troubleshooting Guide for:
Embedding Model Issues —
indexed_vectors_count: 0diagnosis and fixConnection Problems — Qdrant connection troubleshooting
Search Returns No Results — Empty search results debugging
License
Apache 2.0
Available Tools
14 toolsqdrant_cleanupB
Clean up stale vectors - remove vectors for deleted or changed files.
Inputs: repo_path (required), collection (required), dry_run. Returns: object
qdrant_delete_collectionC
Delete a collection from Qdrant.
Inputs: name (required). Returns: object
qdrant_diagnose_collectionB
Perform full diagnostics of a collection.
Analyzes the collection and returns:
- Total vectors and files count
- File type distribution
- Chunk type distribution
- Indexing timestamp range (oldest/newest)
- Issues found (missing hashes, empty chunks, etc.)
- List of all indexed files with details
Inputs: collection (required). Returns: object
qdrant_diff_collectionA
Compare Qdrant collection state with filesystem.
Detects three types of discrepancies:
- orphans: Vectors in Qdrant but file doesn't exist on disk
- missing: Files on disk but not indexed in Qdrant
- modified: Files that exist but content has changed (hash mismatch)
Inputs: repo_path (required), collection (required). Returns: object
qdrant_get_collection_infoC
Get information about a collection.
Inputs: name (required). Returns: object
qdrant_get_statusB
Get status of the Qdrant MCP server.
Inputs: no named parameters. Returns: object
qdrant_index_directoryB
Index a directory of code or documentation into Qdrant.
This tool parses source files and adds their content as vectors to the specified collection for semantic search.
Inputs: path (required), collection (required), patterns. Returns: object
qdrant_list_collectionsA
List all collections in Qdrant.
Inputs: no named parameters. Returns: result
qdrant_list_indexed_filesB
List all indexed files in a collection with pagination.
Returns file metadata including:
- File path
- Number of chunks
- Content hash
- Indexed timestamp
- Chunk types found in file
Inputs: collection (required), limit, offset, file_type. Returns: object
qdrant_reindexA
Reindex a directory - either full rebuild or incremental update.
Full mode deletes the collection and recreates it from scratch. Incremental mode only updates changed files.
Inputs: path (required), collection (required), mode. Returns: object
qdrant_searchB
Search for similar code or documentation using semantic search.
This tool performs vector search in Qdrant to find relevant code snippets
or documentation based on semantic similarity to the query.
Use optional filters to narrow down results:
- chunk_type: Find only specific code constructs (function_def, class_def, etc.)
- symbol_name: Find exact symbol by name (e.g., 'get_user', 'MyClass')
- language: Find only files of a specific language
Inputs: query (required), collection (required), limit, language, +3 more. Returns: result
qdrant_watch_ensureA
Ensure watcher is active for the current workspace without dropping other projects.
This tool is designed for OpenCode sessions where one global MCP server is shared across multiple repositories. It merges workspace paths with the configured and/or currently watched paths and only restarts the watcher when the effective watch set changes.
Inputs: paths (required), include_existing, include_configured. Returns: object
qdrant_watch_startB
Start watching paths for file changes and auto-reindex.
This enables live updates - files are reindexed when modified.
Inputs: paths (required). Returns: object
qdrant_watch_stopB
Stop watching paths for file changes.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools target a clearly distinct operation (search, index, delete, status, watch_stop). The main confusable pairs are qdrant_index_directory vs qdrant_reindex (both index the same directories) and qdrant_watch_start vs qdrant_watch_ensure, plus the observability trio diagnose/list_indexed_files/diff_collection which partially overlap in reporting collection state.
All names share a qdrant_ prefix and snake_case, with a predictable verb_noun shape (list_collections, get_collection_info, delete_collection, list_indexed_files, diff_collection). Minor deviation: a few bare verbs with no object (search, reindex, cleanup), which is still readable but breaks the strict pattern.
14 tools is within a sensible range for a vector-indexing/search server and each maps to a real workflow stage (search, index, watch, diagnose, cleanup). Slightly heavy on observability/utility variants: watch_ensure largely duplicates watch_start with path merging, and three tools report collection state.
Coverage of the domain is strong: search with filters, indexing/reindexing, live watching, collection lifecycle (list/info/delete), stale-vector cleanup, and diagnostics/diffing. Gaps are minor: no explicit create_collection (implicitly via index), and no point-level delete/upsert or collection config update beyond full reindex.
Maintenance
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Semantic nearest-neighbour search over your datasets, plus indices and projections.
A search engine that learns from your grades. Store text, records, images or embeddings.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceThis server enables semantic search capabilities using Qdrant vector database and OpenAI embeddings, allowing users to query collections, list available collections, and view collection information.7-
- AlicenseNot gradedqualityBmaintenanceA high-performance MCP server for semantic search and codebase indexing using the Qdrant vector database. It features optimized embedding pipelines, AST-aware chunking, and git metadata enrichment for fast, privacy-focused local or remote search.411 npm33MIT
- FlicenseNot gradedqualityDmaintenanceEnables semantic code search across multi-language codebases using natural language queries, integrated with Qdrant vector database for fast, cached retrieval.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server for semantic code search using Qdrant vector database, enabling natural language queries to find relevant code snippets across indexed codebases.MIT