Skip to content

Commit 9f0fa23

Browse files
fix(server): ask before Claude uses a Settings → Tools server in modes that ask
The user's servers were added to Claude's allowedTools, which skips the permission prompt in approval-required and auto-accept sessions. Full access already runs them without asking, so the allow rule only bypassed the modes that ask. Their tools now go through the session's approval. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 35a5d4f commit 9f0fa23

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ describe("ClaudeAdapterV2 MCP query overrides", () => {
669669
});
670670
// The secret reaches the child's environment, never `--mcp-config`.
671671
assert.deepEqual(overrides, {
672-
allowedTools: [ClaudeAdapterV2.CLAUDE_T3_MCP_TOOL_WILDCARD, "mcp__supabase__*"],
672+
// Its tools go through the session's approval like any other tool.
673+
allowedTools: [ClaudeAdapterV2.CLAUDE_T3_MCP_TOOL_WILDCARD],
673674
mcpServers: {
674675
supabase: {
675676
type: "stdio",
@@ -682,11 +683,6 @@ describe("ClaudeAdapterV2 MCP query overrides", () => {
682683
sdkSettings: { skillOverrides: { "grill-me": "off" } },
683684
mcpEnvironment: { T3_MCP_SECRET_0: "token", ...T3_MCP_ENVIRONMENT },
684685
});
685-
// Read-only sandboxes keep the user's servers behind the permission prompt.
686-
assert.deepEqual(
687-
ClaudeAdapterV2.claudeMcpQueryOverrides({ mcpSession, readOnlySandbox: true }).allowedTools,
688-
ClaudeAdapterV2.CLAUDE_READ_ONLY_T3_MCP_ALLOWED_TOOLS,
689-
);
690686
// A repeated name maps to one reference holding its last value.
691687
const repeated = ClaudeAdapterV2.claudeMcpQueryOverrides({
692688
mcpSession: {

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -994,17 +994,11 @@ export function claudeMcpQueryOverrides(input: {
994994
const mcpAllowedTools = input.readOnlySandbox
995995
? CLAUDE_READ_ONLY_T3_MCP_ALLOWED_TOOLS
996996
: [CLAUDE_T3_MCP_TOOL_WILDCARD];
997-
// Servers the user added in T3 are trusted like T3's own: their tools are
998-
// pre-approved outside read-only sandboxes, where the permission prompt
999-
// still decides.
1000-
const userAllowedTools = input.readOnlySandbox
1001-
? []
1002-
: tools.servers.map((server) => `mcp__${server.name}__*`);
997+
// The user's servers are not pre-approved: full access already skips the
998+
// prompt, so an allow rule would only bypass the modes that ask to approve.
1003999
const userServers = claudeUserMcpServers(tools.servers);
10041000
return {
1005-
allowedTools: Array.from(
1006-
new Set([...(input.allowedTools ?? []), ...mcpAllowedTools, ...userAllowedTools]),
1007-
),
1001+
allowedTools: Array.from(new Set([...(input.allowedTools ?? []), ...mcpAllowedTools])),
10081002
mcpServers: {
10091003
...userServers.mcpServers,
10101004
"t3-code": {

0 commit comments

Comments
 (0)