Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/components/settings/ConnectionsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ import { ITEM_ROW_CLASSNAME } from "./itemRows";
import {
CloudLinkRow,
CloudRemoteEnvironmentRows,
LocalEnvironmentMcpUrlRow,
SavedBackendListRow,
} from "./SavedEnvironmentRows";
import { AddEnvironmentDialog } from "./AddEnvironmentDialog";
Expand Down Expand Up @@ -1377,6 +1378,9 @@ function ConnectionsSettingsContent({
}
/>
) : null}
{isPrimaryAccess && accessEnvironment ? (
<LocalEnvironmentMcpUrlRow entry={accessEnvironment.entry} />
) : null}
{accessEnvironment ? (
<details className="group px-3 sm:px-4">
<summary className="flex min-h-11 cursor-pointer list-none items-center gap-2 rounded-md text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring [&::-webkit-details-marker]:hidden">
Expand Down
106 changes: 81 additions & 25 deletions apps/web/src/components/settings/SavedEnvironmentRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
connectionErrorText,
connectionStatusText,
environmentMcpUrl,
localEnvironmentMcpUrl,
type ConnectionCatalogEntry,
} from "@t3tools/client-runtime/connection";
import * as Option from "effect/Option";
import { msg, T, useGT, useMessages } from "gt-react";
Expand Down Expand Up @@ -54,10 +56,13 @@ import { hasCloudPublicConfig } from "~/cloud/publicConfig";
import { isElectron } from "~/env";
import { useT3ConnectTurnOn } from "~/cloud/useT3ConnectTurnOn";
import { useCloudLinkController } from "~/cloud/useCloudLinkController";
import { usePrimaryCloudLinkState } from "~/cloud/cloudLinkState";
import { t3ConnectMcpUrl } from "~/cloud/t3ConnectState";
import { useManagedTunnelUsage } from "~/cloud/managedRelayState";
import { useT3ConnectAccountPage } from "../clerk/T3ConnectAccountPages";
import { TunnelLimitAlert, TunnelUsageMeter } from "../cloud/TunnelUsage";
import { environmentCatalog } from "~/connection/catalog";
import { isLoopbackHostname } from "~/environments/primary/target";
import { readEnvironmentScope } from "~/state/session";
import { type EnvironmentPresentation, useRelayEnvironmentDiscovery } from "~/state/environments";
import { APP_VERSION } from "~/branding";
Expand Down Expand Up @@ -123,6 +128,35 @@ function savedBackendStatus(
}
}

function useCopyMcpUrl() {
const gt = useGT();
return useCopyToClipboard<{ url: string }>({
target: {
target: "MCP URL",
unavailableMessage: msg("Clipboard API is unavailable while copying MCP URL."),
failureMessage: msg("Failed to copy MCP URL to the clipboard."),
},
onCopy: ({ url }) => {
toastManager.add({
type: "success",
title: gt("MCP URL copied"),
description: gt("Add it to an agent, e.g. claude mcp add --transport http t3 {url}", {
url,
}),
});
},
onError: (error) => {
toastManager.add(
stackedThreadToast({
type: "error",
title: gt("Could not copy MCP URL"),
description: error.message,
}),
);
},
});
}

