Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(settings): consolidate MCP integrations into Connections (#4484)
teoc3519216da52
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsxindex e8bbcd8601..ab0b8abd58 100644--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx@@ -695,7 +695,11 @@ const DASHBOARD_LINK: SidebarItem = {* widget. Label/icon come from the settings tab config (see* `getSettingsTabItem`); this list only decides which tabs to promote.*/-const PROMOTED_SETTINGS_TABS: SettingsTab[] = ['Mobile App', 'Agent', 'Team'];+const PROMOTED_SETTINGS_TABS: SettingsTab[] = [+ 'Mobile App',+ 'Connected',+ 'Team',+];export const AppSidebar = (props: AppSidebarProps) => {const layout = useSplitLayout();diff --git a/js/app/packages/app/component/settings/Agent.tsx b/js/app/packages/app/component/settings/Agent.tsxindex 64207478f0..68c8ccf8c4 100644--- a/js/app/packages/app/component/settings/Agent.tsx+++ b/js/app/packages/app/component/settings/Agent.tsx@@ -1,484 +1,19 @@-import { createEffect, createSignal, For, Show, Suspense } from 'solid-js';-import PlusIcon from '@phosphor-icons/core/regular/plus.svg?component-solid';-import PlugIcon from '@phosphor-icons/core/regular/plug.svg?component-solid';-import { Button, Dialog, Panel, ToggleSwitch } from '@ui';-import CheckIcon from '@phosphor-icons/core/regular/check.svg?component-solid';-import XIcon from '@phosphor-icons/core/regular/x.svg?component-solid';import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';-import { toast } from '@core/component/Toast/Toast';-import type {- ServerResponse,- StartAuthResponse,-} from '@service-cognition/generated/schemas';-import {- useMcpServersQuery,- useAddMcpServerMutation,- useUpdateMcpServerMutation,- useDeleteMcpServerMutation,- useStartMcpAuthMutation,-} from '@queries/mcp-servers';-import {- QUICK_CONNECT_SERVERS,- QUICK_CONNECT_ICON_MAP,- type SvgIcon,-} from '@core/component/AI/constant/mcpServers';-import {- IntegrationRow,- SettingsCard,- SettingsPage,- SettingsSection,-} from './primitives';--/** Best-effort hostname for an MCP server URL — friendlier than the raw URL. */-function hostFromUrl(url: string): string {- try {- return new URL(url).host;- } catch {- return url;- }-}--function AddServerForm(props: {- open: boolean;- onOpenChange: (open: boolean) => void;- existingUrls: Set<string>;-}) {- const [name, setName] = createSignal('');- const [url, setUrl] = createSignal('');- const addMutation = useAddMcpServerMutation();- const authMutation = useStartMcpAuthMutation();-- const reset = () => {- setName('');- setUrl('');- };-- const startAuth = (serverName: string, serverUrl: string) => {- authMutation.mutate(- { server_name: serverName, server_url: serverUrl },- {- onSuccess: (result: StartAuthResponse) => {- window.open(result.authorization_url, '_blank');- },- onError: () => {- toast.failure('Server added but failed to start authorization');- },- }- );- };-- const handleSubmit = () => {- const n = name().trim();- const u = url().trim();- if (!n || !u) return;-- addMutation.mutate(- { server_name: n, url: u },- {- onSuccess: () => {- startAuth(n, u);- reset();- props.onOpenChange(false);- },- onError: () => {- toast.failure('Failed to add server');- },- }- );- };-- const handleQuickConnect = (server: { server_name: string; url: string }) => {- addMutation.mutate(- { server_name: server.server_name, url: server.url },- {- onSuccess: () => {- startAuth(server.server_name, server.url);- props.onOpenChange(false);- },- onError: () => {- toast.failure(`Failed to add ${server.server_name}`);- },- }- );- };-- return (- <Dialog- open={props.open}- onOpenChange={(open) => !open && props.onOpenChange(false)}- position="center"- class="w-100"- >- <Panel depth={2} class="rounded-xl">- <Panel.Header class="px-6">- <span class="text-ink text-sm font-semibold">Add MCP Server</span>- </Panel.Header>- <Panel.Body class="p-6 flex flex-col gap-5">- <div class="flex flex-col gap-2">- <span class="text-xs text-ink-muted">Quick Connect</span>- <div class="grid grid-cols-2 gap-2">- <For each={QUICK_CONNECT_SERVERS}>- {(server) => {- const added = () => props.existingUrls.has(server.url);- return (- <button- class="flex items-center justify-between px-3 py-2 rounded-lg border border-edge-muted text-sm transition-colors"- classList={{- 'text-ink hover:bg-ink/4 cursor-pointer': !added(),- 'text-ink-muted cursor-default': added(),- }}- disabled={added() || addMutation.isPending}- onClick={() => handleQuickConnect(server)}- >- <span class="flex items-center gap-2 text-accent">- <server.icon class="size-4" />- <span class="text-ink">{server.server_name}</span>- </span>- <Show when={added()}>- <span class="text-xs text-ink-muted">Added</span>- </Show>- </button>- );- }}- </For>- </div>- </div>-- <div class="flex flex-col gap-4">- <span class="text-xs text-ink-muted">Custom Server</span>- <label class="flex flex-col gap-1.5">- <span class="text-xs text-ink-muted">Name</span>- <input- type="text"- class="settings-input w-full"- placeholder="My MCP Server"- value={name()}- onInput={(e) => setName(e.currentTarget.value)}- onKeyDown={(e) => {- if (e.key === 'Enter') handleSubmit();- if (e.key === 'Escape') {- reset();- props.onOpenChange(false);- }- }}- />- </label>- <label class="flex flex-col gap-1.5">- <span class="text-xs text-ink-muted">URL</span>- <input- type="url"- class="settings-input w-full"- placeholder="https://example.com/mcp"- value={url()}- onInput={(e) => setUrl(e.currentTarget.value)}- onKeyDown={(e) => {- if (e.key === 'Enter') handleSubmit();- if (e.key === 'Escape') {- reset();- props.onOpenChange(false);- }- }}- />- </label>- </div>-- <div class="flex justify-end gap-2 pt-1">- <Button- variant="base"- size="sm"- depth={3}- onClick={() => {- reset();- props.onOpenChange(false);- }}- >- Cancel- </Button>- <Button- variant="active"- size="sm"- depth={3}- disabled={!name().trim() || !url().trim() || addMutation.isPending}- onClick={handleSubmit}- >- {addMutation.isPending ? 'Adding...' : 'Add'}- </Button>- </div>- </Panel.Body>- </Panel>- </Dialog>- );-}--// We have no server-side signal for a failed auth, so we remember locally that a-// connect attempt was made. A disconnected server with a recorded attempt is-// treated as a failed connection; the flag is cleared once it authenticates.-const AUTH_ATTEMPT_PREFIX = 'mcp:auth-attempted:';--function readAuthAttempted(url: string): boolean {- try {- return localStorage.getItem(AUTH_ATTEMPT_PREFIX + url) === '1';- } catch {- return false;- }-}--function writeAuthAttempted(url: string, attempted: boolean): void {- try {- if (attempted) localStorage.setItem(AUTH_ATTEMPT_PREFIX + url, '1');- else localStorage.removeItem(AUTH_ATTEMPT_PREFIX + url);- } catch {- // Ignore storage failures (private mode, quota, etc.)- }-}--function ServerRow(props: { server: ServerResponse }) {- const updateMutation = useUpdateMcpServerMutation();- const deleteMutation = useDeleteMcpServerMutation();- const authMutation = useStartMcpAuthMutation();- const [confirmDelete, setConfirmDelete] = createSignal(false);- const [attempted, setAttempted] = createSignal(- readAuthAttempted(props.server.url)- );-- // A recorded attempt on a still-disconnected server means the last connect- // attempt didn't succeed. Clear the flag once the server authenticates.- createEffect(() => {- if (props.server.authenticated && attempted()) {- writeAuthAttempted(props.server.url, false);- setAttempted(false);- }- });-- const connectionFailed = () => !props.server.authenticated && attempted();-- const handleToggleEnabled = () => {- updateMutation.mutate(- { url: props.server.url, enabled: !props.server.enabled },- {- onError: () => {- toast.failure('Failed to update server');- },- }- );- };-- const handleDelete = () => {- deleteMutation.mutate(- { url: props.server.url },- {- onSuccess: () => {- toast.success('Server removed');- setConfirmDelete(false);- },- onError: () => {- toast.failure('Failed to remove server');- setConfirmDelete(false);- },- }- );- };-- const handleAuth = () => {- authMutation.mutate(- {- server_url: props.server.url,- server_name: props.server.server_name,- },- {- onSuccess: (result: StartAuthResponse) => {- window.open(result.authorization_url, '_blank');- writeAuthAttempted(props.server.url, true);- setAttempted(true);- },- onError: () => {- writeAuthAttempted(props.server.url, true);- setAttempted(true);- toast.failure('Failed to start authorization');- },- }- );- };-- const Icon = (): SvgIcon =>- QUICK_CONNECT_ICON_MAP.get(props.server.url) ?? (PlugIcon as SvgIcon);-- return (- <IntegrationRow- icon={(() => {- const C = Icon();- return <C class="size-5 text-accent" />;- })()}- title={- <span class="flex items-center gap-1.5">- <span class="min-w-0 truncate">{props.server.server_name}</span>- <Show when={props.server.authenticated}>- <CheckIcon class="size-3 shrink-0 text-success" />- </Show>- <Show when={connectionFailed()}>- <XIcon class="size-3 shrink-0 text-failure" />- </Show>- </span>- }- description={hostFromUrl(props.server.url)}- >- <Show when={!props.server.authenticated}>- <Show when={connectionFailed()}>- <span class="text-xs text-failure whitespace-nowrap">- Last attempt failed- </span>- </Show>- <Button- variant="active"- size="sm"- depth={3}- disabled={authMutation.isPending}- onClick={handleAuth}- >- {authMutation.isPending- ? 'Connecting...'- : connectionFailed()- ? 'Try Again'- : 'Connect'}- </Button>- </Show>-- <Show when={props.server.authenticated}>- <ToggleSwitch- size="md"- checked={props.server.enabled}- disabled={updateMutation.isPending}- onChange={handleToggleEnabled}- label={props.server.enabled ? 'Enabled' : 'Disabled'}- labelClass="inline-block w-14 text-left text-xs text-ink-muted whitespace-nowrap"- />- </Show>-- <Show- when={!confirmDelete()}- fallback={- <div class="flex items-center gap-1">- <Button- variant="danger"- size="sm"- depth={3}- disabled={deleteMutation.isPending}- onClick={handleDelete}- >- {deleteMutation.isPending ? 'Removing...' : 'Confirm'}- </Button>- <Button- variant="base"- size="sm"- depth={3}- onClick={() => setConfirmDelete(false)}- >- Cancel- </Button>- </div>- }- >- <Button- variant="base"- size="sm"- depth={3}- tooltip="Remove"- onClick={() => setConfirmDelete(true)}- >- <XIcon class="size-4" />- </Button>- </Show>- </IntegrationRow>- );-}--function Connectors() {- const serversQuery = useMcpServersQuery();- const [showAddDialog, setShowAddDialog] = createSignal(false);-- return (- <SettingsSection- title="Connectors"- description="Connect Macro's agent to external MCP servers."- actions={- <Button- variant="base"- size="sm"- depth={3}- onClick={() => setShowAddDialog(true)}- >- <PlusIcon class="size-4" />- Add server- </Button>- }- >- <Show when={serversQuery.isError}>- <SettingsCard>- <div class="px-6 py-8 text-center text-sm text-ink-muted">- Failed to load servers.- <Button- variant="base"- size="sm"- depth={3}- onClick={() => serversQuery.refetch()}- class="ml-2"- >- Retry- </Button>- </div>- </SettingsCard>- </Show>-- <Show when={serversQuery.data}>- {(servers) => (- <Show- when={servers().length > 0}- fallback={- <SettingsCard>- <div class="px-6 py-8 text-center text-sm text-ink-muted">- No MCP servers connected yet.- </div>- </SettingsCard>- }- >- <SettingsCard>- <For each={servers()}>- {(server) => <ServerRow server={server} />}- </For>- </SettingsCard>- </Show>- )}- </Show>-- <AddServerForm- open={showAddDialog()}- onOpenChange={setShowAddDialog}- existingUrls={new Set(serversQuery.data?.map((s) => s.url) ?? [])}- />- </SettingsSection>- );-}-+import { SettingsPage } from './primitives';++/**+ * The "MCP server" tab: setup instructions for pointing other agents and MCP+ * clients (Claude Code, Codex, IDEs, ...) at Macro's own MCP server. Managing+ * Macro's outbound connectors lives on the Connections tab (see+ * `Integrations.tsx`).+ */export function Agent() {return (<SettingsPage- title="MCPs"- description="Connect Macro's agent to external tools, or connect other agents to Macro."+ title="Macro MCP server"+ description="Connect other agents and tools to your Macro workspace.">- <Suspense- fallback={- <div class="text-sm text-ink-muted py-8 text-center">Loading...</div>- }- >- <Connectors />- </Suspense>-- <SettingsSection- title="Macro MCP server"- description="Connect other agents and tools to your Macro workspace."- >- <McpSetupCards class="max-w-none" />- </SettingsSection>+ <McpSetupCards class="max-w-none" /></SettingsPage>);}diff --git a/js/app/packages/app/component/settings/ConnectedAccounts.tsx b/js/app/packages/app/component/settings/ConnectedAccounts.tsxindex f25cbf60fa..6c65099e37 100644--- a/js/app/packages/app/component/settings/ConnectedAccounts.tsx+++ b/js/app/packages/app/component/settings/ConnectedAccounts.tsx@@ -3,18 +3,20 @@ import { ENABLE_EMAIL } from '@core/constant/featureFlags';import { SettingsPage, SettingsSection } from './primitives';import { EmailCard } from './Email';import { GitHubCard } from './GitHub';+import { IntegrationsSection } from './Integrations';/**- * Consolidated "Connected accounts" page: one card per external service the- * user can link (Gmail, GitHub). Replaces the separate Email / GitHub tabs.+ * Consolidated "Connections" page: one card per external account the user can+ * link (Gmail, GitHub), plus the agent's MCP integrations — so everything+ * Macro is connected to lives in one place.*/export function ConnectedAccounts() {return (<SettingsPage- title="Connected accounts"+ title="Connections"description="Connect your accounts so Macro can work across the tools you already use.">- <SettingsSection>+ <SettingsSection title="Accounts"><div class="flex flex-col gap-3"><Show when={ENABLE_EMAIL}><Suspense>@@ -26,6 +28,9 @@ export function ConnectedAccounts() {</Suspense></div></SettingsSection>+ <Suspense>+ <IntegrationsSection />+ </Suspense></SettingsPage>);}diff --git a/js/app/packages/app/component/settings/Integrations.tsx b/js/app/packages/app/component/settings/Integrations.tsxnew file mode 100644index 0000000000..085bcfa6a5--- /dev/null+++ b/js/app/packages/app/component/settings/Integrations.tsx@@ -0,0 +1,452 @@+import { createEffect, createSignal, For, Show } from 'solid-js';+import PlusIcon from '@phosphor-icons/core/regular/plus.svg?component-solid';+import PlugIcon from '@phosphor-icons/core/regular/plug.svg?component-solid';+import { Button, Dialog, Panel, ToggleSwitch } from '@ui';+import CheckIcon from '@phosphor-icons/core/regular/check.svg?component-solid';+import XIcon from '@phosphor-icons/core/regular/x.svg?component-solid';+import { toast } from '@core/component/Toast/Toast';+import type {+ ServerResponse,+ StartAuthResponse,+} from '@service-cognition/generated/schemas';+import {+ useMcpServersQuery,+ useAddMcpServerMutation,+ useUpdateMcpServerMutation,+ useDeleteMcpServerMutation,+ useStartMcpAuthMutation,+} from '@queries/mcp-servers';+import {+ FEATURED_MCP_SERVERS,+ QUICK_CONNECT_ICON_MAP,+ type FeaturedMcpServer,+ type SvgIcon,+} from '@core/component/AI/constant/mcpServers';+import { IntegrationRow, SettingsCard, SettingsSection } from './primitives';+import { ConnectAction } from './integration-ui';++/** Best-effort hostname for an MCP server URL — friendlier than the raw URL. */+function hostFromUrl(url: string): string {+ try {+ return new URL(url).host;+ } catch {+ return url;+ }+}++function AddServerForm(props: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+}) {+ const [name, setName] = createSignal('');+ const [url, setUrl] = createSignal('');+ const addMutation = useAddMcpServerMutation();+ const authMutation = useStartMcpAuthMutation();++ const reset = () => {+ setName('');+ setUrl('');+ };++ const startAuth = (serverName: string, serverUrl: string) => {+ authMutation.mutate(+ { server_name: serverName, server_url: serverUrl },+ {+ onSuccess: (result: StartAuthResponse) => {+ window.open(result.authorization_url, '_blank');+ },+ onError: () => {+ toast.failure('Server added but failed to start authorization');+ },+ }+ );+ };++ const handleSubmit = () => {+ const n = name().trim();+ const u = url().trim();+ if (!n || !u) return;++ addMutation.mutate(+ { server_name: n, url: u },+ {+ onSuccess: () => {+ startAuth(n, u);+ reset();+ props.onOpenChange(false);+ },+ onError: () => {+ toast.failure('Failed to add server');+ },+ }+ );+ };++ return (+ <Dialog+ open={props.open}+ onOpenChange={(open) => !open && props.onOpenChange(false)}+ position="center"+ class="w-100"+ >+ <Panel depth={2} class="rounded-xl">+ <Panel.Header class="px-6">+ <span class="text-ink text-sm font-semibold">Add MCP Server</span>+ </Panel.Header>+ <Panel.Body class="p-6 flex flex-col gap-5">+ <div class="flex flex-col gap-4">+ <label class="flex flex-col gap-1.5">+ <span class="text-xs text-ink-muted">Name</span>+ <input+ type="text"+ class="settings-input w-full"+ placeholder="My MCP Server"+ value={name()}+ onInput={(e) => setName(e.currentTarget.value)}+ onKeyDown={(e) => {+ if (e.key === 'Enter') handleSubmit();+ if (e.key === 'Escape') {+ reset();+ props.onOpenChange(false);+ }+ }}+ />+ </label>+ <label class="flex flex-col gap-1.5">+ <span class="text-xs text-ink-muted">URL</span>+ <input+ type="url"+ class="settings-input w-full"+ placeholder="https://example.com/mcp"+ value={url()}+ onInput={(e) => setUrl(e.currentTarget.value)}+ onKeyDown={(e) => {+ if (e.key === 'Enter') handleSubmit();+ if (e.key === 'Escape') {+ reset();+ props.onOpenChange(false);+ }+ }}+ />+ </label>+ </div>++ <div class="flex justify-end gap-2 pt-1">+ <Button+ variant="base"+ size="sm"+ depth={3}+ onClick={() => {+ reset();+ props.onOpenChange(false);+ }}+ >+ Cancel+ </Button>+ <Button+ variant="active"+ size="sm"+ depth={3}+ disabled={!name().trim() || !url().trim() || addMutation.isPending}+ onClick={handleSubmit}+ >+ {addMutation.isPending ? 'Adding...' : 'Add'}+ </Button>+ </div>+ </Panel.Body>+ </Panel>+ </Dialog>+ );+}++// We have no server-side signal for a failed auth, so we remember locally that a+// connect attempt was made. A disconnected server with a recorded attempt is+// treated as a failed connection; the flag is cleared once it authenticates.+const AUTH_ATTEMPT_PREFIX = 'mcp:auth-attempted:';++function readAuthAttempted(url: string): boolean {+ try {+ return localStorage.getItem(AUTH_ATTEMPT_PREFIX + url) === '1';+ } catch {+ return false;+ }+}++function writeAuthAttempted(url: string, attempted: boolean): void {+ try {+ if (attempted) localStorage.setItem(AUTH_ATTEMPT_PREFIX + url, '1');+ else localStorage.removeItem(AUTH_ATTEMPT_PREFIX + url);+ } catch {+ // Ignore storage failures (private mode, quota, etc.)+ }+}++function ServerRow(props: { server: ServerResponse }) {+ const updateMutation = useUpdateMcpServerMutation();+ const deleteMutation = useDeleteMcpServerMutation();+ const authMutation = useStartMcpAuthMutation();+ const [confirmDelete, setConfirmDelete] = createSignal(false);+ const [attempted, setAttempted] = createSignal(+ readAuthAttempted(props.server.url)+ );++ // A recorded attempt on a still-disconnected server means the last connect+ // attempt didn't succeed. Clear the flag once the server authenticates.+ createEffect(() => {+ if (props.server.authenticated && attempted()) {+ writeAuthAttempted(props.server.url, false);+ setAttempted(false);+ }+ });++ const connectionFailed = () => !props.server.authenticated && attempted();++ const handleToggleEnabled = () => {+ updateMutation.mutate(+ { url: props.server.url, enabled: !props.server.enabled },+ {+ onError: () => {+ toast.failure('Failed to update server');+ },+ }+ );+ };++ const handleDelete = () => {+ deleteMutation.mutate(+ { url: props.server.url },+ {+ onSuccess: () => {+ toast.success('Server removed');+ setConfirmDelete(false);+ },+ onError: () => {+ toast.failure('Failed to remove server');+ setConfirmDelete(false);+ },+ }+ );+ };++ const handleAuth = () => {+ authMutation.mutate(+ {+ server_url: props.server.url,+ server_name: props.server.server_name,+ },+ {+ onSuccess: (result: StartAuthResponse) => {+ window.open(result.authorization_url, '_blank');+ writeAuthAttempted(props.server.url, true);+ setAttempted(true);+ },+ onError: () => {+ writeAuthAttempted(props.server.url, true);+ setAttempted(true);+ toast.failure('Failed to start authorization');+ },+ }+ );+ };++ const Icon = (): SvgIcon =>+ QUICK_CONNECT_ICON_MAP.get(props.server.url) ?? (PlugIcon as SvgIcon);++ return (+ <IntegrationRow+ icon={(() => {+ const C = Icon();+ return <C class="size-5" />;+ })()}+ title={+ <span class="flex items-center gap-1.5">+ <span class="min-w-0 truncate">{props.server.server_name}</span>+ <Show when={props.server.authenticated}>+ <CheckIcon class="size-3 shrink-0 text-success" />+ </Show>+ <Show when={connectionFailed()}>+ <XIcon class="size-3 shrink-0 text-failure" />+ </Show>+ </span>+ }+ description={hostFromUrl(props.server.url)}+ >+ <Show when={!props.server.authenticated}>+ <Show when={connectionFailed()}>+ <span class="text-xs text-failure whitespace-nowrap">+ Last attempt failed+ </span>+ </Show>+ <Button+ variant="active"+ size="sm"+ depth={3}+ disabled={authMutation.isPending}+ onClick={handleAuth}+ >+ {authMutation.isPending+ ? 'Connecting...'+ : connectionFailed()+ ? 'Try Again'+ : 'Connect'}+ </Button>+ </Show>++ <Show when={props.server.authenticated}>+ <ToggleSwitch+ size="md"+ checked={props.server.enabled}+ disabled={updateMutation.isPending}+ onChange={handleToggleEnabled}+ label={props.server.enabled ? 'Enabled' : 'Disabled'}+ labelClass="inline-block w-14 text-left text-xs text-ink-muted whitespace-nowrap"+ />+ </Show>++ <Show+ when={!confirmDelete()}+ fallback={+ <div class="flex items-center gap-1">+ <Button+ variant="danger"+ size="sm"+ depth={3}+ disabled={deleteMutation.isPending}+ onClick={handleDelete}+ >+ {deleteMutation.isPending ? 'Removing...' : 'Confirm'}+ </Button>+ <Button+ variant="base"+ size="sm"+ depth={3}+ onClick={() => setConfirmDelete(false)}+ >+ Cancel+ </Button>+ </div>+ }+ >+ <Button+ variant="base"+ size="sm"+ depth={3}+ tooltip="Remove"+ onClick={() => setConfirmDelete(true)}+ >+ <XIcon class="size-4" />+ </Button>+ </Show>+ </IntegrationRow>+ );+}++/**+ * A featured integration the user hasn't connected yet, shown inline in the+ * integrations list (rather than only inside the "Add server" dialog) to make+ * connecting a one-click affair. Once connected, the server shows up as a+ * regular {@link ServerRow} instead.+ */+function FeaturedServerRow(props: { server: FeaturedMcpServer }) {+ const addMutation = useAddMcpServerMutation();+ const authMutation = useStartMcpAuthMutation();++ // Once the add lands, the cache update removes this suggestion row from the+ // list. mutate()-level callbacks are dropped for unmounted observers, so the+ // add → auth chain must run on mutateAsync promises instead.+ const handleConnect = async () => {+ try {+ await addMutation.mutateAsync({+ server_name: props.server.server_name,+ url: props.server.url,+ });+ } catch {+ toast.failure(`Failed to add ${props.server.server_name}`);+ return;+ }+ try {+ const result: StartAuthResponse = await authMutation.mutateAsync({+ server_name: props.server.server_name,+ server_url: props.server.url,+ });+ window.open(result.authorization_url, '_blank');+ } catch {+ toast.failure('Server added but failed to start authorization');+ }+ };++ return (+ <IntegrationRow+ icon={<props.server.icon class="size-5" />}+ title={props.server.server_name}+ description={props.server.tagline}+ >+ <ConnectAction+ label="Connect"+ onClick={handleConnect}+ loading={addMutation.isPending || authMutation.isPending}+ />+ </IntegrationRow>+ );+}++/**+ * The "MCP integrations" section of the Connections page: MCP servers the+ * user has connected, followed by the preset suggestions they haven't, with+ * custom servers behind the "Add server" dialog.+ */+export function IntegrationsSection() {+ const serversQuery = useMcpServersQuery();+ const [showAddDialog, setShowAddDialog] = createSignal(false);++ const servers = () => serversQuery.data ?? [];+ const existingUrls = () => new Set(servers().map((s) => s.url));+ const suggestions = () =>+ FEATURED_MCP_SERVERS.filter((s) => !existingUrls().has(s.url));++ return (+ <SettingsSection+ title="MCP integrations"+ description="Connect MCP servers to give Macro's agent access to the tools your team already uses."+ actions={+ <Button+ variant="base"+ size="sm"+ depth={3}+ onClick={() => setShowAddDialog(true)}+ >+ <PlusIcon class="size-4" />+ Add server+ </Button>+ }+ >+ <Show when={serversQuery.isError}>+ <SettingsCard>+ <div class="px-6 py-8 text-center text-sm text-ink-muted">+ Failed to load integrations.+ <Button+ variant="base"+ size="sm"+ depth={3}+ onClick={() => serversQuery.refetch()}+ class="ml-2"+ >+ Retry+ </Button>+ </div>+ </SettingsCard>+ </Show>++ <Show when={!serversQuery.isError}>+ <SettingsCard>+ <For each={servers()}>{(server) => <ServerRow server={server} />}</For>+ <For each={suggestions()}>+ {(server) => <FeaturedServerRow server={server} />}+ </For>+ </SettingsCard>+ </Show>++ <AddServerForm open={showAddDialog()} onOpenChange={setShowAddDialog} />+ </SettingsSection>+ );+}diff --git a/js/app/packages/block-email/component/compose/SignaturePreview.tsx b/js/app/packages/block-email/component/compose/SignaturePreview.tsxindex 4ac0c7f946..78a21a48a2 100644--- a/js/app/packages/block-email/component/compose/SignaturePreview.tsx+++ b/js/app/packages/block-email/component/compose/SignaturePreview.tsx@@ -70,7 +70,7 @@ export function SignaturePreview(props: {Signature</button><Tooltip- label="Edit your signature in Settings -> Connected accounts."+ label="Edit your signature in Settings -> Connections."as="span"><InfoIcon class="size-3.5 text-ink-muted" />diff --git a/js/app/packages/core/component/AI/component/message/EmptyChatState.tsx b/js/app/packages/core/component/AI/component/message/EmptyChatState.tsxindex 0627571b0a..3c96c74c1d 100644--- a/js/app/packages/core/component/AI/component/message/EmptyChatState.tsx+++ b/js/app/packages/core/component/AI/component/message/EmptyChatState.tsx@@ -1,8 +1,4 @@-import {- type SettingsTab,- setAgentSettingsSubTab,- useSettingsState,-} from '@core/constant/SettingsState';+import { useSettingsState } from '@core/constant/SettingsState';import ArrowRightIcon from '@phosphor-icons/core/assets/bold/arrow-right-bold.svg?component-solid';import AtIcon from '@phosphor-icons/core/assets/bold/at-bold.svg?component-solid';import PaperPlaneTiltIcon from '@phosphor-icons/core/assets/bold/paper-plane-tilt-bold.svg?component-solid';@@ -42,15 +38,10 @@ function EmptyStateCard(props: {export function EmptyChatState(props: { minHeight: number }) {const { openSettings } = useSettingsState();- const openConnectors = () => {- setAgentSettingsSubTab('connectors');- openSettings('Agent' as SettingsTab);- };-- const openMcpServer = () => {- setAgentSettingsSubTab('mcp_server');- openSettings('Agent' as SettingsTab);- };+ // Connector management lives on the Connections tab; the Agent tab+ // holds the Macro MCP server setup instructions.+ const openIntegrations = () => openSettings('Connected');+ const openMcpServer = () => openSettings('Agent');return (<div@@ -76,9 +67,9 @@ export function EmptyChatState(props: { minHeight: number }) {/><EmptyStateCardicon={<PlugsConnectedIcon class="size-4" />}- title="Connect MCP servers"- description="Give the agent access to external tools like Linear, PostHog, Datadog, and more."- action={{ label: 'Add connectors', onClick: openConnectors }}+ title="Connect your tools"+ description="Give the agent access to external tools like Linear, Notion, PostHog, and more."+ action={{ label: 'Connect integrations', onClick: openIntegrations }}/><EmptyStateCardicon={<PuzzlePieceIcon class="size-4" />}diff --git a/js/app/packages/core/component/AI/constant/mcpServers.ts b/js/app/packages/core/component/AI/constant/mcpServers.tsindex 92a2972bb5..9d5ec8834c 100644--- a/js/app/packages/core/component/AI/constant/mcpServers.ts+++ b/js/app/packages/core/component/AI/constant/mcpServers.ts@@ -53,6 +53,33 @@ export const QUICK_CONNECT_SERVERS = [},] as const;+export type QuickConnectServer = (typeof QUICK_CONNECT_SERVERS)[number];++/**+ * Preset servers surfaced directly on the Connections page (with a one-line+ * pitch) to encourage connecting — the only catalog now that the "Add server"+ * dialog is custom-URL only. Ordered by how much we want to promote each;+ * presets absent from {@link QUICK_CONNECT_SERVERS} (e.g. dev-only Slack in+ * production) are dropped automatically.+ */+const FEATURED_SERVER_TAGLINES: [name: string, tagline: string][] = [+ ['Linear', 'Create and update issues without leaving Macro.'],+ ['Slack', 'Search conversations and post updates to channels.'],+ ['Notion', 'Search your pages, databases, and wikis.'],+ ['PostHog', 'Query product analytics and user insights.'],+ ['GitHub', 'Give the agent access to your repos, PRs, and issues.'],+ ['Datadog', 'Query metrics, logs, and monitors.'],+ ['Grafana', 'Search dashboards and query your data sources.'],+];++export type FeaturedMcpServer = QuickConnectServer & { tagline: string };++export const FEATURED_MCP_SERVERS: FeaturedMcpServer[] =+ FEATURED_SERVER_TAGLINES.flatMap(([name, tagline]) => {+ const server = QUICK_CONNECT_SERVERS.find((s) => s.server_name === name);+ return server ? [{ ...server, tagline }] : [];+ });+export const QUICK_CONNECT_ICON_MAP: Map<string, SvgIcon> = new Map(QUICK_CONNECT_SERVERS.map((s) => [s.url, s.icon]));diff --git a/js/app/packages/core/constant/SettingsState.tsx b/js/app/packages/core/constant/SettingsState.tsxindex 15266bb624..7eba2668c2 100644--- a/js/app/packages/core/constant/SettingsState.tsx+++ b/js/app/packages/core/constant/SettingsState.tsx@@ -31,10 +31,6 @@ const [modalOpen, setModalOpen] = createControlledOpenSignal(false, {id: 'settings',});-export type AgentSettingsSubTab = 'connectors' | 'mcp_server';-export const [agentSettingsSubTab, setAgentSettingsSubTab] =- createSignal<AgentSettingsSubTab>('connectors');-export const useSettingsState = () => {const { openWithSplit } = useSplitLayout();diff --git a/js/app/packages/core/constant/settingsTabsConfig.tsx b/js/app/packages/core/constant/settingsTabsConfig.tsxindex 84916a9b34..cfd5375e49 100644--- a/js/app/packages/core/constant/settingsTabsConfig.tsx+++ b/js/app/packages/core/constant/settingsTabsConfig.tsx@@ -56,10 +56,10 @@ export const SETTINGS_TAB_GROUPS: SettingsTabGroup[] = [{ tab: 'Team', label: 'Team', icon: UsersThreeIcon },{tab: 'Connected',- label: 'Connected accounts',+ label: 'Connections',icon: CpuIcon,},- { tab: 'Agent', label: 'MCPs', icon: PlugIcon },+ { tab: 'Agent', label: 'MCP server', icon: PlugIcon },],},{