Connect external agents (Claude Code or Codex in your terminal, ChatGPT, or any OAuth-capable MCP client) to your T3 Code environment over MCP to read projects/threads, launch and message threads, and monitor events.
Open the command palette (Cmd/Ctrl+K) and run Use T3 Code in another app (MCP) (or open Settings → Sharing & access), pick your app, and follow the prompts.
- Cloud assistants (like ChatGPT or Claude) require T3 Connect enabled on the environment.
- To also reach other machines through the same connection, enable Settings → Labs → Linked environments and link them.
- To copy the raw MCP endpoint (
https://<environment-address>/mcp), open an environment's menu in Settings → Environments → Copy MCP URL. OAuth requireshttps://orlocalhost(plainhttp://LAN/Tailscale addresses cannot complete OAuth).
- Claude Code:
claude mcp add --transport http t3 https://<environment-address>/mcp claude mcp login t3 # add --no-browser on headless hosts
- Codex:
codex mcp add t3 --url https://<environment-address>/mcp codex mcp login t3 # add --no-browser on headless hosts
- ChatGPT / other OAuth MCP clients: Add a custom remote MCP server pointing to
https://<environment-address>/mcpwith OAuth authentication (no client ID or secret needed).
The first time an outside agent connects, approve its sign-in page (via your T3 Connect account, an already-authorized browser, or a one-time pairing code from Settings → Sharing & access / t3 auth pairing create).
- Read only: Inspect projects, threads, providers, and models.
- Supervised → Full access: Also launch, message, and stop threads up to the granted permission mode. Managing workflow runs or using approval-skipping agent modes requires Full access (or your policy's maximum mode).
- Sign-ins last 30 days; revoke anytime in Settings → Sharing & access.
Tools that act as a running T3 thread (delegate_task, create_threads, request_secret, html_render, preview_*, device_*, t3_worktree_handoff) only work for agents running inside T3 Code.
- Use
t3_thread_launch+t3_thread_wait/t3_thread_readto run and follow work. - Pass
projectIdorthreadIdexplicitly (orallProjects: trueont3_thread_list). - MCP Events (
io.modelcontextprotocol/events): Bots can poll, stream, or subscribe via HTTPS webhooks (up to 1-hour leases; latest 1,000 milestones buffered in memory) for turn, approval, guest, PR watch, and workflow events. For local webhook testing, setT3CODE_MCP_WEBHOOK_ALLOWED_HOSTS=localhost,127.0.0.1on the server.
On the server machine itself, drive threads directly without OAuth:
id=$(t3 thread start . "Find why the tests are slow")
t3 thread send "$id" "Now fix it" --wait
t3 thread show "$id"
t3 thread list- Pass
--worktree <base-branch>,--title/--generate-title,--provider <id> --model <slug>,--option id=value(e.g.reasoningEffort=highfor Codex,effort=highfor Claude), or-to read the prompt from stdin. --waitprints the reply and exits1on failure/stop or2when waiting for user input. Add--jsonfor structured output including the thread ID.