Skip to content

Latest commit

 

History

History
198 lines (158 loc) · 9.16 KB

outside-agents.md

File metadata and controls

198 lines (158 loc) · 9.16 KB

Outside agents

Agents that T3 Code did not start can work with an environment through its MCP server. They can read projects and threads, start and message threads, and check which providers and models are available. This covers Claude Code or Codex in your own terminal, ChatGPT, and bots that support MCP. Each agent signs in once, and you choose what it may do.

Add T3 Code to an assistant app

Open the command palette (Cmd/Ctrl+K) and choose Use T3 Code in another app (MCP), or use the button in Settings → Sharing & access. Pick the app and follow the step for that app. Assistants like Poke and Claude run in the cloud, so the wizard first asks you to sign in to T3 Connect and turn it on for the environment. To reach your other machines through the same connection, turn on Linked environments in Labs and link them.

When the app opens the sign-in page, choose what it may do and approve with your T3 Connect account. On an older environment, the wizard asks for the level and gives you a code to paste instead. A code works once, for 5 minutes, and approves only that level.

For an app that is not listed, choose Something else…, add a remote MCP server with OAuth in that app, and paste the URL. Apps that require their own client ID cannot connect.

Get the MCP URL

In Settings → Environments, open a saved environment's menu and choose Copy MCP URL. The URL is the environment's address followed by /mcp, for example:

https://<environment-address>/mcp

When T3 Connect serves the environment, the copied URL is its T3 Connect address, which agents can reach from anywhere. Otherwise it uses the route this device is connected over, so an agent on the same device can reach it.

  • An agent on your own computers can use localhost on the host, T3 Connect, or any https address, such as Tailscale HTTPS. Signing in sends the agent's credentials to the environment, and agents only do that over https or to localhost. A plain-http LAN or Tailscale address, like http://100.x.y.z:3773, lets an agent find the environment but not finish signing in.
  • A hosted agent, such as ChatGPT or a bot running in the cloud, must reach the environment from the internet. Use the T3 Connect address. A Tailscale address only works from your own tailnet.

Approve a sign-in

The first time an agent connects, it opens a sign-in page. When the agent reaches the environment through T3 Connect, the page opens on the T3 Code web app: sign in with the T3 Connect account the environment is linked to and approve there, without a code. Otherwise the page opens on the environment. Either page names the agent and where its access goes:

  • For an agent on your computer, approval returns to a localhost address on the computer that opened the page.
  • For a hosted agent, approval goes to that service, such as chatgpt.com. Anyone who runs that service gets the access.

Only approve a sign-in you just started. On the environment's own page, enter a code from Use T3 Code in another app (MCP), Settings → Sharing & access, or t3 auth pairing create on the host. A browser already signed in to the environment with permission to manage access can approve without a code. On the web app, Use a sign-in code instead opens the environment's own page.

A code from Use T3 Code in another app (MCP) already carries the level you picked there. With another code, choose what the agent may do here: Auto is selected by default, or the closest lower mode allowed by your organization’s policy. Approving without a code starts at Read only:

  • Read only lets the agent read projects and threads and see the available providers and models. It cannot change anything.
  • Supervised through Full access also let it start, message and stop threads in every project. A thread it starts or steers cannot run with more permissions than the mode you chose. Workflow runs choose their own modes, so only Full access (or the highest mode your organization's policy allows) can start, answer, resume or cancel them, change what workflows store, or read webhook paths. Lower modes can still read runs.

What outside agents can call

Some tools only work for an agent running inside a T3 thread, because they act as that thread: subagents, secret requests, rendered HTML, the browser preview, devices, and worktree handoff. They still appear in an outside agent's tool list, but calling one returns an error saying it needs an agent running inside T3 Code.

  • To hand off work, start a thread with t3_thread_launch, then follow it with t3_thread_wait or t3_thread_read, instead of create_threads or delegate_task.
  • Tools that default to the caller's own project or thread need an explicit projectId or threadId.
  • To list threads across projects, call t3_thread_list with allProjects: true, or use t3_thread_search.

Claude Code

claude mcp add --transport http t3 https://<environment-address>/mcp
claude mcp login t3

claude mcp login opens the sign-in page in your browser. On a machine without a browser, add --no-browser, open the printed URL elsewhere, and paste the final URL back when asked. claude mcp list shows t3 as connected once you approve.

Codex

codex mcp add t3 --url https://<environment-address>/mcp
codex mcp login t3

codex mcp login --no-browser prints the sign-in URL instead of opening it. codex mcp list shows t3 with OAuth once you approve.

ChatGPT

Add the environment as a custom MCP app in ChatGPT's apps settings:

  1. Create a new app or plugin with a custom MCP server.
  2. Set the server URL to https://<environment-address>/mcp, using the T3 Connect address.
  3. Choose OAuth for authentication. ChatGPT discovers the rest; you do not need a client ID or secret.
  4. Create the app, then approve the sign-in page that opens.

Other agents and bots

Any agent that supports remote MCP servers over HTTP with OAuth can connect. Give it the MCP URL and choose OAuth, and the agent finds the sign-in settings itself. Agents without OAuth support cannot connect.

A bot that supports MCP Events (io.modelcontextprotocol/events) can learn when something happens without reading threads over and over: a turn ended, an agent waits on a person, a guest asked something, a watched pull request woke its thread. Workflow runs are events too: a run started, paused, resumed or ended, or waits on a person. A bot can poll, stream, or receive each event type by webhook, narrowed to projects and threads or to workflows and runs; runs another run started are left out unless asked for, as subagent threads are, and narrowing thread events to a run picks out its agent steps. The environment keeps its latest 1,000 milestones in memory, so a bot that was away longer, or reconnects after a restart, is told some may be missing and should reread what it cares about. Webhooks go only to public https addresses, a subscription lasts at most an hour before the bot must renew it, and signing the bot out ends its subscriptions. To test with a receiver on your own machine or network, start the environment with T3CODE_MCP_WEBHOOK_ALLOWED_HOSTS set to its host names, for example localhost,127.0.0.1; those hosts may also use plain http.

Scripts on the host

On the machine that runs the environment, t3 thread uses the same tools without a sign-in:

id=$(t3 thread start . "Find why the tests are slow" --tag perf)
t3 thread send "$id" "Now fix it" --wait
t3 thread show "$id"
t3 thread list
t3 thread untag "$id" perf
t3 thread working-on "$id" "Slow test suite"

. means the project that contains the current folder, or a git worktree of its repository; a project id also works. A new thread uses the project's default model and permission mode, and runs in the project folder unless you pass --worktree <base-branch>. Its title is the message's first line, or --title; add --generate-title to have it named from the message, as threads started in the app are. send never interrupts: a busy thread gets the message as its next turn. Pass - as the message to read it from stdin. Repeat --tag to tag a new thread; t3 thread tag and t3 thread untag take a thread id and one or more tags.

To choose the model, pass --provider <instance-id> --model <slug>. Add --option id=value for each model option. For reasoning effort, Codex uses --option reasoningEffort=high, while Claude uses --option effort=high. Option ids and allowed values depend on the provider and model; use those reported by orchestrator_capabilities. true and false set on/off options.

working-on sets the line shown with the thread's title; --clear removes it.

--wait prints the agent's reply. It exits 1 when the run fails or stops, and 2 when the agent waits for an answer you give in the app. Add --json for a result that always includes the thread id.

Remove an agent

Approved agents appear under Settings → Sharing & access like other clients. Revoke one there to cut off its access immediately. A sign-in lasts 30 days; after that the agent asks you to approve it again.