Skip to content

feat(native): T3 Code tools reach Codex and Claude Code under plugin-only MCP policies - #1

Open
zrm625 wants to merge 8 commits into
mainfrom
pyre/installable-mcp-plugin
Open

zrm625 wants to merge 8 commits into
mainfrom
pyre/installable-mcp-plugin

Conversation

@zrm625

@zrm625 zrm625 commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Some workplaces run admin policies that allow MCP servers only from approved plugins (Codex's requirements.toml, Claude Code's managed settings). Under them, Codex and Claude refuse the MCP server T3 Code gives each thread, so those threads have no T3 Code tools.

This adds native/t3-mcp-plugin: a T3 Code plugin for both CLIs, plus two small wrappers, t3-codex and t3-claude, that an admin sets as the provider's binary path. The wrapper takes T3 Code's server out of the thread's config before the CLI sees it, and the plugin's server sends each tool call to T3 Code with that thread's own credential. Credentials, scopes, approvals and tool names work as they do today. Details, including how the credential is kept from agents, are in the crate's README.

The one server change is optional: T3CODE_MCP_SOCKET also serves /mcp on an owner-only Unix socket, for machines that block MCP over loopback TCP. apps/server/src/mcp/mcpPlugin.test.ts fails if T3 Code changes how it hands its server to Codex or Claude.

Validation: vp run check:changed and cargo test pass, and clippy is clean for Linux, macOS and Windows. On Linux with each policy in place, real Codex (Luna) and Claude Code (Haiku) turns used T3 Code tools through the plugin, including an approval prompt, a subagent and a credential rotation; without the wrappers, both CLIs had no T3 Code tools. macOS and Windows are type-checked only, and release builds don't package the binaries yet.

Implemented with Claude Opus 5.5 in Claude Code, through T3 Code.

Some workplaces deploy a Codex admin policy that allows MCP servers only
from approved plugins. That policy refuses the MCP servers T3 Code puts in
each thread's config, so Codex threads lose every T3 Code tool.

t3-codex fixes this without changing how T3 Code talks to Codex. T3 Code's
Codex binary path points at it. It runs the real app-server, moves T3 Code's
per-thread servers out of thread config, and serves them through a T3 Code
plugin whose bridge pipes to it. Each tool call still uses the calling
thread's own credential; subagents act as their parent thread.

T3 Code also gains an opt-in T3CODE_MCP_SOCKET that serves /mcp, and only
/mcp, on an owner-only Unix socket for hosts that forbid loopback MCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T04:50:38.466398Z 5d28226 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 7, 2026
The same plugin-only policies exist for Claude Code: they refuse the MCP
server T3 Code adds through the Agent SDK's setMcpServers, so Claude
threads lose T3 Code's tools too.

The crate becomes t3-mcp-plugin and builds t3-codex and t3-claude. T3
Code's Claude binary path points at t3-claude, which moves the t3-code
server out of mcp_set_servers (also on rotation) and serves it through the
plugin. Claude runs one process per thread, so every call uses that
thread's credential. Claude names plugin tools differently, so t3-claude
maps them back to mcp__t3-code__* for T3 Code's allowed tools, approvals
and tool rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zrm625 zrm625 changed the title feat(native): T3 Code tools reach Codex under plugin-only MCP policies feat(native): T3 Code tools reach Codex and Claude Code under plugin-only MCP policies Nov 7, 2026
zrm625 and others added 6 commits November 7, 2026 13:09
The socket now shares the main router through one HttpServer instead of
passing raw requests along with emit("request"). Startup checks use
FileSystem and a typed McpSocketError.

Model: Claude Opus 5.5 (claude-opus-5-5), harness: Claude Code in T3 Code.
Model: Claude Opus 5.5 (claude-opus-5-5), harness: Claude Code in T3 Code.
Model: Claude Opus 5.5 (claude-opus-5-5), harness: Claude Code in T3 Code.
Drops tests of a case T3 Code never produces, trivial parsing checks,
and a wall-clock wait. The Codex and Claude rewrites are each tested
once, message in to message out. The test-only Stdin constructor goes:
pending replies are their own type. The socket module follows the
server's Effect style.

Model: Claude Opus 5.5 (claude-opus-5-5), harness: Claude Code in T3 Code.
Runs T3 Code's real codexThreadRuntimeParams and claudeMcpQueryOverrides
against fixtures the Rust wrappers parse, and checks the plugin's server
settings against them. Unrelated thread config changes don't affect it.

Model: Claude Opus 5.5 (claude-opus-5-5), harness: Claude Code in T3 Code.
…'s helpers

T3_MCP_SOCKET read too much like T3 Code's T3CODE_MCP_SOCKET, so the
wrapper's bridge channel is now T3_MCP_BRIDGE. One lock helper and one
runtime builder replace the copies in each module, and an error shared by
both wrappers no longer names t3-codex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 06cf619.

This comment will update automatically after the next completed run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant