**Summary**: MCP tools currently bypass OpenCode's permission system while built-in tools require approval. Add permission control for MCP tools. ## Problem Currently, MCP (Model Context Protocol) tools completely bypass OpenCode's permission system: **Built-in tools** (have permission checks): ```typescript await Permission.ask({ type: "bash", pattern: patterns, sessionID: ctx.sessionID, ... approval flow }) ``` **MCP tools** (bypass permission system): In packages/opencode/src/session/prompt.ts ``` typescript for (const [key, item] of Object.entries(await MCP.tools())) { item.execute = async (args, opts) => { NO Permission.ask() here! await Plugin.trigger("tool.execute.before", ...) const result = await execute(args, opts) await Plugin.trigger("tool.execute.after", ...) return { output } } } ``` ## Security Concerns • No user control: MCP tools can execute without approval • Inconsistent security: Built-in tools require approval, MCP tools don't • Potential abuse: Malicious MCP servers could perform harmful actionsl
Activity
rekram1-node commentedon Sep 23, 2025
totally agree
rekram1-node commentedon Sep 23, 2025
this will be done as part of: #1961