MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / SetupMcpPage

Function SetupMcpPage

apps/cloud/src/web/pages/setup-mcp.tsx:21–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19import { useAuth } from "../auth";
20
21export const SetupMcpPage = () => {
22 const navigate = useNavigate();
23 const auth = useAuth();
24 const organizationSlug =
25 auth.status === "authenticated" ? (auth.organization?.slug ?? null) : null;
26 // Land DIRECTLY on the org's canonical URL. Navigating to the bare
27 // `/{-$orgSlug}` would mount the shell at `/`, then OrgSlugGate would fire a
28 // SECOND navigation to canonicalize `/` → `/<slug>` — that double hop is the
29 // window where the shell paints over this still-mounted onboarding page.
30 const goToApp = () =>
31 navigate({ to: "/{-$orgSlug}", params: { orgSlug: organizationSlug ?? undefined } });
32 const [origin, setOrigin] = useState<string | null>(null);
33 const [advancedOpen, setAdvancedOpen] = useState(false);
34 const [elicitationMode, setElicitationMode] = useState<McpElicitationMode>("model");
35
36 useEffect(() => {
37 setOrigin(window.location.origin);
38 }, []);
39
40 const endpoint = origin
41 ? buildMcpHttpEndpoint({
42 origin,
43 desktop: null,
44 elicitationMode,
45 organizationSlug,
46 })
47 : "";
48 const command = origin
49 ? buildMcpInstallCommand({
50 mode: "http",
51 isDev: false,
52 origin,
53 elicitationMode,
54 organizationSlug,
55 })
56 : "";
57
58 return (
59 <div className="flex min-h-screen items-center justify-center bg-background px-4 py-10">
60 <div className="mx-auto flex w-full max-w-lg flex-col gap-6">
61 <header className="flex flex-col gap-2">
62 <p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
63 Step 2 of 2
64 </p>
65 <h1 className="font-sans font-semibold text-3xl">Connect your MCP client</h1>
66 <p className="text-sm text-muted-foreground">
67 Executor exposes your sources, secrets, and tools to any MCP-compatible agent. Copy the
68 URL into your client, or run the install command.
69 </p>
70 </header>
71
72 <section aria-label="MCP server URL" className="flex flex-col gap-2">
73 <p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
74 MCP server URL
75 </p>
76 <div className="flex items-center gap-2 rounded-md border border-border bg-card/60 px-3 py-2">
77 <span className="min-w-0 flex-1 truncate font-mono text-sm text-foreground/90">
78 {endpoint || "…"}

Callers

nothing calls this directly

Calls 5

useAuthFunction · 0.90
buildMcpHttpEndpointFunction · 0.90
buildMcpInstallCommandFunction · 0.90
trackEventFunction · 0.90
goToAppFunction · 0.85

Tested by

no test coverage detected