GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): Copy MCP URL uses the T3 Connect address (#32937) · adampeterhiggins/t3code@7fe1310

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/user
    • outside-agents.md
  • packages/client-runtime/src/connection
    • presentation.test.ts
    • presentation.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/user/outside-agents.md‎

Copy file name to clipboardExpand all lines: docs/user/outside-agents.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ example:
1616
https://<environment-address>/mcp
1717
```
1818

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

2223
- **An agent on your own computers** can use `localhost` on the host, T3
2324
Connect, or any `https` address, such as
Collapse file

‎packages/client-runtime/src/connection/presentation.test.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/connection/presentation.test.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function supervisorState(overrides: Partial<SupervisorConnectionState>): Supervi
5050
}
5151

5252
describe("connection presentation", () => {
53-
it("copies the MCP address of the route this device is connected over", () => {
53+
it("copies the T3 Connect MCP address first, then the route this device is connected over", () => {
5454
const route = (connectionId: string, httpBaseUrl: string): ConnectionRoute => {
5555
const target = new BearerConnectionTarget({ ...TARGET, connectionId });
5656
return {
@@ -80,6 +80,13 @@ describe("connection presentation", () => {
8080
"http://100.115.1.44:3773/mcp",
8181
);
8282
expect(environmentMcpUrl({ entry })).toBe("http://192.168.4.53:3773/mcp");
83+
expect(
84+
environmentMcpUrl({
85+
entry,
86+
connectedTarget: lan.target,
87+
relayHttpBaseUrl: "https://tunnel.example.test",
88+
}),
89+
).toBe("https://tunnel.example.test/mcp");
8390
});
8491

8592
// regression: #16909 Copy MCP URL falls back to an alternate route when the relay route has no address
Collapse file

‎packages/client-runtime/src/connection/presentation.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/connection/presentation.ts
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,24 @@ export function connectionStatusTitle(connection: EnvironmentConnectionPresentat
9595
}
9696

9797
/**
98-
* SSH connections ride a local forward that disappears with the client, so they have no stable
99-
* address.
98+
* The T3 Connect address wins whenever it is known: it works for agents anywhere, while the
99+
* connected route is often a LAN or loopback address. SSH routes ride a local forward that
100+
* disappears with the client, so they have no stable address.
100101
*/
101102
export function environmentMcpUrl(input: {
102103
readonly entry: ConnectionCatalogEntry;
103104
readonly relayHttpBaseUrl?: string | undefined;
104105
readonly connectedTarget?: ConnectionTarget | null | undefined;
105106
}): string | null {
107+
const relayMcpUrl = input.relayHttpBaseUrl ? mcpUrlFromBase(input.relayHttpBaseUrl) : null;
108+
if (relayMcpUrl !== null) return relayMcpUrl;
106109
const connectedRouteId = input.connectedTarget ? connectionRouteId(input.connectedTarget) : null;
107110
const routes = connectionRoutes(input.entry);
108111
const connectedRoute = routes.find(
109112
(route) => connectionRouteId(route.target) === connectedRouteId,
110113
);
111114
for (const route of connectedRoute ? [connectedRoute, ...routes] : routes) {
112-
const httpBaseUrl =
113-
route.target._tag === "RelayConnectionTarget"
114-
? (input.relayHttpBaseUrl ?? null)
115-
: routeHttpBaseUrl(route);
115+
const httpBaseUrl = routeHttpBaseUrl(route);
116116
const mcpUrl = httpBaseUrl === null ? null : mcpUrlFromBase(httpBaseUrl);
117117
if (mcpUrl !== null) return mcpUrl;
118118
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.