Problem
The MCP language_help tool always returns {"topics":[]} in the published package (@malloydata/cli 0.0.55, also on next). Every lookup fails with No topic matches '<x>'. All other MCP tools (compile, compile_file, run, run_file, prettify) work fine.
language_help() -> {"topics":[]}
language_help("joins") -> {"error":"No topic matches 'joins'."}
Root cause
language_help loads malloy-language-reference.md via skillsDir() in src/mcp/skills.ts:
const candidates = [
path.join(__dirname, '..', 'skills'),
path.join(__dirname, '..', '..', 'skills'),
];
The published bundle is dist/cli.js, so at runtime __dirname is <pkg>/dist and the candidates resolve to <pkg>/skills and <pkg>/../skills — neither exists. The build actually ships the reference inside dist, at <pkg>/dist/skills/malloy-language-reference.md (confirmed in the 0.0.55 tarball). So fs.existsSync is false, the text is empty, no ## headers are parsed, and an empty topic list is cached.
Fix
Add the published location to the candidates:
const candidates = [
path.join(__dirname, 'skills'), // dist/skills — published layout
path.join(__dirname, '..', 'skills'),
path.join(__dirname, '..', '..', 'skills'),
];
Environment
@malloydata/cli 0.0.55 (also next), run as an MCP server via npx --package @malloydata/cli malloy-cli -- ... mcp.
Problem
The MCP
language_helptool always returns{"topics":[]}in the published package (@malloydata/cli0.0.55, also onnext). Every lookup fails withNo topic matches '<x>'. All other MCP tools (compile,compile_file,run,run_file,prettify) work fine.Root cause
language_helploadsmalloy-language-reference.mdviaskillsDir()insrc/mcp/skills.ts:The published bundle is
dist/cli.js, so at runtime__dirnameis<pkg>/distand the candidates resolve to<pkg>/skillsand<pkg>/../skills— neither exists. The build actually ships the reference inside dist, at<pkg>/dist/skills/malloy-language-reference.md(confirmed in the 0.0.55 tarball). Sofs.existsSyncis false, the text is empty, no##headers are parsed, and an empty topic list is cached.Fix
Add the published location to the candidates:
Environment
@malloydata/cli0.0.55 (alsonext), run as an MCP server vianpx --package @malloydata/cli malloy-cli -- ... mcp.