Skip to content

Plugin hook directs agents to mcp__lumen__semantic_search, but Claude Code registers the tool as mcp__plugin_lumen_lumen__semantic_search #176

Description

@avargaskun

Summary

When Lumen is installed as a Claude Code plugin, the SessionStart banner and the PreToolUse (Grep|Bash) reminder both tell the agent to call mcp__lumen__semantic_search. But Claude Code namespaces a plugin's MCP server as plugin_<pluginName>_<serverName>, so the tool is actually registered as mcp__plugin_lumen_lumen__semantic_search.

The result: an agent that follows the hook's own directive calls mcp__lumen__semantic_search, gets "No such tool available," and (in my case) fell back to grep/manual exploration for the rest of the session — which is exactly what the hook is trying to prevent.

Version: lumen v0.0.41 (latest), installed as a Claude Code plugin via the ory marketplace. Host: Claude Code.

Root cause

  1. .claude-plugin/plugin.json declares the server as "mcpServers": { "lumen": { … } } → server name lumen.
  2. Claude Code exposes a plugin's MCP tools under mcp__plugin_<pluginName>_<serverName>__*. With both names = lumen, the registered tool is mcp__plugin_lumen_lumen__semantic_search (confirmed — it's what appears in the agent's tool list, and what resolves).
  3. hooks/hooks.json invokes …/scripts/run hook session-start lumen --host claude (and pre-tool-use lumen), i.e. it passes mcpName = "lumen".
  4. cmd/hook.go sessionStartDirective() builds the directive from the bare name:
    // cmd/hook.go (~line 123, and again ~line 273 for pre-tool-use)
    toolRef := "mcp__" + mcpName + "__semantic_search"   // mcpName == "lumen"
    return "Call " + toolRef + " first for any code discovery task — before Grep, Bash, or Read."
    → emits mcp__lumen__semantic_search, which does not resolve under the plugin install.

The --host claude branch is already host-aware (the cursor branch special-cases its tool naming), but the claude branch doesn't account for the plugin_<name>_ prefix Claude Code applies to plugin-bundled MCP servers.

Impact

Every SessionStart and every Grep/Bash call re-emits a directive pointing at a non-existent tool name, so agents that trust it bounce off "No such tool available" and stop using semantic search. The feature becomes effectively undiscoverable via the plugin's own guidance.

Suggested fix

For --host claude, reference the plugin-namespaced tool, e.g. mcp__plugin_<pluginName>_<mcpServerName>__semantic_search (here mcp__plugin_lumen_lumen__semantic_search), instead of mcp__<mcpName>__semantic_search.

Minor extra note for the directive: under Claude Code this tool is deferred (it has to be loaded via the agent's tool-search step before the first call), so wording like "load and call mcp__plugin_lumen_lumen__semantic_search" would help.

Repro

  1. Install lumen as a Claude Code plugin (ory marketplace), v0.0.41.
  2. Start a session → SessionStart banner: "Call mcp__lumen__semantic_search first for any code discovery task…"
  3. Call mcp__lumen__semantic_search"No such tool available."
  4. The actually-registered tool is mcp__plugin_lumen_lumen__semantic_search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions