1# Outside agents
2
3Agents that T3 Code did not start can work with an environment through its MCP
4server. They can read projects and threads, start and message threads, and
5check which providers and models are available. This covers Claude Code or
6Codex in your own terminal, ChatGPT, and bots that support MCP. Each agent signs
7in once, and you choose what it may do.
8
9## Get the MCP URL
10
11In **Settings → Connections**, open a saved environment's menu and choose
12**Copy MCP URL**. The URL is the environment's address followed by `/mcp`, for
13example:
14
15```text
16https://<environment-address>/mcp
17```
18
19The copied URL uses the route this device is connected over, so an agent on the
20same device can reach it.
21
22- **An agent on your own computers** can use any address that computer reaches
23 the environment at: a LAN or Tailscale address, T3 Connect, or `localhost` on
24 the host. See [remote access](./remote-access.md).
25- **A hosted agent**, such as ChatGPT or a bot running in the cloud, must reach
26 the environment from the internet. Use the T3 Connect address. A Tailscale
27 address only works from your own tailnet.
28
29## Approve a sign-in
30
31The first time an agent connects, it opens a sign-in page on the environment.
32The page names the agent and where its access goes:
33
34- For an agent on your computer, approval returns to a `localhost` address on
35 the computer that opened the page.
36- For a hosted agent, approval goes to that service, such as `chatgpt.com`.
37 Anyone who runs that service gets the access.
38
39Only approve a sign-in you just started. To approve, enter a pairing code from
40**Settings → Connections** or from `t3 auth pairing create` on the host. A
41browser already signed in to the environment as an administrator can approve
42without a code.
43
44Then choose what the agent may do:
45
46- **Read only** is the default. The agent can read projects and threads and see
47 the available providers and models. It cannot change anything.
48- **Supervised** through **Full access** also let it start, message and stop
49 threads in every project. A thread it starts or steers cannot run with more
50 permissions than the mode you chose.
51
52## Claude Code
53
54```sh
55claude mcp add --transport http t3 https://<environment-address>/mcp
56claude mcp login t3
57```
58
59`claude mcp login` opens the sign-in page in your browser. On a machine
60without a browser, add `--no-browser`, open the printed URL elsewhere, and
61paste the final URL back when asked. `claude mcp list` shows `t3` as connected
62once you approve.
63
64## Codex
65
66```sh
67codex mcp add t3 --url https://<environment-address>/mcp
68codex mcp login t3
69```
70
71`codex mcp login --no-browser` prints the sign-in URL instead of opening it.
72`codex mcp list` shows `t3` with OAuth once you approve.
73
74## ChatGPT
75
76Add the environment as a custom MCP app in ChatGPT's apps settings:
77
781. Create a new app or plugin with a custom MCP server.
792. Set the server URL to `https://<environment-address>/mcp`, using the T3
80 Connect address.
813. Choose **OAuth** for authentication. ChatGPT discovers the rest; you do not
82 need a client ID or secret.
834. Create the app, then approve the sign-in page that opens.
84
85## Other agents and bots
86
87Any agent that supports remote MCP servers over HTTP with OAuth can connect. Give
88it the MCP URL and choose OAuth, and the agent finds the sign-in settings itself.
89Agents without OAuth support cannot connect.
90
91## Remove an agent
92
93Approved agents appear under **Settings → Connections** like other clients.
94Revoke one there to cut off its access immediately. A sign-in lasts 30 days;
95after that the agent asks you to approve it again.