qmd-mcp-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQMD MCP Skill
QMD MCP Skill
Use this skill to query a local QMD index through using a fixed MCP stdio link.
uxcReuse the skill for generic protocol discovery, JSON envelope parsing, and daemon lifecycle basics.
uxc使用此技能,通过固定的MCP标准IO链接,借助查询本地QMD索引。
uxc复用技能实现通用协议发现、JSON信封解析和守护进程生命周期基础功能。
uxcPrerequisites
前提条件
- is installed and available in
uxc.PATH - is installed and available in the runtime
qmd, or can be launched through a shell wrapper.PATH - A QMD index already exists and is healthy:
qmd statusqmd updateqmd embed
- For GPU-backed setups, the shell used by already exports any required runtime environment such as
qmd mcp,CUDA_PATH,CUDACXX, or Node/nvm initialization.LD_LIBRARY_PATH
- 已安装且可在
uxc中访问。PATH - 已安装且可在运行时
qmd中访问,或可通过shell包装器启动。PATH - QMD索引已存在且状态正常:
qmd statusqmd updateqmd embed
- 对于GPU支持的配置,使用的shell已导出所有必要的运行时环境,如
qmd mcp、CUDA_PATH、CUDACXX,或Node/nvm初始化环境。LD_LIBRARY_PATH
Core Workflow
核心工作流程
- Verify the local QMD index first:
qmd status- Confirm collections, vector count, and device look reasonable before linking MCP.
- Use a fixed link command by default:
command -v qmd-mcp-cli- If missing and already works in the current shell:
qmduxc link --daemon-idle-ttl 0 qmd-mcp-cli "qmd mcp"
- If depends on
qmd, CUDA env, or other shell setup, wrap it explicitly:nvmuxc link --daemon-idle-ttl 0 qmd-mcp-cli "/bin/bash -lc 'export NVM_DIR=$HOME/.nvm; . $NVM_DIR/nvm.sh; nvm use 23 >/dev/null; export CUDA_PATH=/usr/local/cuda-11.6; export CUDA_HOME=/usr/local/cuda-11.6; export CUDACXX=/usr/local/cuda-11.6/bin/nvcc; export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:${LD_LIBRARY_PATH:-}; export NODE_LLAMA_CPP_CMAKE_OPTION_CMAKE_CUDA_ARCHITECTURES=86; export NODE_LLAMA_CPP_GPU=cuda; qmd mcp'"
qmd-mcp-cli -h- If command conflict is detected and cannot be safely reused, stop and ask skill maintainers to pick another fixed command name.
- Confirm the daemon-backed stdio path is active:
uxc daemon statusuxc daemon sessions
- Inspect operation schema before execution:
qmd-mcp-cli query -hqmd-mcp-cli get -hqmd-mcp-cli multi_get -hqmd-mcp-cli status -h
- Prefer typed retrieval over CLI-style auto expansion:
- Start with using explicit
query/lex/vecsearcheshyde - Use or
getonly after narrowing candidatesmulti_get
- Start with
- 首先验证本地QMD索引:
qmd status- 在链接MCP之前,确认集合、向量数量和设备状态合理。
- 默认使用固定链接命令:
command -v qmd-mcp-cli- 如果该命令不存在且在当前shell中可正常运行:
qmduxc link --daemon-idle-ttl 0 qmd-mcp-cli "qmd mcp"
- 如果依赖
qmd、CUDA环境或其他shell配置,请显式包装命令:nvmuxc link --daemon-idle-ttl 0 qmd-mcp-cli "/bin/bash -lc 'export NVM_DIR=$HOME/.nvm; . $NVM_DIR/nvm.sh; nvm use 23 >/dev/null; export CUDA_PATH=/usr/local/cuda-11.6; export CUDA_HOME=/usr/local/cuda-11.6; export CUDACXX=/usr/local/cuda-11.6/bin/nvcc; export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:${LD_LIBRARY_PATH:-}; export NODE_LLAMA_CPP_CMAKE_OPTION_CMAKE_CUDA_ARCHITECTURES=86; export NODE_LLAMA_CPP_GPU=cuda; qmd mcp'"
qmd-mcp-cli -h- 如果检测到命令冲突且无法安全复用,请停止操作并联系技能维护人员选择其他固定命令名称。
- 确认基于守护进程的标准IO路径处于活跃状态:
uxc daemon statusuxc daemon sessions
- 执行前检查操作模式:
qmd-mcp-cli query -hqmd-mcp-cli get -hqmd-mcp-cli multi_get -hqmd-mcp-cli status -h
- 优先选择类型化检索而非CLI风格的自动扩展:
- 从使用显式/
lex/vec搜索的hyde开始query - 仅在缩小候选范围后使用或
getmulti_get
- 从使用显式
Recommended Usage Pattern
推荐使用模式
- Health check the index:
qmd-mcp-cli status
- Start with a fast explicit search payload:
qmd-mcp-cli query '{"searches":[{"type":"lex","query":"\"execution layer\" MCP CLI"},{"type":"vec","query":"What is the missing execution surface between MCP and CLI?"}],"collections":["workspace"],"limit":5,"intent":"Find the article explaining capability description, execution surface, and workflow orchestration"}'
- Retrieve the chosen file:
qmd-mcp-cli get file=workspace/public/mcp-is-not-the-problem/readme.md
- Use for a short candidate set only:
multi_getqmd-mcp-cli multi_get pattern='workspace/public/*.md,workspace/research/*.md' maxBytes=20480
- 检查索引健康状态:
qmd-mcp-cli status
- 从快速的显式搜索负载开始:
qmd-mcp-cli query '{"searches":[{"type":"lex","query":"\"execution layer\" MCP CLI"},{"type":"vec","query":"What is the missing execution surface between MCP and CLI?"}],"collections":["workspace"],"limit":5,"intent":"Find the article explaining capability description, execution surface, and workflow orchestration"}'
- 检索选定的文件:
qmd-mcp-cli get file=workspace/public/mcp-is-not-the-problem/readme.md
- 仅对少量候选集使用:
multi_getqmd-mcp-cli multi_get pattern='workspace/public/*.md,workspace/research/*.md' maxBytes=20480
Capability Map
能力映射
- Search:
query
- Retrieval:
getmulti_get
- Health:
status
- 搜索:
query
- 检索:
getmulti_get
- 健康检查:
status
Guardrails
防护规则
- Keep automation on JSON output envelope; do not rely on .
--text - Parse stable fields first: ,
ok,kind,protocol,data.error - Use as the default command path.
qmd-mcp-cli - is equivalent to
qmd-mcp-cli <operation> ...whenuxc "qmd mcp" <operation> ...already runs correctly in the current shell.qmd - If requires shell initialization or GPU env exports, use the same wrapped shell command in the link and any direct
qmdfallback.uxc "<host>" ... - Prefer explicit typed payloads over the standalone QMD CLI hybrid mode when latency matters.
query - Treat as the default fast path:
lex- exact names
- quoted phrases
- negation
- Add when the question is semantic but still bounded.
vec - Add only for nuanced or sparse topics; it is the most expensive query type.
hyde - Use to disambiguate ambiguous search terms instead of over-expanding the query text itself.
intent - Keep and
limitmodest for interactive use.candidateLimit - is recommended for QMD because the first heavy request may warm models and sessions; long-lived reuse makes repeated calls much faster.
--daemon-idle-ttl 0
- 自动化操作基于JSON输出信封;不要依赖参数。
--text - 优先解析稳定字段:、
ok、kind、protocol、data。error - 使用作为默认命令路径。
qmd-mcp-cli - 当在当前shell中可正常运行时,
qmd等效于qmd-mcp-cli <operation> ...。uxc "qmd mcp" <operation> ... - 如果需要shell初始化或GPU环境变量导出,请在链接命令和任何直接
qmd回退命令中使用相同的包装shell命令。uxc "<host>" ... - 当延迟很重要时,优先使用显式类型化负载,而非独立QMD CLI混合模式。
query - 将作为默认快速路径:
lex- 精确名称
- 带引号的短语
- 否定词
- 当问题具有语义但仍有边界时,添加搜索。
vec - 仅针对细微或稀疏主题添加搜索;这是成本最高的查询类型。
hyde - 使用消除模糊搜索词的歧义,而非过度扩展查询文本本身。
intent - 交互式使用时,保持和
limit适中。candidateLimit - 对于QMD,推荐使用,因为第一个重型请求可能会预热模型和会话;长期复用可大幅降低重复调用的延迟。
--daemon-idle-ttl 0
Notes
注意事项
- The first MCP request can still be slow while the daemon creates the stdio session and QMD warms model state.
uxc - Repeated calls through the same daemon session can drop sharply in latency once the session is warm.
uxc - This skill is best for local knowledge bases, notes, and markdown corpora already indexed by QMD.
- If you need the highest-quality but slowest retrieval path, you can still express it through with richer
queryarrays instead of shelling out to the standalone QMD CLI hybrid mode.searches
- 第一个MCP请求可能仍然较慢,因为守护进程正在创建标准IO会话,且QMD正在预热模型状态。
uxc - 一旦会话预热完成,通过同一守护进程会话的重复调用延迟会显著降低。
uxc - 此技能最适用于已由QMD索引的本地知识库、笔记和Markdown语料库。
- 如果需要最高质量但最慢的检索路径,仍可通过包含更丰富数组的
searches来实现,而非调用独立QMD CLI混合模式。query
References
参考资料
- Invocation patterns:
references/usage-patterns.md
- 调用模式:
references/usage-patterns.md