fix(mcp): recommend direct mcp__* tool calls instead of mcptool CLI#77
fix(mcp): recommend direct mcp__* tool calls instead of mcptool CLI#77cantalupo555 wants to merge 1 commit into
Conversation
|
Thanks for putting this together, I appreciate you taking a proper crack at it. I had a good look at this today. I agree with the direction, but I don’t think this is quite as low-risk as it looks from the outside. The tricky bit is that this touches a few sensitive paths at once: mcp routing, opencode permissions, cursor-agent tool behaviour, plugin tool hooks, and schema fallback. When I rebased it locally, a few existing tests also started failing, which is usually a sign that we need to slow down and split the change up a bit. So I’m not comfortable merging this as-is yet. I think we need some deeper testing around the permission behaviour first, and probably one or two smaller follow-up PRs so we can separate the actual mcp routing fix from the broader tool/schema changes. Appreciate the PR though, there’s good work in here and I do want to keep moving on this carefully. |
2c1eb8e to
766617c
Compare
|
Thanks for the review and for the clear guidance on keeping the scope minimal. Following your suggestion, I reduced the PR to the smallest possible change:
I tested the change locally with real usage:
Because the pure prompt change is not sufficient to fully close the permission bypass on file operations, I'm considering a hybrid approach for a follow-up PR:
This would be a separate, focused PR. Would you be open to exploring a hybrid approach in a follow-up, or do you have a different preference on how to handle the remaining read/write permission bypass? Happy to adjust based on your feedback. |
766617c to
27208dc
Compare
- Export MCP_TOOL_PREFIX constant - Update system message to instruct models to use direct MCP tool calls - Adjust corresponding test
27208dc to
31c795e
Compare
Summary
Minimal change to address the MCP permission bypass vulnerability (#74) by updating the system message to instruct the model to use direct tool calls (
mcp__<server>__<tool>) instead of themcptoolCLI via shell.Why this scope?
After review feedback, this PR was reduced to the smallest possible change that moves in the right direction. The original broader PR included schema fallback, tool hook changes, and edit→write rerouting — all deferred to follow-up PRs per maintainer request.
Changes
MCP_TOOL_PREFIXconstant fromsrc/mcp/tool-bridge.tssrc/plugin.tsto recommend directmcp__*calls instead ofmcptoolvia shellTest Results
Local testing confirmed:
lsandgrep(MCP tools) work reliably via directmcp__*callsThis validates that first-class MCP tool calls are viable for several tools, but a follow-up PR with a hybrid approach (prompt + backend interception layer) is needed to fully close the permission bypass for file operations.
Related
Addresses #74