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

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

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

Visibility: public

Requested revision: 197930788c33a086de927374a30e02da4c6336c4

Requested commit: 197930788c33a086de927374a30e02da4c6336c4

Commit: 197930788c33a086de927374a30e02da4c6336c4

Tree: 14849c2acc92a9252d8dc2d5c58550f1421aeeb3

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

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

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