You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Opencode calls an MCP tool it doesn't trigger the tool.execute.before and tool.execute.after hooks in the plugin system.
I'm not sure if there's a practical purpose for this but it makes it really difficult (impossible?) to attach session-level metadata to an mcp tool call or inject an argument or log the outputs effectively (altho we can listen to events for that).
It's also not intuitive that this wouldn't be the case. I'd expect either:
MCP tool calls trigger these hooks just like normal
There might be MCP specific hooks for plugins. This might be ideal because it would be nice to attach extra metadata to a request header or something beyond just the tool args.
I can open a PR if we think this would be useful, just curious if there's a reason why this isn't the behavior today
This issue might be a duplicate of existing issues. Please check:
Hooks for commands (Plugin Commands) #2185: Similar request for hooks for commands (plugin commands) - discusses adding hooks to capture commands before/after they're given to the LLM and allowing plugins to utilize commands
Hooks support? #1473: General hooks support request (closed) - discusses wanting hooks for automation after tasks end, though focused more on post-task automation rather than tool execution hooks specifically
Feel free to ignore if none of these address your specific case.
Activity
github-actions commentedon Aug 30, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Aug 30, 2025
Good callout, I will fix
OliverGilan commentedon Aug 30, 2025
That was fast lmao. Beast. Any chance we can get a release soon 🙏
rekram1-node commentedon Aug 30, 2025
the team hasn't done a releasse in a while so I expect they will do one very soon, idk when exactly
Fix: Block tools for superego eval session
Fix: Block tools for superego eval session
feat(v0.18.7): MCP safety rail, devcontainer drift fix, gh-pages hard…
docs(opencode): correct stale MCP-hook caveat (anomalyco/opencode#2319 …