export function SavedBackendListRow({
environment,
removingEnvironmentId,
Expand Down Expand Up @@ -161,31 +195,7 @@ export function SavedBackendListRow({
const copyTraceId = (traceId: string) => {
copyTraceIdToClipboard(traceId, { traceId });
};
const { copyToClipboard: copyMcpUrl } = useCopyToClipboard<{ url: string }>({
target: {
target: "MCP URL",
unavailableMessage: msg("Clipboard API is unavailable while copying MCP URL."),
failureMessage: msg("Failed to copy MCP URL to the clipboard."),
},
onCopy: ({ url }) => {
toastManager.add({
type: "success",
title: gt("MCP URL copied"),
description: gt("Add it to an agent, e.g. claude mcp add --transport http t3 {url}", {
url,
}),
});
},
onError: (error) => {
toastManager.add(
stackedThreadToast({
type: "error",
title: gt("Could not copy MCP URL"),
description: error.message,
}),
);
},
});
const { copyToClipboard: copyMcpUrl } = useCopyMcpUrl();
const versionMismatch = resolveServerConfigVersionMismatch(environment.serverConfig, messages);
const serverUpdateState = useAtomValue(serverEnvironment.updateStateAtom(environmentId));
const resumingServerUpdate =
Expand Down Expand Up @@ -472,6 +482,52 @@ export function SavedBackendListRow({
);
}

/** Copying the host's own MCP address, for hosted agents or agents on this machine. */
export function LocalEnvironmentMcpUrlRow({ entry }: { readonly entry: ConnectionCatalogEntry }) {
const cloudLink = usePrimaryCloudLinkState();
const setting = useSearchableSetting();
const gt = useGT();
const { copyToClipboard: copyMcpUrl } = useCopyMcpUrl();
const tunnelMcpUrl = t3ConnectMcpUrl({
thisMachine: true,
tunnelHostname: cloudLink.data?.tunnelHostname,
relayEndpoint: undefined,
});
const mcpUrl = tunnelMcpUrl ?? localEnvironmentMcpUrl({ entry });
if (mcpUrl === null) return null;
const tunnelAvailable = tunnelMcpUrl !== null;
const tunnelReachability = tunnelAvailable ? cloudLink.data?.reachability : undefined;
const loopback = isLoopbackHostname(new URL(mcpUrl).hostname);
return (
<SettingsRow
{...setting("mcp-url")}
description={
tunnelReachability?.status === "reachable"
? gt("Tunnel connected. Give this URL to a hosted agent, such as ChatGPT: {url}", {
url: mcpUrl,
})
: tunnelReachability?.status === "unreachable"
? gt(
"T3 Connect is unreachable right now, so a hosted agent can use this URL after the tunnel recovers: {url}",
{ url: mcpUrl },
)
: tunnelAvailable
? gt("Give this URL to a hosted agent, such as ChatGPT: {url}", { url: mcpUrl })
: loopback
? gt("Give this URL to an agent running on this machine: {url}", { url: mcpUrl })
: gt("Give this URL to an agent that can reach this environment: {url}", {
url: mcpUrl,
})
}
control={
<Button size="sm" variant="outline" onClick={() => copyMcpUrl(mcpUrl, { url: mcpUrl })}>
<T>Copy</T>
</Button>
}
/>
);
}

function CloudLinkSwitch({
checked,
disabled,
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/components/settings/settingsSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,14 @@ export const SETTINGS_SEARCH_ITEMS = [
desktopOnly: true,
cloudOnly: true,
},
{
id: "mcp-url",
localEnvironmentOnly: true,
title: msg("MCP URL"),
to: "/settings/access",
targetId: "connections-environment",
searchTerms: [msg("outside agents chatgpt claude codex hosted bot oauth server address copy")],
},
{
id: "connect-device-approval",
title: msg("Require approval for new devices"),
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9291,10 +9291,10 @@
"8cbb63fdff9fde72": "Verbindung fehlgeschlagen: {error}",
"cf11cf105b6de783": "Die Zwischenablage-API ist beim Kopieren der MCP-URL nicht verfügbar.",
"cdacfb87d557007b": "Die MCP-URL konnte nicht in die Zwischenablage kopiert werden.",
"a9f514109c355d42": "Trace-ID konnte nicht kopiert werden",
"7ae6db00431a85fe": "MCP-URL kopiert",
"6e824889a09c2f09": "Füge sie zu einem Agenten hinzu, z. B. claude mcp add --transport http t3 {url}",
"69f1a5115bd716c8": "MCP-URL konnte nicht kopiert werden",
"a9f514109c355d42": "Trace-ID konnte nicht kopiert werden",
"4112c1a7b3c1d029": "Wird neu gestartet",
"543ef9fcaf8aa96f": "Ausgeschaltet",
"5173c50b0a60847c": "Update verfügbar: {serverVersion} → {clientVersion}",
Expand All @@ -9308,6 +9308,11 @@
"2c23e82262a1f74f": "Weitere Aktionen für {label}",
"15bce7dec2700d4d": "Routen ausblenden",
"a214401e7be2b6a9": "Von diesem Gerät entfernen…",
"5603f949e77925d5": "Tunnel verbunden. Gib diese URL einem gehosteten Agenten, z. B. ChatGPT: {url}",
"93a6d008cde82198": "T3 Connect ist derzeit nicht erreichbar. Ein gehosteter Agent kann diese URL verwenden, sobald der Tunnel wieder funktioniert: {url}",
"79e3840f1ef8741e": "Gib diese URL einem gehosteten Agenten, z. B. ChatGPT: {url}",
"1d5f687593c4e8ed": "Gib diese URL einem Agenten, der auf diesem Rechner läuft: {url}",
"3db385bf17d8f48e": "Gib diese URL einem Agenten, der diese Umgebung erreichen kann: {url}",
"ee2d0d27c593a9da": "T3 Connect aktivieren",
"42d294de5860fbea": "Deine Sitzung hat keine Berechtigung, den T3-Connect-Zugriff zu verwalten.",
"bfc76dfe5cd48f47": "T3 Connect verknüpft",
Expand Down Expand Up @@ -9343,6 +9348,7 @@
"0e4f42dd41b74e9a": "Klicke auf „Umgebung hinzufügen“, um eine weitere Umgebung zu koppeln.",
"579a261154e2db62": "MCP-URL kopieren",
"4a1e6124e121d54f": "Trace-ID kopieren",
"ffd3cdd328e21c9d": "Kopieren",
"8693499e957364d1": "Mehr Tunnel erhalten",
"903d91cbbe864b52": "Keine gespeicherten Remote-Umgebungen",
"c6ecee717dfa118b": "So",
Expand Down Expand Up @@ -11549,6 +11555,8 @@
"92c2528040ca7442": "serve magicdns endpunkt remote sicher netzwerk",
"ab23b9c923cc4e80": "windows subsystem linux distro zweiter server projekte stoppen windows backend neustart nur wsl",
"814c6f3ba7c29f7c": "verwalteter tunnel cloud andere geräte remote tunnel limit t3 chat",
"b96de95f92a8eeeb": "MCP-URL",
"c0ca4e817099761e": "externe Agenten chatgpt claude codex gehostet Bot oauth Server Adresse kopieren",
"5b2b522e0edc3d32": "t3 connect geräte genehmigen ablehnen vertrauen widerrufen kopplungscode sicherheit konto",
"b5cd79513a06e7c3": "Webhooks offline zurückhalten",
"fadd0fcd7b9e1651": "webhook automatisierungen offline warteschlange postfach t3 connect",
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9299,10 +9299,10 @@
"8cbb63fdff9fde72": "Connection failed: {error}",
"cf11cf105b6de783": "Clipboard API is unavailable while copying MCP URL.",
"cdacfb87d557007b": "Failed to copy MCP URL to the clipboard.",
"a9f514109c355d42": "Could not copy trace ID",
"7ae6db00431a85fe": "MCP URL copied",
"6e824889a09c2f09": "Add it to an agent, e.g. claude mcp add --transport http t3 {url}",
"69f1a5115bd716c8": "Could not copy MCP URL",
"a9f514109c355d42": "Could not copy trace ID",
"4112c1a7b3c1d029": "Restarting",
"543ef9fcaf8aa96f": "Switched off",
"5173c50b0a60847c": "Update available: {serverVersion} → {clientVersion}",
Expand All @@ -9316,6 +9316,11 @@
"2c23e82262a1f74f": "More actions for {label}",
"15bce7dec2700d4d": "Hide routes",
"a214401e7be2b6a9": "Remove from this device…",
"5603f949e77925d5": "Tunnel connected. Give this URL to a hosted agent, such as ChatGPT: {url}",
"93a6d008cde82198": "T3 Connect is unreachable right now, so a hosted agent can use this URL after the tunnel recovers: {url}",
"79e3840f1ef8741e": "Give this URL to a hosted agent, such as ChatGPT: {url}",
"1d5f687593c4e8ed": "Give this URL to an agent running on this machine: {url}",
"3db385bf17d8f48e": "Give this URL to an agent that can reach this environment: {url}",
"ee2d0d27c593a9da": "Enable T3 Connect",
"42d294de5860fbea": "Your session does not have permission to manage T3 Connect access.",
"bfc76dfe5cd48f47": "T3 Connect linked",
Expand Down Expand Up @@ -9351,6 +9356,7 @@
"0e4f42dd41b74e9a": "Click “Add environment” to pair another environment.",
"579a261154e2db62": "Copy MCP URL",
"4a1e6124e121d54f": "Copy trace ID",
"ffd3cdd328e21c9d": "Copy",
"8693499e957364d1": "Get more tunnels",
"903d91cbbe864b52": "No saved remote environments",
"c6ecee717dfa118b": "Su",
Expand Down Expand Up @@ -11557,6 +11563,8 @@
"92c2528040ca7442": "serve magicdns endpoint remote secure network",
"ab23b9c923cc4e80": "windows subsystem linux distro second server projects stop windows backend restart wsl only",
"814c6f3ba7c29f7c": "managed tunnel cloud other devices remote tunnels limit t3 chat",
"b96de95f92a8eeeb": "MCP URL",
"c0ca4e817099761e": "outside agents chatgpt claude codex hosted bot oauth server address copy",
"5b2b522e0edc3d32": "t3 connect devices approve deny trust revoke pairing code security account",
"b5cd79513a06e7c3": "Hold webhooks while offline",
"fadd0fcd7b9e1651": "webhook automations offline queue mailbox t3 connect",
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9287,10 +9287,10 @@
"8cbb63fdff9fde72": "Falló la conexión: {error}",
"cf11cf105b6de783": "La API del portapapeles no está disponible al copiar la URL de MCP.",
"cdacfb87d557007b": "No se pudo copiar la URL de MCP al portapapeles.",
"a9f514109c355d42": "No se pudo copiar el ID de traza",
"7ae6db00431a85fe": "URL de MCP copiada",
"6e824889a09c2f09": "Añádela a un agente, p. ej., claude mcp add --transport http t3 {url}",
"69f1a5115bd716c8": "No se pudo copiar la URL de MCP",
"a9f514109c355d42": "No se pudo copiar el ID de traza",
"4112c1a7b3c1d029": "Reiniciando",
"543ef9fcaf8aa96f": "Apagado",
"5173c50b0a60847c": "Actualización disponible: {serverVersion} → {clientVersion}",
Expand All @@ -9304,6 +9304,11 @@
"2c23e82262a1f74f": "Más acciones para {label}",
"15bce7dec2700d4d": "Ocultar rutas",
"a214401e7be2b6a9": "Quitar de este dispositivo…",
"5603f949e77925d5": "Túnel conectado. Dale esta URL a un agente alojado, como ChatGPT: {url}",
"93a6d008cde82198": "T3 Connect no está disponible ahora. Un agente alojado podrá usar esta URL cuando se recupere el túnel: {url}",
"79e3840f1ef8741e": "Dale esta URL a un agente alojado, como ChatGPT: {url}",
"1d5f687593c4e8ed": "Dale esta URL a un agente que se ejecute en esta máquina: {url}",
"3db385bf17d8f48e": "Dale esta URL a un agente que pueda acceder a este entorno: {url}",
"ee2d0d27c593a9da": "Activar T3 Connect",
"42d294de5860fbea": "Tu sesión no tiene permiso para gestionar el acceso a T3 Connect.",
"bfc76dfe5cd48f47": "T3 Connect vinculado",
Expand Down Expand Up @@ -9339,6 +9344,7 @@
"0e4f42dd41b74e9a": "Haz clic en «Añadir entorno» para emparejar otro entorno.",
"579a261154e2db62": "Copiar URL de MCP",
"4a1e6124e121d54f": "Copiar ID de traza",
"ffd3cdd328e21c9d": "Copiar",
"8693499e957364d1": "Obtener más túneles",
"903d91cbbe864b52": "No hay entornos remotos guardados",
"c6ecee717dfa118b": "Do",
Expand Down Expand Up @@ -11542,6 +11548,8 @@
"92c2528040ca7442": "serve magicdns endpoint remoto seguro red",
"ab23b9c923cc4e80": "windows subsistema linux distro segundo servidor proyectos detener backend de windows reiniciar solo wsl",
"814c6f3ba7c29f7c": "túnel gestionado nube otros dispositivos remoto túneles límite t3 chat",
"b96de95f92a8eeeb": "URL de MCP",
"c0ca4e817099761e": "agentes externos chatgpt claude codex alojado bot oauth servidor dirección copiar",
"5b2b522e0edc3d32": "t3 connect dispositivos aprobar denegar confiar revocar código de emparejamiento seguridad cuenta",
"b5cd79513a06e7c3": "Retener webhooks sin conexión",
"fadd0fcd7b9e1651": "webhook automatizaciones sin conexión cola buzón t3 connect",
Expand Down
10 changes: 9 additions & 1 deletion apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9289,10 +9289,10 @@
"8cbb63fdff9fde72": "Échec de la connexion : {error}",
"cf11cf105b6de783": "L’API Presse-papiers n’est pas disponible pour copier l’URL MCP.",
"cdacfb87d557007b": "Impossible de copier l’URL MCP dans le presse-papiers.",
"a9f514109c355d42": "Impossible de copier l’ID de trace",
"7ae6db00431a85fe": "URL MCP copiée",
"6e824889a09c2f09": "Ajoutez-la à un agent, par ex. claude mcp add --transport http t3 {url}",
"69f1a5115bd716c8": "Impossible de copier l’URL MCP",
"a9f514109c355d42": "Impossible de copier l’ID de trace",
"4112c1a7b3c1d029": "Redémarrage",
"543ef9fcaf8aa96f": "Éteint",
"5173c50b0a60847c": "Mise à jour disponible : {serverVersion} → {clientVersion}",
Expand All @@ -9306,6 +9306,11 @@
"2c23e82262a1f74f": "Plus d’actions pour {label}",
"15bce7dec2700d4d": "Masquer les routes",
"a214401e7be2b6a9": "Retirer de cet appareil…",
"5603f949e77925d5": "Tunnel connecté. Donnez cette URL à un agent hébergé, comme ChatGPT : {url}",
"93a6d008cde82198": "T3 Connect est actuellement inaccessible. Un agent hébergé pourra utiliser cette URL après le rétablissement du tunnel : {url}",
"79e3840f1ef8741e": "Donnez cette URL à un agent hébergé, comme ChatGPT : {url}",
"1d5f687593c4e8ed": "Donnez cette URL à un agent exécuté sur cette machine : {url}",
"3db385bf17d8f48e": "Donnez cette URL à un agent pouvant accéder à cet environnement : {url}",
"ee2d0d27c593a9da": "Activer T3 Connect",
"42d294de5860fbea": "Votre session n’est pas autorisée à gérer l’accès T3 Connect.",
"bfc76dfe5cd48f47": "T3 Connect associé",
Expand Down Expand Up @@ -9341,6 +9346,7 @@
"0e4f42dd41b74e9a": "Cliquez sur « Ajouter un environnement » pour appairer un autre environnement.",
"579a261154e2db62": "Copier l’URL MCP",
"4a1e6124e121d54f": "Copier l’ID de trace",
"ffd3cdd328e21c9d": "Copier",
"8693499e957364d1": "Obtenir plus de tunnels",
"903d91cbbe864b52": "Aucun environnement distant enregistré",
"c6ecee717dfa118b": "Di",
Expand Down Expand Up @@ -11547,6 +11553,8 @@
"92c2528040ca7442": "serve magicdns point de terminaison distant sécurisé réseau",
"ab23b9c923cc4e80": "windows sous-système linux distribution second serveur projets arrêter backend windows redémarrer wsl uniquement",
"814c6f3ba7c29f7c": "tunnel géré cloud autres appareils tunnels distants limite t3 chat",
"b96de95f92a8eeeb": "URL MCP",
"c0ca4e817099761e": "agents externes chatgpt claude codex hébergé bot oauth serveur adresse copier",
"5b2b522e0edc3d32": "t3 connect appareils approuver refuser confiance révoquer code d’appairage sécurité compte",
"b5cd79513a06e7c3": "Conserver les webhooks hors ligne",
"fadd0fcd7b9e1651": "webhook automatisations file d’attente hors ligne boîte aux lettres t3 connect",
Expand Down
Loading
Loading