Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat: add MCP setup instructions across onboarding, settings, and agents empty state (#3053)

Evan Hutnik0ff9e3d6952a
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/launch.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/launch.tsx
index cd442a2c80..95b427e49b 100644
--- a/js/app/packages/app/component/interactive-onboarding/lessons/launch.tsx
+++ b/js/app/packages/app/component/interactive-onboarding/lessons/launch.tsx
@@ -1,6 +1,8 @@
-import { onMount } from 'solid-js';
+import { createSignal, onMount, Show } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import AppStoreQr from '@macro-icons/app-store.svg';
+import { SegmentedControl } from '@ui';
+import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';
import type { LessonContentProps, LessonDefinition } from '../types';
import { useAnalytics } from '@app/component/analytics-context';
import { useUserId } from '@core/context/user';
@@ -40,8 +42,11 @@ function LaunchContent(props: LessonContentProps) {
{ENABLE_APP_STORE_QR_CODE ? (
<>
<p>You're all set!</p>
- <p>Before you dive in, you can also install our mobile iOS app.</p>
- <p>This QR code is always accessible from the settings panel.</p>
+ <p>
+ Before you dive in, install our mobile iOS app or connect Macro to
+ your favorite AI tools via MCP.
+ </p>
+ <p>Both are always accessible from the settings panel.</p>
</>
) : (
<p>You're all set! Let's dive in.</p>
@@ -50,23 +55,48 @@ function LaunchContent(props: LessonContentProps) {
);
}
+type LaunchTab = 'mobile' | 'mcp';
+
+const LAUNCH_TAB_OPTIONS: Array<{ value: LaunchTab; label: string }> = [
+ { value: 'mobile', label: 'Mobile app' },
+ { value: 'mcp', label: 'MCP instructions' },
+];
+
+function MobilePanel() {
+ return (
+ <div class="h-full w-full flex flex-col items-center justify-center gap-6">
+ <AppStoreQr class="w-[55cqw] h-[55cqw] max-w-[460px] max-h-[460px]" />
+ <p class="text-ink font-medium text-center">
+ Download on the
+ <br />
+ <a
+ href="https://apps.apple.com/us/app/macro-app/id6743133649"
+ rel="noopener noreferrer"
+ class="underline"
+ target="_blank"
+ >
+ App Store
+ </a>
+ </p>
+ </div>
+ );
+}
+
function LaunchDemo() {
+ const [tab, setTab] = createSignal<LaunchTab>('mobile');
+
return (
- <div class="h-full w-full flex items-center justify-center px-8 @container">
- <div class="h-full w-full flex flex-col items-center justify-center gap-6">
- <AppStoreQr class="w-[50cqw] h-[50cqw]" />
- <p class="text-ink font-medium text-center">
- Download on the
- <br />
- <a
- href="https://apps.apple.com/us/app/macro-app/id6743133649"
- rel="noopener noreferrer"
- class="underline"
- target="_blank"
- >
- App Store
- </a>
- </p>
+ <div class="h-full w-full flex flex-col items-center px-8 py-8 @container">
+ <SegmentedControl
+ value={tab()}
+ options={LAUNCH_TAB_OPTIONS}
+ onChange={setTab}
+ aria-label="Launch options"
+ />
+ <div class="flex-1 w-full min-h-0 mt-6 flex items-start justify-center overflow-y-auto">
+ <Show when={tab() === 'mobile'} fallback={<McpSetupCards />}>
+ <MobilePanel />
+ </Show>
</div>
</div>
);
diff --git a/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx b/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx
index ec2cacbe6b..fb7b039bcb 100644
--- a/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/empty-states.tsx
@@ -1,9 +1,11 @@
import { useHandleFileUpload } from '@app/util/handleFileUpload';
import { useMaybeBlockId, useMaybeBlockName } from '@core/block';
+import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';
import { fileSelector } from '@core/directive/fileSelector';
import { folderSelector } from '@core/directive/folderSelector';
import { useEmailLinksStatus } from '@core/email-link';
import { isMobile } from '@core/mobile/isMobile';
+import type { ListView } from '@app/constants/list-views';
import type { ViewId } from '@core/types/view';
import { handleFolderSelect } from '@core/util/upload';
import { createMemo, Match, Show, Switch } from 'solid-js';
@@ -20,23 +22,26 @@ false && folderSelector;
const DEFAULT_EMPTY_MESSAGE = 'No items to show.';
-function getRandomArcanumGraphic() {
- const graphicStyle = 'h-72 m-8 mt-32 @max-sm:mt-20 opacity-60';
- const arcanumGraphics = [
- <Arcanum001 class={graphicStyle} />,
- <Arcanum002 class={graphicStyle} />,
- <Arcanum004 class={graphicStyle} />,
- <Arcanum005 class={graphicStyle} />,
- <Arcanum006 class={graphicStyle} />,
- <Arcanum007 class={graphicStyle} />,
- <Arcanum009 class={graphicStyle} />,
+function getRandomArcanumGraphic(
+ className = 'h-72 m-8 mt-32 @max-sm:mt-20 opacity-60'
+) {
+ const arcanumComponents = [
+ Arcanum001,
+ Arcanum002,
+ Arcanum004,
+ Arcanum005,
+ Arcanum006,
+ Arcanum007,
+ Arcanum009,
];
- const randomIndex = Math.floor(Math.random() * arcanumGraphics.length);
- return arcanumGraphics[randomIndex];
+ const RandomGraphic =
+ arcanumComponents[Math.floor(Math.random() * arcanumComponents.length)];
+ return <RandomGraphic class={className} />;
}
export function EmptyState(props: {
viewId?: ViewId;
+ listView?: ListView;
search?: boolean;
hasRefinementsFromBase?: boolean;
onClearFilters?: () => void;
@@ -58,6 +63,9 @@ export function EmptyState(props: {
}
/>
</Match>
+ <Match when={props.listView === 'agents'}>
+ <AgentsEmptyState />
+ </Match>
<Match when={props.viewId === 'noise' && !emailActive()}>
<EmptyStateInner message={'Email not connected.'} />
</Match>
@@ -171,3 +179,24 @@ export function EmptyStateInner(props: EmptyStateInnerProps) {
</div>
);
}
+
+function AgentsEmptyState() {
+ return (
+ <div class="size-full relative overflow-hidden">
+ <div class="absolute inset-0 flex flex-col items-center pointer-events-none p-4">
+ {getRandomArcanumGraphic('h-72 m-8 mt-32 @max-sm:mt-20 opacity-5')}
+ </div>
+ <div class="relative size-full flex flex-col items-center overflow-y-auto p-4">
+ <div class="w-full max-w-2xl mt-32 @max-sm:mt-20 px-4 pb-8 flex flex-col gap-4">
+ <div>
+ <p class="mt-1 text-sm text-ink-extra-muted">
+ Create an agent above, or use Macro with your favorite AI chat
+ client or code editor via MCP.
+ </p>
+ </div>
+ <McpSetupCards />
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 010fa57d73..642034cc4b 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -893,6 +893,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
</Match>
<Match when={!rows().length}>
<EmptyState
+ listView={currentView()}
search={!!searchText()}
hasRefinementsFromBase={hasActiveRefinements()}
onClearFilters={resetToTabDefaults}
diff --git a/js/app/packages/app/component/settings/Mcp.tsx b/js/app/packages/app/component/settings/Mcp.tsx
new file mode 100644
index 0000000000..6d0468e554
--- /dev/null
+++ b/js/app/packages/app/component/settings/Mcp.tsx
@@ -0,0 +1,23 @@
+import { Panel } from '@ui';
+import { McpSetupCards } from '@core/component/AI/component/McpSetupCards';
+
+export function Mcp() {
+ return (
+ <div
+ class="flex-1 overflow-y-auto py-2 px-4"
+ style="scrollbar-width: none;"
+ >
+ <div class="max-w-2xl w-full mx-auto">
+ <Panel depth={2}>
+ <div class="flex flex-col gap-4 p-6 text-ink">
+ <p class="text-sm text-ink-muted">
+ Use Macro with your favorite AI chat client or code editor via
+ MCP.
+ </p>
+ <McpSetupCards class="max-w-none" />
+ </div>
+ </Panel>
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/app/component/settings/Settings.tsx b/js/app/packages/app/component/settings/Settings.tsx
index a68a4a4ecb..fda984ca10 100644
--- a/js/app/packages/app/component/settings/Settings.tsx
+++ b/js/app/packages/app/component/settings/Settings.tsx
@@ -7,6 +7,7 @@ import { DEV_MODE_ENV, ENABLE_APP_STORE_QR_CODE, ENABLE_TEAMS_OVERRIDE } from '@
import { useFeatureFlag } from '@app/lib/analytics/posthog';
import { Subscription } from './Subscription';
import { MobileApp } from './MobileApp';
+import { Mcp } from './Mcp';
import { Appearance } from './Appearance';
import { Tabs } from '@core/component/Tabs';
import { Account } from './Account';
@@ -67,6 +68,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
tabs.push({ value: 'Shortcuts', label: 'Shortcuts' });
if (permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()) { tabs.push({ value: 'Subscription', label: 'Subscription' }) }
if (ENABLE_APP_STORE_QR_CODE && !isNativeMobilePlatform()) { tabs.push({ value: 'Mobile App', label: 'App' }) }
+ if (!isNativeMobilePlatform()) { tabs.push({ value: 'MCP', label: 'MCP' }) }
if (isNativeMobilePlatform() && DEV_MODE_ENV) { tabs.push({ value: 'Mobile', label: 'Mobile Dev Tools' }) }
return tabs;
}
@@ -155,7 +157,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
}
const handleTabChange = (value: string) => {
- if (value === 'Account' || value === 'Subscription' || value === 'Appearance' || value === 'Mobile' || value === 'AI Memory' || value === 'Shortcuts' || value === 'Mobile App' || value === 'Team') {
+ if (settingsTabs().some((tab) => tab.value === value)) {
setActiveTabId(value as SettingsTab);
}
}
@@ -222,6 +224,9 @@ export function SettingsPanel(props: SettingsPanelProps) {
<Show when={activeTabId() === 'Mobile App' && ENABLE_APP_STORE_QR_CODE && !isNativeMobilePlatform()}>
<MobileApp />
</Show>
+ <Show when={activeTabId() === 'MCP' && !isNativeMobilePlatform()}>
+ <Mcp />
+ </Show>
</div>
<Show when={isMobile()}>
diff --git a/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx b/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx
index a5b94ec48c..622a5673b9 100644
--- a/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx
+++ b/js/app/packages/core/component/AI/component/AIChatEmptyState.tsx
@@ -1,55 +1,12 @@
import CheckIcon from '@phosphor-icons/core/bold/check-bold.svg?component-solid';
import ClipboardIcon from '@phosphor-icons/core/bold/clipboard-bold.svg?component-solid';
import { Button } from '@ui/components/Button';
-import { createSignal, For } from 'solid-js';
-
-const MACRO_MCP_CONFIG = JSON.stringify(
- {
- mcpServers: {
- macro: {
- type: 'http',
- url: 'https://mcp-server.macro.com/mcp',
- },
- },
- },
- null,
- 2
-);
-
-const CLAUDE_CODE_COMMAND =
- 'claude mcp add --transport http macro https://mcp-server.macro.com/mcp';
-
-const CODEX_CLI_COMMAND =
- 'codex mcp add macro --url https://mcp-server.macro.com/mcp';
-
-const CLI_COMMANDS = [
- {
- key: 'claude-cli',
- label: 'Claude Code',
- command: CLAUDE_CODE_COMMAND,
- },
- {
- key: 'codex-cli',
- label: 'Codex CLI',
- command: CODEX_CLI_COMMAND,
- },
-] as const;
+import { For } from 'solid-js';
+import { CLI_COMMANDS, MACRO_MCP_CONFIG } from './mcpConstants';
+import { useClipboardCopy } from './useClipboardCopy';
export function AiChatEmptyState() {
- const [copiedKey, setCopiedKey] = createSignal<string | null>(null);
-
- const handleCopy = async (key: string, text: string) => {
- try {
- await navigator.clipboard.writeText(text);
- setCopiedKey(key);
- setTimeout(
- () => setCopiedKey((current) => (current === key ? null : current)),
- 2000
- );
- } catch (err) {
- console.error('Failed to copy MCP setup instructions', err);
- }
- };
+ const { copiedKey, copy } = useClipboardCopy();
return (
<div class="w-full p-4 text-ink md:p-5">
@@ -76,7 +33,7 @@ export function AiChatEmptyState() {
variant={copiedKey() === item.key ? 'secondary' : 'ghost'}
size="sm"
class="shrink-0"
- onClick={() => handleCopy(item.key, item.command)}
+ onClick={() => copy(item.key, item.command)}
>
{copiedKey() === item.key ? (
<>
@@ -112,7 +69,7 @@ export function AiChatEmptyState() {
variant={copiedKey() === 'json' ? 'secondary' : 'ghost'}
size="sm"
class="shrink-0"
- onClick={() => handleCopy('json', MACRO_MCP_CONFIG)}
+ onClick={() => copy('json', MACRO_MCP_CONFIG)}
>
{copiedKey() === 'json' ? (
<>
diff --git a/js/app/packages/core/component/AI/component/McpSetupCards.tsx b/js/app/packages/core/component/AI/component/McpSetupCards.tsx
new file mode 100644
index 0000000000..4bc98cefb2
--- /dev/null
+++ b/js/app/packages/core/component/AI/component/McpSetupCards.tsx
@@ -0,0 +1,117 @@
+import CaretRight from '@phosphor-icons/core/bold/caret-right-bold.svg?component-solid';
+import CheckIcon from '@phosphor-icons/core/bold/check-bold.svg?component-solid';
+import ClipboardIcon from '@phosphor-icons/core/bold/clipboard-bold.svg?component-solid';
+import { Button } from '@ui';
+import { createSignal, For, Show } from 'solid-js';
+import { cn } from '@ui/utils/classname';
+import {
+ CLI_COMMANDS,
+ MACRO_MCP_CONFIG,
+ MACRO_MCP_URL,
+ WEB_CLIENTS,
+} from './mcpConstants';
+import { useClipboardCopy } from './useClipboardCopy';
+
+function CollapsibleCard(props: {
+ label: string;
+ hint?: string;
+ copyKey: string;
+ copyValue: string;
+ copyLabel?: string;
+ copiedKey: () => string | null;
+ onCopy: (key: string, text: string) => void;
+}) {
+ const [expanded, setExpanded] = createSignal(false);
+ const isCopied = () => props.copiedKey() === props.copyKey;
+
+ return (
+ <div class="overflow-hidden rounded-md border border-edge-muted bg-input/70">
+ <button
+ type="button"
+ class="flex items-center gap-2 w-full px-4 py-2 text-left"
+ aria-expanded={expanded()}
+ onClick={() => setExpanded((v) => !v)}
+ >
+ <CaretRight
+ class="size-3 shrink-0 text-ink-muted transition-transform"
+ classList={{ 'rotate-90': expanded() }}
+ />
+ <span class="text-sm text-ink-muted truncate">{props.label}</span>
+ </button>
+ <Show when={expanded()}>
+ <div class="border-t border-edge-muted flex flex-col">
+ <Show when={props.hint}>
+ <div class="px-4 pt-3 text-xs text-ink-extra-muted">
+ {props.hint}
+ </div>
+ </Show>
+ <div class="flex items-start justify-between gap-3 px-4 py-3">
+ <pre class="flex-1 min-w-0 overflow-x-auto text-[12px] leading-5 text-ink select-text cursor-text whitespace-pre-wrap break-all">
+ <code>{props.copyValue}</code>
+ </pre>
+ <Button
+ variant={isCopied() ? 'secondary' : 'ghost'}
+ size="sm"
+ class="shrink-0"
+ onClick={() => props.onCopy(props.copyKey, props.copyValue)}
+ >
+ {isCopied() ? (
+ <>
+ <CheckIcon class="size-3.5" />
+ Copied
+ </>
+ ) : (
+ <>
+ <ClipboardIcon class="size-3.5" />
+ {props.copyLabel ?? 'Copy'}
+ </>
+ )}
+ </Button>
+ </div>
+ </div>
+ </Show>
+ </div>
+ );
+}
+
+export function McpSetupCards(props: { class?: string }) {
+ const { copiedKey, copy } = useClipboardCopy();
+
+ return (
+ <div class={cn('w-full max-w-2xl flex flex-col gap-3', props.class)}>
+ <For each={CLI_COMMANDS}>
+ {(item) => (
+ <CollapsibleCard
+ label={item.label}
+ copyKey={item.key}
+ copyValue={item.command}
+ copiedKey={copiedKey}
+ onCopy={copy}
+ />
+ )}
+ </For>
+
+ <For each={WEB_CLIENTS}>
+ {(item) => (
+ <CollapsibleCard
+ label={item.label}
+ hint={item.hint}
+ copyKey={item.key}
+ copyValue={MACRO_MCP_URL}
+ copyLabel="Copy URL"
+ copiedKey={copiedKey}
+ onCopy={copy}
+ />
+ )}
+ </For>
+
+ <CollapsibleCard
+ label="IDE"
+ copyKey="json"
+ copyValue={MACRO_MCP_CONFIG}
+ copiedKey={copiedKey}
+ onCopy={copy}
+ />
+ </div>
+ );
+}
diff --git a/js/app/packages/core/component/AI/component/mcpConstants.ts b/js/app/packages/core/component/AI/component/mcpConstants.ts
new file mode 100644
index 0000000000..98338de71a
--- /dev/null
+++ b/js/app/packages/core/component/AI/component/mcpConstants.ts
@@ -0,0 +1,40 @@
+export const MACRO_MCP_URL = 'https://mcp-server.macro.com/mcp';
+
+export const MACRO_MCP_CONFIG = JSON.stringify(
+ {
+ mcpServers: {
+ macro: {
+ type: 'http',
+ url: MACRO_MCP_URL,
+ },
+ },
+ },
+ null,
+ 2
+);
+
+export const CLI_COMMANDS = [
+ {
+ key: 'claude-cli',
+ label: 'Claude Code',
+ command: `claude mcp add --transport http macro ${MACRO_MCP_URL}`,
+ },
+ {
+ key: 'codex-cli',
+ label: 'Codex CLI',
+ command: `codex mcp add macro --url ${MACRO_MCP_URL}`,
+ },
+] as const;
+
+export const WEB_CLIENTS = [
+ {
+ key: 'claude-web',
+ label: 'Claude.ai',
+ hint: 'Settings → Connectors → Add custom connector',
+ },
+ {
+ key: 'chatgpt-web',
+ label: 'ChatGPT',
+ hint: 'Settings → Apps → Advanced settings → enable Developer mode, then Create App',
+ },
+] as const;
diff --git a/js/app/packages/core/component/AI/component/useClipboardCopy.ts b/js/app/packages/core/component/AI/component/useClipboardCopy.ts
new file mode 100644
index 0000000000..a818196d43
--- /dev/null
+++ b/js/app/packages/core/component/AI/component/useClipboardCopy.ts
@@ -0,0 +1,20 @@
+import { createSignal } from 'solid-js';
+
+export function useClipboardCopy() {
+ const [copiedKey, setCopiedKey] = createSignal<string | null>(null);
+
+ const copy = async (key: string, text: string) => {
+ try {
+ await navigator.clipboard.writeText(text);
+ setCopiedKey(key);
+ setTimeout(
+ () => setCopiedKey((current) => (current === key ? null : current)),
+ 2000
+ );
+ } catch (err) {
+ console.error('Failed to copy to clipboard', err);
+ }
+ };
+
+ return { copiedKey, copy };
+}
diff --git a/js/app/packages/core/constant/SettingsState.tsx b/js/app/packages/core/constant/SettingsState.tsx
index 57be8665c4..e9b7b21b83 100644
--- a/js/app/packages/core/constant/SettingsState.tsx
+++ b/js/app/packages/core/constant/SettingsState.tsx
@@ -12,6 +12,7 @@ export type SettingsTab =
| 'Inbox'
| 'Shortcuts'
| 'Mobile App'
+ | 'MCP'
| 'Team';
export const [activeTabId, setActiveTabId] =