thedotmack/claude-mem · critical · Error

plugin/.mcp.json mcp-search launcher must include Claude cac

Error message

plugin/.mcp.json mcp-search launcher must include Claude cache fallback for hosts that do not inject PLUGIN_ROOT

What it means

Twin of [14] for the Claude host: the joined mcp-search command must contain 'plugins/cache/thedotmack/claude-mem'. This is the Claude Code marketplace cache fallback for hosts that don't inject PLUGIN_ROOT. Missing it breaks mcp-search under Claude Code.

Source

Thrown at scripts/build-hooks.js:749

      }
    }
    for (const eventName of Object.keys(codexHooks.hooks ?? {})) {
      if (!validCodexHookEvents.has(eventName)) {
        throw new Error(`plugin/hooks/codex-hooks.json contains unknown Codex hook event: ${eventName}`);
      }
    }
    const codexMarketplace = JSON.parse(fs.readFileSync('.agents/plugins/marketplace.json', 'utf-8'));
    const claudeMemMarketplaceEntry = (codexMarketplace.plugins ?? []).find((plugin) => plugin.name === 'claude-mem');
    if (claudeMemMarketplaceEntry?.source?.path !== './plugin') {
      throw new Error('.agents/plugins/marketplace.json must point claude-mem source.path at ./plugin so Codex loads the bundled plugin root');
    }
    const bundledMcp = JSON.parse(fs.readFileSync('plugin/.mcp.json', 'utf-8'));
    const mcpSearchCommand = bundledMcp.mcpServers?.['mcp-search']?.args?.join(' ') ?? '';
    if (!mcpSearchCommand.includes('.codex/plugins/cache/claude-mem-local/claude-mem')) {
      throw new Error('plugin/.mcp.json mcp-search launcher must include Codex cache fallback for hosts that do not inject PLUGIN_ROOT');
    }
    if (!mcpSearchCommand.includes('plugins/cache/thedotmack/claude-mem')) {
      throw new Error('plugin/.mcp.json mcp-search launcher must include Claude cache fallback for hosts that do not inject PLUGIN_ROOT');
    }
    console.log('✓ All required distribution files present');

    await verifyShellTemplateCanonical();

    console.log('\n✅ All build targets compiled successfully!');
    console.log(`   Output: ${hooksDir}/`);
    console.log(`   - Worker: worker-service.cjs`);
    console.log(`   - Server: server-service.cjs`);
    console.log(`   - MCP Server: mcp-server.cjs`);
    console.log(`   - Context Generator: context-generator.cjs`);
    console.log(`   - Transcript Watcher: transcript-watcher.cjs`);
    console.log(`   Output: ${npxCliOutDir}/`);
    console.log(`   - NPX CLI: index.js`);
    if (fs.existsSync('openclaw/dist/index.js')) {
      console.log(`   Output: openclaw/dist/`);
      console.log(`   - OpenClaw Plugin: index.js`);
    }

View on GitHub (pinned to d768ba3643)

Solutions

  1. Restore the 'plugins/cache/thedotmack/claude-mem' fragment in the mcp-search launcher in plugin/.mcp.json.
  2. If generator-produced, ensure src/build/hook-shell-template.ts emits the Claude cache fallback branch, then run node scripts/build-hooks.js --write-shell-templates.
  3. Re-run the build; the check at scripts/build-hooks.js:748-751 must pass.

Example fix

// before: launcher lacks the Claude cache fallback
"args": ["...", "exec \"$PLUGIN_ROOT/mcp-search\""]

// after: also try the Claude marketplace cache
"args": ["...", "... || exec \"plugins/cache/thedotmack/claude-mem/mcp-search\""]
Defensive patterns

Strategy: validation

Validate before calling

const mcp = JSON.parse(fs.readFileSync('plugin/.mcp.json','utf8'));
const cmd = (mcp.mcpServers?.['mcp-search']?.args ?? []).join(' ');
if (!cmd.includes('plugins/cache/thedotmack/claude-mem')) {
  throw new Error('mcp-search launcher missing Claude cache fallback');
}

Try / catch

// Build-time only. Restore the Claude cache-fallback fragment, or regenerate via
// --write-shell-templates after fixing the generator.

Prevention

When it happens

Trigger: Editing the mcp-search launcher and dropping the Claude cache fallback fragment. Generator change that no longer emits the thedotmack cache path.

Common situations: Same as [14] — simplifying the launcher, assuming PLUGIN_ROOT is always present, or removing cache fallback branches.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d768ba3643 (2026-08-12). Data as JSON: /api/errors/99526819ac5c5283. Report an issue: GitHub.