Repository navigation
MCP profiles: T3 tool groups on T3's MCP server, for every provider - #827
Conversation
MCP profile design PR 4. A profile's t3Tools now applies: one global rule on T3's MCP server hides a T3 tool outside the calling thread's groups from tools/list, refuses it on tools/call with a plain reason and its fix, and keeps it out of tool_search. The groups are fixed as each turn starts (Claude: as its query opens; other providers: the turn check), so a running turn keeps its set and a change applies from the next turn. A profile that cannot be worked out, or a thread T3 cannot read, keeps only request_secret, send_to_user and tool_search. Claude no longer refuses a profile whose t3Tools is a list, and a group change gives its next turn a fresh process. Off Claude, a turn now refuses only a profile that leaves out an outside server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…up is refused as a T3 bug - personOnlySettings.test.ts: the T3 tool filter's table must hold exactly the toolkit folders' tools, each in its folder's group, and every group of MCP_T3_TOOL_GROUPS must have a tool there. Dropping a toolkit from the filter's hand list, or adding a group with no toolkit, fails CI. - A tool in no group is still refused by any profile but all, but its refusal now says it is a T3 bug to report, not a setting to change. - docs/fork: profiles are not a sandbox (requests with no thread, such as the t3 thread CLI, are not filtered); the sets live per thread, not per credential. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n check Main gained MCP part 5 (Codex applies a profile's outside servers) and the playtest tool. The turn check now fixes the thread's T3 tool set on every provider except Claude (whose adapter fixes its own), and refuses a profile that leaves out outside servers only on providers that cannot apply them. Codex no longer refuses a narrowed t3Tools: T3's own MCP server cuts the tools per thread, and every Codex turn, including the ones Codex starts itself, fixes the set first. The playtest tool keeps its own group. Part of #814. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…widths Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: security · reviewer: lens agent (Opus 5.5) · read at: 5084fd5
|
|
lens: state · reviewer: lens agent (Opus, lens B correctness + state) · read at: 5084fd5 |
MCP profile design PR 4 (code; step 2 after the announce PR #806). Part of #814.
What and why
A profile's
t3Toolsnow applies, for every provider. One global rule on T3's MCP server:tools/list;tool_searchbefore ranking, so a search never finds or loads a tool the thread cannot call;tools/callwith a plain reason and its fix (ask the user to add the group). Alias, case-changed or padded names do not match; a JSON-RPC batch with a refused call is refused whole.The groups are fixed as each turn starts (Claude: as its query opens; other providers: turn start, resume and compaction through the turn check), so a running turn keeps its set and a change applies from the next turn. Fails closed: a missing or broken profile, an unreadable parent or a deleted thread keeps only
request_secret,send_to_userandtool_search. A child is never wider than its parent.Claude and Codex no longer refuse a profile whose
t3Toolsis a list, and a Claude group change gives its next turn a fresh process. On any other provider, a turn refuses only a profile that leaves out an outside server.After the fix round (#806 lenses): a drift test holds the filter's table to exactly the toolkit folders' tools, each in its folder's group, and every group of
MCP_T3_TOOL_GROUPSmust have a tool there (dropping a toolkit or adding an empty group fails CI). A tool in no group is still refused by any profile butall, and its refusal says it is a T3 bug to report. docs/fork: profiles are not a sandbox (requests with no thread, such as the t3 thread CLI, are not filtered); the sets live per thread.Up to date with main: the turn-check split (#814 item 1)
Main now has #826 (Codex applies a profile's outside servers) and #809 (the
playtesttool). This PR merged main (merge commits, no rebase) and does the split #814 asks for:mcpProfileTurnCheckfixes the thread's T3 tool set on every driver except Claude (Claude's adapter fixes its own as its query opens, unchanged). It refuses a profile that leaves out an outside server only on drivers not inMCP_PROFILE_DRIVERS. So a Codex turn (start, resume, compaction) is now checked: its set is fixed, and its outside servers are left to Codex.t3Toolsother thanall" guard is lifted. Why it is safe: T3 tools are cut on T3's own MCP server by the thread's credential (both of T3's Codex servers send it), not by Codex config, so a narrowedt3Toolsneeds nothing from Codex. Every turn T3 starts fixes the set through the turn check, and every turn Codex starts itself (a goal's next turn, a sub-agent turn, which uses its parent's T3 thread) fixes it onturn/startedincodexMcpProfile. With no set fixed (for example after a restart), the filter works it out from settings and fails closed.playtestkeeps its own group (playtest), is inall, and is not inwaits; the filter test now provides the playtest service main's MCP server needs.New tests: a Codex thread with a narrowed
t3Toolsgets exactly that set on start, resume and compaction, while OpenCode (outsideMCP_PROFILE_DRIVERS) refuses the same profile's outside servers; Claude's turn check fixes no set; a profile change applies from the next turn; a profile that is gone refuses on Codex and OpenCode and keeps only the ungrouped tools; Codex loads a profile that limits only T3 tools with no extra config and fixes its set onturn/started. Without the split, 4 of the turn-check tests fail.State question:
turn/started) fixes the new one.allas before, with no extra Codex requests or config.Tests
On this head: server typecheck clean;
mcpProfileTurnCheck,codexMcpProfile,mcpT3ToolFilter,claudeMcpProfile,personOnlySettingsandholdWork.boottests pass (154).vp fmt --check, lint and knip pass. Seam check: only the pinned seams (the twoMcpToolExposure.tslines announced in #806 move from announced to added). Before the merge: 85 files / 1585 tests passed; 6 of 9 new transport tests fail on the old code; 15 fix lines each turn a test red when removed. Fork lines inMcpHttpServer.tsstay at 10.Limits: a non-Claude provider may keep an old tool list until it lists again (the call is still refused). A Codex sub-agent's
turn/startedfixes its parent's set again. Delegating to a non-Claude provider on another machine refuses any profile narrower thanall.General vs project
General: T3's own MCP server and the profile rules; no project facts.
Upstream fit
Builds on upstream's MCP server,
tool_searchand toolkit registration; two pinned lines inMcpToolExposure.ts, everything else in fork files.MCP profile design row PR 4.
🤖 Generated with Claude Code