YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: Excalidraw connection card (Excalidraw+ MCP via API key) (#3987)
Louis Beaumontbeeeef10ac35
diff --git a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx b/apps/screenpipe-app-tauri/components/settings/connections-section.tsxindex 8d19326e2..5bed8f8dd 100644--- a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/connections-section.tsx@@ -605,6 +605,7 @@ const INTEGRATION_ICONS: Record<string, React.ReactNode> = {linear: <img src="/images/linear.svg" alt="Linear" className="w-5 h-5" />,krisp: <img src="/images/krisp.svg" alt="Krisp" className="w-5 h-5 dark:invert" />,plaud: <img src="/images/plaud.png" alt="Plaud" className="w-5 h-5 dark:invert" />,+ excalidraw: <img src="/images/excalidraw.svg" alt="Excalidraw" className="w-5 h-5" />,odoo: <img src="/images/odoo.svg" alt="Odoo" className="w-5 h-5" />,perplexity: <img src="/images/perplexity.svg" alt="Perplexity" className="w-5 h-5" />,posthog: <img src="/images/posthog.svg" alt="PostHog" className="w-5 h-5" />,@@ -820,6 +821,7 @@ const HARDCODED_DESCRIPTIONS: Record<string, string> = {"perplexity": "Search the web with Perplexity AI","krisp": "Search Krisp meeting transcripts and notes","plaud": "Search Plaud recordings and transcripts",+ "excalidraw": "Search and edit your Excalidraw+ whiteboards","custom-mcp": "Connect any MCP-compatible server","skills": "Import Claude Code skills for AI automations",};@@ -923,6 +925,7 @@ export const TRY_IN_CHAT_PROMPTS: Record<string, string> = {granola: "Show notes from my recent meetings",zoom: "Summarize my recent Zoom calls",krisp: "Search my meeting transcripts for action items",+ excalidraw: "What's on my recent Excalidraw boards?",whatsapp: "What were the latest messages in my WhatsApp?",discord: "What was discussed in my Discord servers recently?",teams: "Show me recent Microsoft Teams messages",@@ -2924,6 +2927,10 @@ function ApiIntegrationPanel({ integration, onRefresh }: {const KRISP_MCP_URL = "https://mcp.krisp.ai/mcp";const PLAUD_MCP_URL = "https://mcp.plaud.ai/mcp";+// Excalidraw+ exposes the workspace (scenes, collections, search) over a+// remote MCP gated by a static API key, not OAuth (no discovery metadata on+// the host), so it uses the ApiKeyMcpPanel below instead of OAuthMcpPanel.+const EXCALIDRAW_MCP_URL = "https://api.excalidraw.com/api/v1/mcp";function mcpRandomId(): string {const bytes = new Uint8Array(8);@@ -3148,6 +3155,199 @@ function OAuthMcpPanel({);}+// Featured API-key MCP cards (Excalidraw+): same one-click idea as the OAuth+// cards above, but for providers whose remote MCP is gated by a static bearer+// key instead of OAuth. The key is validated with an ad-hoc probe first and+// only then persisted (value lands in the secret store via the generic+// /mcp-servers machinery), so, like the OAuth cards, a server config existing+// for the provider URL means the connection works.++function ApiKeyMcpPanel({+ name,+ mcpUrl,+ description,+ keyPlaceholder,+ createKeyUrl,+ createKeyLabel,+ onConnected,+ onDisconnected,+}: {+ name: string;+ mcpUrl: string;+ description: React.ReactNode;+ keyPlaceholder: string;+ createKeyUrl: string;+ createKeyLabel: string;+ onConnected?: () => void;+ onDisconnected?: () => void;+}) {+ const [serverId, setServerId] = useState<string | null>(null);+ const [connected, setConnected] = useState(false);+ const [apiKey, setApiKey] = useState("");+ const [showKey, setShowKey] = useState(false);+ const [busy, setBusy] = useState(false);+ const [statusMsg, setStatusMsg] = useState<string | null>(null);++ // Reflect reality on open: find this provider's MCP server from a prior+ // connect (matched by URL, same as the tile dot in refreshStatus).+ const loadStatus = useCallback(async () => {+ try {+ const r = await localFetch("/mcp-servers");+ if (!r.ok) return;+ const body = await r.json();+ const list = (body?.data ?? []) as { id: string; url?: string; enabled?: boolean }[];+ const existing = list.find(+ (s) => (s.url ?? "").replace(/\/+$/, "") === mcpUrl+ );+ setServerId(existing?.id ?? null);+ setConnected(!!existing?.enabled);+ } catch {}+ }, [mcpUrl]);++ useEffect(() => {+ loadStatus();+ }, [loadStatus]);++ const handleConnect = async () => {+ const key = apiKey.trim();+ if (!key || busy) return;+ setBusy(true);+ setStatusMsg(null);+ try {+ const headers = [{ name: "Authorization", value: `Bearer ${key}` }];+ // Validate the key against the provider before persisting anything.+ const probe = await localFetch("/mcp-servers/test", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ url: mcpUrl, headers }),+ });+ if (!probe.ok) {+ const pb = await probe.json().catch(() => ({}));+ setStatusMsg(pb?.error ?? `${name} rejected the key (HTTP ${probe.status})`);+ return;+ }+ const targetId = serverId ?? mcpRandomId();+ const res = await localFetch(+ `/mcp-servers/${encodeURIComponent(targetId)}`,+ {+ method: "PUT",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ name, url: mcpUrl, headers, enabled: true }),+ }+ );+ if (!res.ok) {+ const body = await res.json().catch(() => ({}));+ setStatusMsg(body?.error ?? `Save failed (HTTP ${res.status})`);+ return;+ }+ setServerId(targetId);+ setConnected(true);+ setApiKey("");+ notifyConnectionsUpdated();+ onConnected?.();+ } catch (e: any) {+ setStatusMsg(e?.message ?? String(e));+ } finally {+ setBusy(false);+ }+ };++ const handleDisconnect = async () => {+ if (!serverId) return;+ setBusy(true);+ try {+ // Deleting the server also wipes the stored key from the secret store.+ await localFetch(`/mcp-servers/${encodeURIComponent(serverId)}`, {+ method: "DELETE",+ });+ setServerId(null);+ setConnected(false);+ setStatusMsg(null);+ notifyConnectionsUpdated();+ onDisconnected?.();+ } finally {+ setBusy(false);+ }+ };++ return (+ <div className="p-4 space-y-3 text-sm">+ <p className="text-xs text-muted-foreground leading-relaxed">+ {description}+ </p>+ {connected ? (+ <div className="flex items-center gap-2">+ <span className="inline-flex items-center gap-1.5 text-xs text-foreground">+ <Check className="h-3.5 w-3.5" /> Connected+ </span>+ <Button+ onClick={handleDisconnect}+ disabled={busy}+ variant="outline"+ size="sm"+ className="gap-1.5 h-7 text-xs normal-case font-sans tracking-normal ml-auto"+ >+ {busy ? (+ <Loader2 className="h-3 w-3 animate-spin" />+ ) : (+ <LogOut className="h-3 w-3" />+ )}+ Disconnect+ </Button>+ </div>+ ) : (+ <div className="space-y-2">+ <div className="flex items-center gap-2">+ <div className="relative flex-1">+ <Input+ type={showKey ? "text" : "password"}+ value={apiKey}+ onChange={(e) => setApiKey(e.target.value)}+ onKeyDown={(e) => {+ if (e.key === "Enter") handleConnect();+ }}+ placeholder={keyPlaceholder}+ className="h-7 text-xs pr-8"+ />+ <button+ type="button"+ onClick={() => setShowKey((v) => !v)}+ className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"+ aria-label={showKey ? "Hide key" : "Show key"}+ >+ {showKey ? <EyeOff className="h-3 w-3" /> : <Eye className="h-3 w-3" />}+ </button>+ </div>+ <Button+ onClick={handleConnect}+ disabled={busy || !apiKey.trim()}+ size="sm"+ className="gap-1.5 h-7 text-xs normal-case font-sans tracking-normal"+ >+ {busy ? (+ <Loader2 className="h-3 w-3 animate-spin" />+ ) : (+ <LogIn className="h-3 w-3" />+ )}+ Connect+ </Button>+ </div>+ <button+ type="button"+ onClick={() => openUrl(createKeyUrl)}+ className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2"+ >+ <ExternalLink className="h-3 w-3" /> {createKeyLabel}+ </button>+ </div>+ )}+ {statusMsg && !connected && (+ <p className="text-xs text-muted-foreground">{statusMsg}</p>+ )}+ </div>+ );+}+// ---------------------------------------------------------------------------// Main connections section// ---------------------------------------------------------------------------@@ -3211,6 +3411,7 @@ export function ConnectionsSection({const [customMcpEnabledCount, setCustomMcpEnabledCount] = useState(0);const [krispConnected, setKrispConnected] = useState(false);const [plaudConnected, setPlaudConnected] = useState(false);+ const [excalidrawConnected, setExcalidrawConnected] = useState(false);const [inputMonitoringGranted, setInputMonitoringGranted] = useState(false);const [importedSkillsCount, setImportedSkillsCount] = useState(0);@@ -3259,6 +3460,7 @@ export function ConnectionsSection({setCustomMcpEnabledCount(0);setKrispConnected(false);setPlaudConnected(false);+ setExcalidrawConnected(false);return;}const body = await r.json();@@ -3269,12 +3471,14 @@ export function ConnectionsSection({setCustomMcpConnected(enabled.length > 0);setKrispConnected(list.some(s => s.enabled && (s.url ?? "").replace(/\/+$/, "") === KRISP_MCP_URL));setPlaudConnected(list.some(s => s.enabled && (s.url ?? "").replace(/\/+$/, "") === PLAUD_MCP_URL));+ setExcalidrawConnected(list.some(s => s.enabled && (s.url ?? "").replace(/\/+$/, "") === EXCALIDRAW_MCP_URL));}).catch(() => {setCustomMcpConnected(false);setCustomMcpServerCount(0);setCustomMcpEnabledCount(0);setKrispConnected(false);setPlaudConnected(false);+ setExcalidrawConnected(false);});if (typeof window !== "undefined" && platform() === "macos") {commands.getBrowsersAutomationStatus().then(statuses => {@@ -3380,6 +3584,7 @@ export function ConnectionsSection({{ id: "perplexity", name: "Perplexity", icon: "perplexity", connected: false, detected: detectedConnectionIds.has("perplexity") },{ id: "krisp", name: "Krisp", icon: "krisp", connected: krispConnected, detected: detectedConnectionIds.has("krisp") },{ id: "plaud", name: "Plaud", icon: "plaud", connected: plaudConnected },+ { id: "excalidraw", name: "Excalidraw", icon: "excalidraw", connected: excalidrawConnected },{ id: "custom-mcp", name: "Custom MCP", icon: "custom-mcp", connected: false, detected: customMcpServerCount > 0 },{ id: "skills", name: "Skills", icon: "skills", connected: importedSkillsCount > 0, category: "Agent" },];@@ -3424,7 +3629,7 @@ export function ConnectionsSection({category: CONNECTION_CATEGORY_BY_ID[tile.id] ?? tile.category ?? "Other",description: tile.description ?? HARDCODED_DESCRIPTIONS[tile.id],}));- }, [os, claudeInstalled, cursorInstalled, codexInstalled, chatgptConnected, browserUrlConnected, browserUrlDetected, integrations, appleCalendarConnected, googleCalendarConnected, googleDocsConnected, googleSheetsConnected, gmailConnected, customMcpConnected, customMcpServerCount, krispConnected, plaudConnected, inputMonitoringGranted, importedSkillsCount, detectedConnectionIds]);+ }, [os, claudeInstalled, cursorInstalled, codexInstalled, chatgptConnected, browserUrlConnected, browserUrlDetected, integrations, appleCalendarConnected, googleCalendarConnected, googleDocsConnected, googleSheetsConnected, gmailConnected, customMcpConnected, customMcpServerCount, krispConnected, plaudConnected, excalidrawConnected, inputMonitoringGranted, importedSkillsCount, detectedConnectionIds]);const isDefaultView = !search.trim() && categoryFilter === ALL_CONNECTION_CATEGORIES;@@ -3535,6 +3740,16 @@ export function ConnectionsSection({onConnected={() => setPlaudConnected(true)}onDisconnected={() => setPlaudConnected(false)}/>;+ case "excalidraw": return <ApiKeyMcpPanel+ name="Excalidraw"+ mcpUrl={EXCALIDRAW_MCP_URL}+ description={<>Connect Excalidraw+ so your AI can search, read, and edit the whiteboard scenes in your workspace. Excalidraw doesn't offer OAuth here, so paste an API key from your Excalidraw+ workspace settings instead. The key is stored securely on this device and only ever sent to Excalidraw.</>}+ keyPlaceholder="Excalidraw+ API key"+ createKeyUrl="https://plus.excalidraw.com/docs/mcp/getting-started"+ createKeyLabel="How to create an API key"+ onConnected={() => setExcalidrawConnected(true)}+ onDisconnected={() => setExcalidrawConnected(false)}+ />;case "ollama": return <OllamaPanel />;case "lmstudio": return <LMStudioPanel />;case "msty": return <MstyPanel />;diff --git a/apps/screenpipe-app-tauri/lib/constants/connections.ts b/apps/screenpipe-app-tauri/lib/constants/connections.tsindex f559508a8..e3e4455d1 100644--- a/apps/screenpipe-app-tauri/lib/constants/connections.ts+++ b/apps/screenpipe-app-tauri/lib/constants/connections.ts@@ -85,10 +85,11 @@ export const CONNECTION_CATEGORY_BY_ID: Record<string, string> = {mochi: "Notes",workflowy: "Notes",- // Documents — docs, spreadsheets & wikis+ // Documents — docs, spreadsheets, wikis & whiteboards"google-docs": "Documents","google-sheets": "Documents",confluence: "Documents",+ excalidraw: "Documents",// Project Management — issues, tasks & time trackinglinear: "Project Management",diff --git a/apps/screenpipe-app-tauri/public/images/excalidraw.svg b/apps/screenpipe-app-tauri/public/images/excalidraw.svgnew file mode 100644index 000000000..9861babaa--- /dev/null+++ b/apps/screenpipe-app-tauri/public/images/excalidraw.svg@@ -0,0 +1,3 @@+<svg viewBox="0 0 107 101" xmlns="http://www.w3.org/2000/svg">+ <path d="M119.81 105.98a.549.549 0 0 0-.53-.12c-4.19-6.19-9.52-12.06-14.68-17.73l-.85-.93c0-.11-.05-.21-.12-.3a.548.548 0 0 0-.34-.2l-.17-.18-.12-.09c-.15-.32-.53-.56-.95-.35-1.58.81-3 1.97-4.4 3.04-1.87 1.43-3.7 2.92-5.42 4.52-.7.65-1.39 1.33-1.97 2.09-.28.37-.07.72.27.87-1.22 1.2-2.45 2.45-3.68 3.74-.11.12-.17.28-.16.44.01.16.09.31.22.41l2.16 1.65s.01.03.03.04c3.09 3.05 8.51 7.28 14.25 11.76.85.67 1.71 1.34 2.57 2.01.39.47.76.94 1.12 1.4.19.25.55.3.8.11.13.1.26.21.39.31a.57.57 0 0 0 .8-.1c.07-.09.1-.2.11-.31.04 0 .07.03.1.03.15 0 .31-.06.42-.18l10.18-11.12a.56.56 0 0 0-.04-.8l.01-.01Zm-29.23-3.85c.07.09.14.17.21.25 1.16.98 2.4 2.04 3.66 3.12l-5.12-3.91s-.32-.22-.52-.36c-.11-.08-.21-.16-.31-.24l-.38-.32s.07-.07.1-.11l.35-.35c1.72-1.74 4.67-4.64 6.19-6.06-1.61 1.62-4.87 6.37-4.17 7.98h-.01Zm17.53 13.81-4.22-3.22c-1.65-1.71-3.43-3.4-5.24-5.03 2.28 1.76 4.23 3.25 4.52 3.51 2.21 1.97 2.11 1.61 3.63 2.91l1.83 1.33c-.18.16-.36.33-.53.49l.01.01Zm1.06.81-.08-.06c.16-.13.33-.25.49-.38l-.4.44h-.01ZM42.24 51.45c.14.72.27 1.43.4 2.11.69 3.7 1.33 7.03 2.55 9.56l.48 1.92c.19.73.46 1.64.71 1.83 2.85 2.52 7.22 6.28 11.89 9.82.21.16.5.15.7-.01.01.02.03.03.04.04.11.1.24.15.38.15.16 0 .31-.06.42-.19 5.98-6.65 10.43-12.12 13.6-16.7.2-.25.3-.54.29-.84.2-.24.41-.48.6-.68a.558.558 0 0 0-.1-.86.578.578 0 0 0-.17-.36c-1.39-1.34-2.42-2.31-3.46-3.28-1.84-1.72-3.74-3.5-7.77-7.51-.02-.02-.05-.04-.07-.06a.555.555 0 0 0-.22-.14c-1.11-.39-3.39-.78-6.26-1.28-4.22-.72-10-1.72-15.2-3.27h-.04v-.01s-.02 0-.03.02h-.01l.04-.02s-.31.01-.37.04c-.08.04-.14.09-.19.15-.05.06-.09.12-.47.2-.38.08.08 0 .11 0h-.11v.03c.07.34.05.58.16.97-.02.1.21 1.02.24 1.11l1.83 7.26h.03Zm30.95 6.54s-.03.04-.04.05l-.64-.71c.22.21.44.42.68.66Zm-7.09 9.39s-.07.08-.1.12l-.02-.02c.04-.03.08-.07.13-.1h-.01Zm-7.07 8.47Zm3.02-28.57c.35.35 1.74 1.65 2.06 1.97-1.45-.66-5.06-2.34-6.74-2.88 1.65.29 3.93.66 4.68.91Zm-19.18-2.77c.84 1.44 1.5 6.49 2.16 11.4-.37-1.58-.69-3.12-.99-4.6-.52-2.56-1-4.85-1.67-6.88.14.01.31.03.49.05 0 .01 0 .02.02.03h-.01Zm-.29-1.21c-.23-.02-.44-.04-.62-.05-.02-.04-.03-.08-.04-.12l.66.18v-.01Zm-2.22.45v-.02.02ZM118.9 42.57c.04-.23-1.1-1.24-.74-1.26.85-.04.86-1.35 0-1.31-1.13.06-2.27.32-3.37.53-1.98.37-3.95.78-5.92 1.21-4.39.94-8.77 1.93-13.1 3.11-1.36.37-2.86.7-4.11 1.36-.42.22-.4.67-.17.95-.09.05-.18.08-.28.09-.37.07-.74.13-1.11.19a.566.566 0 0 0-.39.86c-2.32 3.1-4.96 6.44-7.82 9.95-2.81 3.21-5.73 6.63-8.72 10.14-9.41 11.06-20.08 23.6-31.9 34.64-.23.21-.24.57-.03.8.05.06.12.1.19.13-.16.15-.32.3-.48.44-.1.09-.14.2-.16.32-.08.08-.16.17-.23.25-.21.23-.2.59.03.8.23.21.59.2.8-.03.04-.04.08-.09.12-.13a.84.84 0 0 1 1.22 0c.69.74 1.34 1.44 1.95 2.09l-1.38-1.15a.57.57 0 0 0-.8.07c-.2.24-.17.6.07.8l14.82 12.43c.11.09.24.13.37.13.15 0 .29-.06.4-.17l.36-.36a.56.56 0 0 0 .63-.12c20.09-20.18 36.27-35.43 54.8-49.06.17-.12.25-.32.23-.51a.57.57 0 0 0 .48-.39c3.42-10.46 4.08-19.72 4.28-24.27 0-.03.01-.05.02-.07.02-.05.03-.1.04-.14.03-.11.05-.19.05-.19.26-.78.17-1.53-.15-2.15v.02ZM82.98 58.94c.9-1.03 1.79-2.04 2.67-3.02-5.76 7.58-15.3 19.26-28.81 33.14 9.2-10.18 18.47-20.73 26.14-30.12Zm-32.55 52.81-.03-.03c.11.02.19.04.2.04a.47.47 0 0 0-.17 0v-.01Zm6.9 6.42-.05-.04.03-.03c.02 0 .03.02.04.02 0 .02-.02.03-.03.05h.01Zm8.36-7.21 1.38-1.44c.01.01.02.03.03.05-.47.46-.94.93-1.42 1.39h.01Zm2.24-2.21c.26-.3.56-.65.87-1.02.01-.01.02-.03.04-.04 3.29-3.39 6.68-6.82 10.18-10.25.02-.02.05-.04.07-.06.86-.66 1.82-1.39 2.72-2.08-4.52 4.32-9.11 8.78-13.88 13.46v-.01Zm21.65-55.88c-1.86 2.42-3.9 5.56-5.63 8.07-5.46 7.91-23.04 27.28-23.43 27.65-2.71 2.62-10.88 10.46-16.09 15.37-.14.13-.25.24-.34.35a.794.794 0 0 1 .03-1.13c24.82-23.4 39.88-42.89 46-51.38-.13.33-.24.69-.55 1.09l.01-.02Zm16.51 7.1-.01.02c0-.02-.02-.07.01-.02Zm-.91-5.13Zm-5.89 9.45c-2.26-1.31-3.32-3.27-2.71-5.25l.19-.66c.08-.19.17-.38.28-.57.59-.98 1.49-1.85 2.52-2.36.05-.02.1-.03.15-.04a.795.795 0 0 1-.04-.43c.05-.31.25-.58.66-.58.67 0 2.75.62 3.54 1.3.24.19.47.4.68.63.3.35.74.92.96 1.33.13.06.23.62.38.91.14.46.2.93.18 1.4 0 .02 0 .02.01.03-.03.07 0 .37-.04.4-.1.72-.36 1.43-.75 2.05-.04.05-.07.11-.11.16 0 .01-.02.02-.03.04-.3.43-.65.83-1.08 1.13-1.26.89-2.73 1.16-4.2.79a6.33 6.33 0 0 1-.57-.25l-.02-.03Zm16.27-1.63c-.49 2.05-1.09 4.19-1.8 6.38-.03.08-.03.16-.03.23-.1.01-.19.05-.27.11-4.44 3.26-8.73 6.62-12.98 10.11 3.67-3.32 7.39-6.62 11.23-9.95a6.409 6.409 0 0 0 2.11-3.74l.56-3.37.03-.1c.25-.71 1.34-.4 1.17.33h-.02Z" style="fill:#6965db;fill-rule:nonzero" transform="matrix(1 0 0 1 -26.41 -29.49)" />+</svg>diff --git a/docs/mockups/excalidraw-connection.png b/docs/mockups/excalidraw-connection.pngnew file mode 100644index 000000000..0057fbee0Binary files /dev/null and b/docs/mockups/excalidraw-connection.png differ