Workspace Qdrant MCP
workspace-qdrant-mcp
面向 AI 助手的项目级向量数据库,提供混合语义 + 关键词搜索,并具备自动项目检测功能。
特性
混合搜索 - 使用倒数排名融合(Reciprocal Rank Fusion)结合语义相似度和关键词匹配
项目检测 - 自动识别 Git 仓库并进行项目级集合管理
6 个 MCP 工具 - search, retrieve, rules, store, grep, list
代码智能 - 针对活跃项目的 Tree-sitter 语义分块 + LSP 集成
代码图谱 - 包含算法(PageRank、社区检测、中介中心性)的关系图谱
高性能 CLI - 基于 Rust 的
wqm命令行工具后台守护进程 - 用于持续文件监控和处理的
memexd
快速开始
前置要求
Qdrant -
docker run -d -p 6333:6333 -v qdrant_storage:/qdrant/storage qdrant/qdrantC 编译器 - 首次使用时编译 Tree-sitter 语法所需。Tree-sitter 语法以 C 源码形式分发并在本地编译。
macOS:
xcode-select --install(Xcode 命令行工具)Linux:
apt install build-essential(Debian/Ubuntu) 或dnf groupinstall "Development Tools"(Fedora)Windows: 安装 Visual Studio Build Tools 并勾选 C++ 工作负载
安装
选项 1:Homebrew(推荐 — macOS 和 Linux)
brew install ChrisGVE/tap/workspace-qdrant
brew services start workspace-qdrant选项 2:预构建二进制文件
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/ChrisGVE/workspace-qdrant-mcp/main/scripts/download-install.sh | bash
# Windows (PowerShell)
irm https://raw.githubusercontent.com/ChrisGVE/workspace-qdrant-mcp/main/scripts/download-install.ps1 | iex将 wqm 和 memexd 安装到 ~/.local/bin (Linux/macOS) 或 %LOCALAPPDATA%\wqm\bin (Windows)。
选项 3:从源码构建
git clone https://github.com/ChrisGVE/workspace-qdrant-mcp.git
cd workspace-qdrant-mcp
./install.sh详细说明和平台特定注意事项请参阅 安装参考。对于 Windows,请参阅 Windows 安装指南。
配置 MCP
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"workspace-qdrant-mcp": {
"command": "node",
"args": ["/path/to/workspace-qdrant-mcp/src/typescript/mcp-server/dist/index.js"],
"env": {
"QDRANT_URL": "http://localhost:6333"
}
}
}
}Claude Code:
claude mcp add workspace-qdrant-mcp -- node /path/to/workspace-qdrant-mcp/src/typescript/mcp-server/dist/index.js验证
wqm --version
wqm status healthCLAUDE.md 集成
将以下内容添加到您项目的 CLAUDE.md(或全局的 ~/.claude/CLAUDE.md)中,以便 Claude Code 主动使用 workspace-qdrant:
## workspace-qdrant
The `workspace-qdrant` MCP server provides codebase-aware search, a library knowledge base, a scratchpad for accumulated insights, and persistent behavioral rules. The tool schemas are self-describing; these instructions cover *when* and *how* to use them.
### Primary Search and Knowledge Base
**Use `workspace-qdrant` first whenever context is uncertain** — first session on a project, returning after a significant gap, or exploring an unfamiliar subsystem. It is faster and more accurate than walking files manually, and it retrieves findings from prior sessions that would otherwise be lost.
**Three-step protocol:**
1. **Search** with `workspace-qdrant` (`search`, `grep`, `list`, or `retrieve`)
2. **Fall back** to `Grep`, `Glob`, `WebSearch` only when workspace-qdrant is insufficient or unavailable
3. **Store** any new findings, analysis, or design rationale via `store` so they are retrievable in future sessions
When a fresh handover or strong prior context already covers what you need, skip the exploratory search — but always store new findings at the end.
**Collections and their purpose:**
- `projects` — indexed codebase; use `scope="project"` (current project) or `scope="all"` (across all projects)
- `libraries` — external reference docs, API specs, third-party documentation; add via `store` with `collection="libraries"` and search with `includeLibraries=true`
- `scratchpad` — analysis, design rationale, research transcripts, architectural insights; complements session handovers by building a growing, semantically searchable knowledge layer across sessions
- `rules` — persistent behavioral rules; load at session start via `rules` → `action="list"`
**Practical notes:**
- Use `grep` for exact strings or regex; `list` with `format="summary"` to explore project structure
- Store external docs or specs into `libraries` so they are searchable alongside code
- Use the scratchpad to record *why* decisions were made, not just *what* was done — future sessions can retrieve the reasoning
### Sub-Agents
Sub-agents start with only the prompt you give them — they have no session history or handover context. They must always use `workspace-qdrant` first for any code exploration, without exception. Include this verbatim in every agent prompt:
> "You have no prior context about this codebase. Use `workspace-qdrant` as your mandatory first tool for ALL code searches — symbols, functions, architecture, patterns, prior findings. Use `search`, `grep`, `list`, or `retrieve` before touching any file with Read/Grep/Glob. Store any new findings, analysis, or design rationale via `store` (scratchpad for insights, libraries for reference docs) so they persist for future sessions."
### Project Registration
At session start, check whether the current project is registered with workspace-qdrant. If it is not, ask the user whether they want to register it (do not register silently). Once registered, the daemon handles file watching and ingestion automatically — no further action is needed.
### Behavioral Rules
The `rules` tool manages persistent rules that are injected into context across sessions. Rules are **user-initiated only** — add rules when the user explicitly instructs you to, never autonomously. Use `action="list"` at session start to load active rules.
### Issue Reporting
workspace-qdrant is under active development. If you encounter errors, unexpected behavior, or limitations with any workspace-qdrant tool, report them as GitHub issues at https://github.com/ChrisGVE/workspace-qdrant-mcp/issues using the `gh` CLI.MCP 工具
工具 | 用途 |
| 在索引内容中进行混合语义 + 关键词搜索 |
| 通过 ID 或元数据过滤器直接查找文档 |
| 管理持久的行为规则 |
| 存储内容、注册项目、保存笔记 |
| 使用 FTS5 进行精确子字符串或正则表达式搜索 |
| 列出项目文件和文件夹结构 |
参数和示例请参阅 MCP 工具参考。
集合
集合 | 用途 | 隔离方式 |
| 项目代码和文档 | 按 |
| 参考文档(书籍、论文、文档) | 按 |
| 行为规则和偏好设置 | 按 |
| 临时工作存储 | 按会话隔离 |
CLI 参考
# Service management
wqm service start # Start background daemon
wqm service status # Check daemon status
wqm status health # System health check
# Search and content
wqm search "query" # Search collections
wqm ingest file path.py # Ingest a file
wqm rules list # List behavioral rules
# Project and library
wqm project list # List registered projects
wqm project watch pause # Pause file watchers
wqm library list # List libraries
wqm tags list # List tags with counts
# Administration
wqm admin collections list # List collections
wqm admin rebuild all # Rebuild all indexes
wqm admin backup create # Backup snapshots
wqm admin stats overview # Search analytics
# Code graph
wqm graph stats --tenant <t> # Node/edge counts
wqm graph query --node-id <id> --tenant <t> --hops 2 # Related nodes
wqm graph impact --symbol <name> --tenant <t> # Impact analysis
wqm graph pagerank --tenant <t> --top-k 20 # PageRank centrality
# Setup
wqm init completions zsh # Shell completions
wqm init man install # Install man pages
wqm init hooks install # Install Claude Code hooks
# Queue and monitoring
wqm queue stats # Queue statistics完整文档请参阅 CLI 参考。
配置
环境变量
变量 | 默认值 | 描述 |
|
| Qdrant 服务器 URL |
| - | API 密钥(Qdrant Cloud 必需) |
|
| 嵌入模型 |
架构
+-----------------+
| Claude/Client |
+--------+--------+
|
+--------v--------+
| MCP Server | (TypeScript)
+--------+--------+
|
+--------------+--------------+
| |
+--------v--------+ +--------v--------+
| Rust Daemon | | Qdrant |
| (memexd) | | Vector Database |
+--------+--------+ +-----------------+
|
+--------v--------+
| File Watcher |
| Code Graph |
| Embeddings |
+-----------------+Rust 守护进程负责文件监控、嵌入生成、代码图谱提取和队列处理。所有写入操作均通过守护进程路由以确保一致性。
文档
用户指南:
参考:
规格说明、ADR 和开发者资源请参阅 文档索引。
开发
# TypeScript MCP server
cd src/typescript/mcp-server && npm install && npm run build && npm test
# Rust daemon and CLI (from src/rust/)
cargo build --release
cargo test
# Graph benchmarks
cargo bench --package workspace-qdrant-core --bench graph_bench
# Binaries output to:
# - target/release/wqm
# - target/release/memexd贡献
开发设置和指南请参阅 CONTRIBUTING.md。
许可证
MIT 许可证 - 详情请参阅 LICENSE。
灵感来源于 claude-qdrant-mcp
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ChrisGVE/workspace-qdrant-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server