# feat\(server\): link to another environment · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/e13f1d4556882544f8d0d68766d19cb6db0528f5)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: e13f1d4556882544f8d0d68766d19cb6db0528f5

Requested commit: e13f1d4556882544f8d0d68766d19cb6db0528f5

Commit: e13f1d4556882544f8d0d68766d19cb6db0528f5

Tree: 8c710a3551adc8b132f09ee74621db7df8de982f

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
feat(server): link to another environment

An environment can now sign in to another one's /mcp as an outside agent,
with a pairing code from that environment, without a browser. It drives the
peer's existing MCP OAuth flow server-side, keeps the token in the server
secret store and the rest in peer_environment_links (migration 059). The
peer lists the link as "T3 Code · <label>" in Connections, where it can be
revoked.

The token is only ever sent to an address whose descriptor answers as the
linked environment. PeerMcpClient calls the peer's tools and carries the
caller's limits in T3-Mode-Limit on every request. Linking refuses this
environment itself and peers that cannot honour that header.

`t3 environment link|list|unlink` and the peerLinks.* RPCs manage links.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

```

## Parents

- [6152622adc27258c06c4f9f5aa3b9f9a2064b9bb](https://git.cafe/pingdotgg/t3code/commit/6152622adc27258c06c4f9f5aa3b9f9a2064b9bb?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/e13f1d4556882544f8d0d68766d19cb6db0528f5?format=markdown)
