Skip to content

fix: use plugin-qualified MCP tool names in hooks - #179

Merged
aeneasr merged 1 commit into
mainfrom
aeneasr/fix-issue-176
Aug 6, 2026
Merged

fix: use plugin-qualified MCP tool names in hooks#179
aeneasr merged 1 commit into
mainfrom
aeneasr/fix-issue-176

Conversation

@aeneasr

@aeneasr aeneasr commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes Claude Code plugin hook guidance to reference plugin-qualified semantic search MCP tool names and tells agents to load deferred tools before calling them.

Adds an optional --plugin-name flag so standalone CLI and Cursor behavior remain unchanged while bundled hooks pass lumen.

Extends hook tests to cover plugin-qualified and legacy tool references.

Closes #176.

Summary by CodeRabbit

  • New Features

    • Added plugin-aware hook configuration for session-start and pre-tool-use workflows.
    • Claude integrations now display correctly namespaced MCP tool references when a plugin is specified.
    • Hook commands now support identifying the associated plugin.
  • Bug Fixes

    • Improved tool reference formatting and session-start directives for plugin-based Claude setups.
    • Preserved existing behavior for standalone and Cursor integrations.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bfd83380-082d-4e7f-bf62-f09386f9ab13

📥 Commits

Reviewing files that changed from the base of the PR and between d0dee0e and 26e0fef.

📒 Files selected for processing (3)
  • cmd/hook.go
  • cmd/hook_test.go
  • hooks/hooks.json

📝 Walkthrough

Walkthrough

The hook commands now accept plugin names and generate Claude MCP references with the plugin namespace. Session-start directives and pre-tool-use suggestions use the shared reference builder. Tests cover plugin-qualified, standalone, Cursor, and JSON hook output.

Changes

Plugin-aware hook processing

Layer / File(s) Summary
Plugin-aware hook flow
cmd/hook.go, hooks/hooks.json
SessionStart and PreToolUse accept --plugin-name. The plugin name reaches session and tool evaluation. Claude directives use plugin-qualified MCP references. Hook configuration passes lumen.
Plugin-aware hook validation
cmd/hook_test.go
Tests cover MCP reference formatting, Claude session-start directives, semantic-search suggestions, non-search tools, and plugin-qualified hook output.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HookCommand
  participant MCPReferenceBuilder
  participant ClaudeCodeMCP
  HookCommand->>MCPReferenceBuilder: Build reference with plugin name
  MCPReferenceBuilder-->>HookCommand: Return plugin-qualified semantic_search reference
  HookCommand->>ClaudeCodeMCP: Emit directive or pre-tool-use suggestion
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aeneasr/fix-issue-176

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jonas-jonas jonas-jonas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also an into this, seems like it's a good fix

failures seem unrelated?

@aeneasr
aeneasr marked this pull request as ready for review August 6, 2026 12:11
@aeneasr
aeneasr merged commit f854abc into main Aug 6, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants