import { useEffect, useState } from "react"; import { useNavigate } from "@tanstack/react-router"; import { trackEvent } from "@executor-js/react/api/analytics"; import { Button } from "@executor-js/react/components/button"; import { CodeBlock } from "@executor-js/react/components/code-block"; import { buildMcpHttpEndpoint, buildMcpInstallCommand, type McpElicitationMode, } from "@executor-js/react/components/mcp-install-card"; import { CopyButton } from "@executor-js/react/components/copy-button"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@executor-js/react/components/collapsible"; import { NativeSelect, NativeSelectOption } from "@executor-js/react/components/native-select"; import { useAuth } from "../auth"; export const SetupMcpPage = () => { const navigate = useNavigate(); const auth = useAuth(); const organizationSlug = auth.status === "authenticated" ? (auth.organization?.slug ?? null) : null; // Land DIRECTLY on the org's canonical URL. Navigating to the bare // `/{-$orgSlug}` would mount the shell at `/`, then OrgSlugGate would fire a // SECOND navigation to canonicalize `/` → `/` — that double hop is the // window where the shell paints over this still-mounted onboarding page. const goToApp = () => navigate({ to: "/{-$orgSlug}", params: { orgSlug: organizationSlug ?? undefined } }); const [origin, setOrigin] = useState(null); const [advancedOpen, setAdvancedOpen] = useState(false); const [elicitationMode, setElicitationMode] = useState("model"); useEffect(() => { setOrigin(window.location.origin); }, []); const endpoint = origin ? buildMcpHttpEndpoint({ origin, desktop: null, elicitationMode, organizationSlug, }) : ""; const command = origin ? buildMcpInstallCommand({ mode: "http", isDev: false, origin, elicitationMode, organizationSlug, }) : ""; return (

Step 2 of 2

Connect your MCP client

Executor exposes your sources, secrets, and tools to any MCP-compatible agent. Copy the URL into your client, or run the install command.

MCP server URL

{endpoint || "…"} {endpoint && ( trackEvent("mcp_install_command_copied", { transport: "http", elicitation_mode: elicitationMode, surface: "setup_mcp", }) } /> )}

Paste this into your MCP client config.

Advanced
Resume approvals
Select how tool approvals are handled for this MCP connection.
setElicitationMode(event.target.value as McpElicitationMode)} aria-label="Elicitation mode" className="min-w-44" > Browser approval Model resume tool Native elicitation
or

Install command

trackEvent("mcp_install_command_copied", { transport: "http", elicitation_mode: elicitationMode, surface: "setup_mcp", }) } />

Adds the server to a supported agent.

{/* oxlint-disable-next-line react/forbid-elements */}
); };