Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): copy an environment's MCP URL for outside agents #15222

Closedjuliusmarmingewants to merge 4 commits intot3code/mcp-oauth/sign-in fromt3code/mcp-oauth/copy-urlopened View on GitHub

Showing 4 changed files with 87 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
37 additions and 0 deletionsapps/web/src/components/settings/ConnectionsSettings.tsxModified
View file
@@ -48,6 +48,7 @@
RelayConnectionTarget,
connectionRoutes,
connectionStatusText,
+ environmentMcpUrl,
} from "@t3tools/client-runtime/connection";
import {
isAtomCommandInterrupted,
@@ -1526,6 +1527,25 @@
[copyTraceIdToClipboard],
+ const { copyToClipboard: copyMcpUrl } = useCopyToClipboard<{ url: string }>({
+ target: "MCP URL",
+ onCopy: ({ url }) => {
+ toastManager.add({
+ type: "success",
+ title: "MCP URL copied",
+ description: `Add it to an agent, e.g. claude mcp add --transport http t3 ${url}`,
Thread on line 1536
macroscopeapp[bot](GitHub profile, opens in a new tab)commented

🟡 Medium settings/ConnectionsSettings.tsx:1536

The success toast displays the MCP URL verbatim, so saved bearer connections with URL userinfo expose credentials such as user:password in the UI; the same credential-bearing URL is also copied. Strip username and password when constructing mcpUrl (for example in environmentMcpUrl) before both displaying and copying it.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/components/settings/ConnectionsSettings.tsx around line 1536:

The success toast displays the MCP URL verbatim, so saved bearer connections with URL userinfo expose credentials such as `user:password` in the UI; the same credential-bearing URL is also copied. Strip `username` and `password` when constructing `mcpUrl` (for example in `environmentMcpUrl`) before both displaying and copying it.
+ });
+ },
+ onError: (error) => {
+ toastManager.add(
+ stackedThreadToast({
+ type: "error",
+ title: "Could not copy MCP URL",
+ description: error.message,
+ }),