Bug
The MCP server (dist/mcp.js) fails to start with:
Error: Database path not set. Tests must set INDEX_PATH env var or use createStore() with explicit path.
This prevents tests from accidentally writing to the global index.
Root Cause
dist/store.js has a _productionMode flag (default false) that gates access to the default database path (~/.cache/qmd/index.sqlite). The CLI entrypoint (dist/qmd.js) calls enableProductionMode() at startup, but dist/mcp.js does not — so getDefaultDbPath() throws at line 334 instead of resolving the path.
Fix
One-line addition in mcp.js — import and call enableProductionMode() before createStore():
- import { createStore, extractSnippet, addLineNumbers, structuredSearch, DEFAULT_MULTI_GET_MAX_BYTES, } from "./store.js";
+ import { createStore, extractSnippet, addLineNumbers, structuredSearch, DEFAULT_MULTI_GET_MAX_BYTES, enableProductionMode, } from "./store.js";
+ enableProductionMode();
Environment
- qmd v0.1.0 (installed via Claude Code plugin system)
- Node.js on Linux (GitHub Codespace)
- CLI works fine (
qmd search resolves the path correctly)
- MCP server crashes on every invocation
Workaround
Either:
- Apply the patch above to
dist/mcp.js in the plugin cache
- Set
INDEX_PATH=~/.cache/qmd/index.sqlite in the environment before the MCP server starts
Bug
The MCP server (
dist/mcp.js) fails to start with:Root Cause
dist/store.jshas a_productionModeflag (defaultfalse) that gates access to the default database path (~/.cache/qmd/index.sqlite). The CLI entrypoint (dist/qmd.js) callsenableProductionMode()at startup, butdist/mcp.jsdoes not — sogetDefaultDbPath()throws at line 334 instead of resolving the path.Fix
One-line addition in
mcp.js— import and callenableProductionMode()beforecreateStore():Environment
qmd searchresolves the path correctly)Workaround
Either:
dist/mcp.jsin the plugin cacheINDEX_PATH=~/.cache/qmd/index.sqlitein the environment before the MCP server starts