Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Apps: AgentMail, AgentPhone, Vapi and Telnyx cards for bots' own email, numbers and calls
aivsomkar9d2549a8dc93
diff --git a/docs/custom-mcp-servers.md b/docs/custom-mcp-servers.mdindex 0599a7c2e9..8e96588553 100644--- a/docs/custom-mcp-servers.md+++ b/docs/custom-mcp-servers.md@@ -83,6 +83,30 @@ the ones that show card details, so choose which bots get it under **Botaccess**. Existing custom entries at the official HTTP endpoint are recognizedrather than replaced.+### Email, phone numbers and calls for your bots++Four cards give bots their own email, numbers and calls on accounts you own,+so each service bills you directly and OpenMausBot pays for none of it.++| Card | Official endpoint | Connects with |+| --- | --- | --- |+| **AgentMail**, email inboxes | `https://mcp.agentmail.to/mcp` | Browser sign-in |+| **AgentPhone**, US and Canadian numbers, texts and calls | `https://mcp.agentphone.ai/mcp` | Browser sign-in |+| **Vapi**, phone calls | `https://mcp.vapi.ai/mcp` | A private API key from the Vapi dashboard |+| **Telnyx**, numbers in many countries, texts and calls | `https://api.telnyx.com/v2/mcp` | An API key from the Telnyx portal |++Vapi and Telnyx have no browser sign-in, so their cards take a pasted key. The+key goes in the server's `Authorization: Bearer` header, never in its+address, on a server that stays off until its tools load with that key; a+refused key leaves it off and says why. Like every header value it is never+shown again. **Disconnect** on a key card deletes the server and its key.++Placing a call, buying a number and every Telnyx action (Telnyx reaches its+whole API through one tool) follow **Sending on your behalf**, the same as+sending a message. Choose which bots get each card under **Bot access**. To+have a bot answer new mail, texts or calls, add a webhook for that bot in+**Automations** and paste its address into the service.+### Servers that ask you to sign inSome URL servers take no token; they want you to sign in with your browserdiff --git a/docs/verification/README.md b/docs/verification/README.mdindex ba892ddb2f..0360e08a60 100644--- a/docs/verification/README.md+++ b/docs/verification/README.md@@ -141,6 +141,11 @@ The [Whop fixture](whop.md) checks its one-click setup, cancellation, deniedconsent, discovery failures, reconnect and disconnect using that same registryand a synthetic provider, without accessing a real Whop account.+The [bot contact cards fixture](bot-contact-cards.md) checks the AgentMail,+AgentPhone, Vapi and Telnyx cards: a pasted key that is refused, replaced and+deleted on Disconnect, kept in a header and out of every listing, against a+loopback stand-in for Vapi.+The [Postiz fixture](postiz.md) checks the Apps page's Postiz card in the Socialcategory: Postiz Cloud's sign-in and an API key for a person's own Postiz, thebot's turn getting the `postiz` tools with the token kept out of every answer,diff --git a/docs/verification/bot-contact-cards.md b/docs/verification/bot-contact-cards.mdnew file mode 100644index 0000000000..faf2d3697e--- /dev/null+++ b/docs/verification/bot-contact-cards.md@@ -0,0 +1,29 @@+# Bot contact cards++The AgentMail, AgentPhone, Vapi and Telnyx cards in Apps give bots their own+email, numbers and calls on the person's own accounts. AgentMail and AgentPhone+sign in with the browser like Whop. Vapi and Telnyx take a pasted key.++## Isolated browser verification++Use an installed Playwright module and Chromium, as for [Whop](whop.md):++```sh+node --experimental-strip-types scripts/verify-bot-contact-cards.ts+```++It launches a disposable fake-engine workspace and drives the real Apps modal,+with a loopback MCP server that accepts one key standing in for Vapi. Only the+fixture's middleware maps Vapi's official address to that fake. It checks:++- All four cards show; AgentMail has no key field and Vapi's Connect stays off+ until a key is typed.+- A refused key leaves the server off with the key in its `Authorization`+ header, never in its address, and the card says the key was refused.+- A good key replaces the refused one on the same server, switches it on and+ counts it in **Connected**; no listing ever returns the key.+- **Disconnect** deletes the server and its key.++Screenshots go to `OMB_UI_EVIDENCE_DIR` (default+`/tmp/omb-contact-cards-evidence`). No real Vapi, Telnyx, AgentMail or+AgentPhone account is used.diff --git a/scripts/verify-bot-contact-cards.ts b/scripts/verify-bot-contact-cards.tsnew file mode 100644index 0000000000..262e2c5690--- /dev/null+++ b/scripts/verify-bot-contact-cards.ts@@ -0,0 +1,92 @@+// Real registry, renderer and tools check behind the four bot contact cards; a loopback fake stands in for Vapi, so no+// real Vapi account, key or call is used.+import assert from "node:assert/strict";+import { mkdirSync } from "node:fs";+import { join } from "node:path";+import { launchVerificationServer } from "./control-omb.ts";+import { fixtureApi, mountPreview, type MountedPreview } from "./testing/preview-fixture.ts";+import { startFakeHttpMcp } from "../server/testing/fake-http-mcp-server.ts";++const VAPI = "https://mcp.vapi.ai/mcp";+const fixture = await launchVerificationServer();+const mcp = await startFakeHttpMcp({ acceptBearer: (authorization) => authorization === "Bearer good-key",+ tools: [{ name: "create_call", inputSchema: { type: "object", properties: {} } }] });+let ui: MountedPreview | undefined;+let browser: { close(): Promise<void> } | undefined;+try {+ const api = fixtureApi(fixture.info.url);+ const pairing = await api("POST", "/api/auth/pairing", { scopes: ["admin", "client"] });+ ui = await mountPreview(fixture, {+ entry: "/scripts/testing/whop-preview.tsx", route: "/__contact-cards.html", title: "Isolated bot contact cards",+ extraRoutes: [+ { path: "/api/connectors/catalog", handler: (_req, res) => {+ res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify({ configured: false, mode: "self-hosted", source: "curated", cards: [] }));+ } },+ { path: /^\/api\/connectors(?:\/connected)?$/, handler: (_req, res) => {+ res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify({ services: {} }));+ } },+ { path: /^\/api\/mcp\/servers(?:\/.*)?$/, handler: async (req, res) => {+ let raw = "";+ for await (const chunk of req) raw += chunk;+ // Only the fixture substitutes transport: production always saves the official URL.+ if (raw) { const body = JSON.parse(raw); if (body.url === VAPI) body.url = mcp.url; raw = JSON.stringify(body); }+ const response = await fetch(`${fixture.info.url}${req.url}`, { method: req.method,+ headers: { "content-type": "application/json", cookie: req.headers.cookie ?? "", "x-forwarded-for": "192.0.2.10" },+ ...(raw ? { body: raw } : {}),+ });+ const body = await response.json();+ for (const server of body.servers ?? []) if (server.url === mcp.url) server.url = VAPI;+ res.writeHead(response.status, { "content-type": "application/json" }).end(JSON.stringify(body));+ } },+ ],+ });+ const { chromium } = await import(process.env.OMB_VERIFY_PLAYWRIGHT || "playwright");+ browser = await chromium.launch({ headless: true, executablePath: process.env.OMB_VERIFY_BROWSER_CHROME || undefined });+ const context = await (browser as any).newContext({ viewport: { width: 1100, height: 1000 } });+ const page = await context.newPage();+ const errors: string[] = [];+ page.on("pageerror", (error: Error) => errors.push(error.message));+ await page.goto(ui.previewUrl);+ assert.equal(await page.evaluate(async (code: string) => (await fetch("/api/auth/pair", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ code, cookie: true, label: "Contact cards fixture" }) })).status, pairing.code), 200);+ await page.reload();+ const output = process.env.OMB_UI_EVIDENCE_DIR || "/tmp/omb-contact-cards-evidence";+ mkdirSync(output, { recursive: true });+ const status = async () => (await api("GET", "/api/mcp/servers")).servers as Array<Record<string, unknown>>;+ const vapi = page.locator('[data-app-tile="vapi"]');++ for (const id of ["agentmail", "agentphone", "vapi", "telnyx"]) await page.locator(`[data-app-tile="${id}"]`).waitFor();+ assert.equal(await page.locator('[data-app-tile="agentmail"] input').count(), 0, "AgentMail signs in with the browser, no key field");+ assert.equal(await page.locator('[data-app-tile="telnyx"]').getByLabel("Telnyx API key", { exact: true }).count(), 1);+ assert.equal(await vapi.getByRole("button", { name: "Connect Vapi", exact: true }).isDisabled(), true, "no key, no Connect");+ await vapi.scrollIntoViewIfNeeded();+ await page.screenshot({ path: join(output, "cards.png"), fullPage: true });++ await vapi.getByLabel("Vapi API key", { exact: true }).fill("wrong-key");+ await vapi.getByRole("button", { name: "Connect Vapi", exact: true }).click();+ await vapi.getByRole("alert").getByText("Vapi didn’t accept that key. Check it and connect again.", { exact: true }).waitFor();+ const refused = (await status()).find((server) => server.name === "vapi")!;+ assert.equal(refused.enabled, false, "a refused key leaves the server off");+ assert.deepEqual(refused.headerKeys, ["Authorization"]);+ assert.equal(refused.url, mcp.url, "the key rides in a header; the saved address is the endpoint alone");+ assert.doesNotMatch(JSON.stringify(await status()), /wrong-key/);+ await page.screenshot({ path: join(output, "refused.png"), fullPage: true });++ await vapi.getByLabel("Vapi API key", { exact: true }).fill("good-key");+ await vapi.getByRole("button", { name: "Connect Vapi", exact: true }).click();+ await vapi.getByLabel("Connected", { exact: true }).waitFor();+ const servers = await status();+ assert.equal(servers.filter((server) => server.url === mcp.url).length, 1, "the same server took the new key");+ assert.equal(servers.find((server) => server.name === "vapi")!.enabled, true);+ assert.doesNotMatch(JSON.stringify(servers), /good-key/);+ assert.equal(await page.locator('[data-apps-filter="connected"]').innerText(), "1 connected");+ await page.screenshot({ path: join(output, "connected.png"), fullPage: true });++ await vapi.getByRole("button", { name: "Disconnect Vapi", exact: true }).click();+ await vapi.getByLabel("Vapi API key", { exact: true }).waitFor();+ assert.equal((await status()).some((server) => server.name === "vapi"), false, "Disconnect deletes the server and its key");+ await page.screenshot({ path: join(output, "disconnected.png"), fullPage: true });+ assert.deepEqual(errors, []);+ console.log(JSON.stringify({ passed: true, ...fixture.info, evidence: output, liveVapiAccountTested: false }));+} finally {+ await browser?.close(); await ui?.close(); await mcp.close(); await fixture.close();+}diff --git a/src/components/McpServersPanel.hosted.test.ts b/src/components/McpServersPanel.hosted.test.tsindex d4cca20be6..6bdf3696a2 100644--- a/src/components/McpServersPanel.hosted.test.ts+++ b/src/components/McpServersPanel.hosted.test.ts@@ -25,6 +25,7 @@ vi.mock("@/lib/app-links", () => ({ openExternalLink: vi.fn(async () => {}) }));vi.mock("@/lib/mcp-servers", () => ({ updateMcpServers: vi.fn() }));vi.mock("./bot-panel/panel-link", () => ({ openBotSettings: fixture.openBotSettings }));+import { openExternalLink } from "@/lib/app-links";import { McpServersPanel } from "./McpServersPanel";interface Listing { name: string; type: "http"; url: string; headerKeys: string[]; enabled: boolean; auth: "signed-in" | "needs-sign-in"; managedBy?: string }@@ -63,21 +64,25 @@ beforeEach(() => {fixture.runMcpSignIn.mockResolvedValue({ phase: "succeeded", flowId: "00000000-0000-4000-8000-000000000000", authorizationUrl: null });fixture.api.mockImplementation((path: string, init?: RequestInit) => {const body = init?.body ? JSON.parse(init.body as string) : undefined;- if (path === "/api/mcp/servers" && !init?.method) return Promise.resolve({ servers });+ if (path === "/api/mcp/servers" && !init?.method) return Promise.resolve({ servers: structuredClone(servers) });+ // Like the real server, every answer is a fresh copy, and a listing names its headers without their values.+ const saved = ({ headers, ...entry }: { headers?: Record<string, string> } & Record<string, unknown>) => ({ ...entry, headerKeys: Object.keys(headers ?? {}).sort() });if (path === "/api/mcp/servers" && init?.method === "POST") {- servers.push({ headerKeys: [], auth: "needs-sign-in", ...body });- return Promise.resolve({ servers });+ servers.push({ auth: "needs-sign-in", ...saved(body) } as Listing);+ return Promise.resolve({ servers: structuredClone(servers) });}const named = /^\/api\/mcp\/servers\/([^/]+)(\/sign-out|\/test)?$/.exec(path);const server = named && servers.find((entry) => entry.name === named[1]);+ if (server && !named[2] && init?.method === "PUT") { Object.assign(server, saved(body)); return Promise.resolve({ servers: structuredClone(servers) }); }+ if (server && !named[2] && init?.method === "DELETE") { servers = servers.filter((entry) => entry !== server); return Promise.resolve({ servers: structuredClone(servers) }); }if (server && named[2] === "/test") {return new Promise((resolve, reject) => {testRequest = { resolve, signal: init?.signal ?? undefined };init?.signal?.addEventListener("abort", () => reject(new DOMException("aborted", "AbortError")));});}- if (server && named[2] === "/sign-out") { server.auth = "needs-sign-in"; return Promise.resolve({ servers }); }- if (server && init?.method === "PATCH") { server.enabled = body.enabled; return Promise.resolve({ servers }); }+ if (server && named[2] === "/sign-out") { server.auth = "needs-sign-in"; return Promise.resolve({ servers: structuredClone(servers) }); }+ if (server && init?.method === "PATCH") { server.enabled = body.enabled; return Promise.resolve({ servers: structuredClone(servers) }); }return Promise.reject(new Error(`unexpected ${init?.method ?? "GET"} ${path}`));});});@@ -86,7 +91,7 @@ afterEach(async () => {host.remove();});-describe.each(HOSTED_MCP_APPS)("The $label card", (app) => {+describe.each(HOSTED_MCP_APPS.filter((app) => !("key" in app)))("The $label card", (app) => {async function connect() {await act(async () => button(app, "Connect").click());await settle();@@ -222,6 +227,88 @@ describe.each(HOSTED_MCP_APPS)("The $label card", (app) => {});});+describe.each(HOSTED_MCP_APPS.filter((app) => "key" in app))("The $label key card", (app) => {+ const keyField = () => card(app).querySelector<HTMLInputElement>('input[type="password"]')!;+ async function typeKey(value: string) {+ await act(async () => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(keyField(), value);+ keyField().dispatchEvent(new Event("input", { bubbles: true }));+ });+ }+ async function connectWith(value: string) {+ await typeKey(value);+ await act(async () => button(app, "Connect").click());+ await settle();+ }++ it("keeps Connect off until a key is typed", async () => {+ await mount();+ expect(keyField().getAttribute("aria-label")).toBe(`${app.label} API key`);+ expect((button(app, "Connect") as HTMLButtonElement).disabled).toBe(true);+ await typeKey(" ");+ expect((button(app, "Connect") as HTMLButtonElement).disabled).toBe(true);+ await typeKey("sk-live");+ expect((button(app, "Connect") as HTMLButtonElement).disabled).toBe(false);+ });++ it("saves the key in a header on a server left off, never in its address, and switches it on once its tools load", async () => {+ await mount();+ await connectWith(" sk-live ");+ expect(added()).toEqual([{ name: app.id, type: "http", url: app.url, headers: { Authorization: "Bearer sk-live" }, enabled: false }]);+ expect(fixture.runMcpSignIn).not.toHaveBeenCalled();+ expect(calls("PATCH")).toEqual([]);+ await act(async () => testRequest!.resolve({ ok: true, tools: [{ name: "any" }] }));+ await settle();+ expect(calls("PATCH")).toEqual([[`/api/mcp/servers/${app.id}`, { enabled: true }]]);+ expect(card(app).querySelector('[aria-label="Connected"]')).not.toBeNull();+ expect(card(app).querySelector('input[type="password"]')).toBeNull();+ });++ it("leaves the server off and says the key was refused when the service turns it down", async () => {+ await mount();+ await connectWith("sk-wrong");+ await act(async () => testRequest!.resolve({ ok: false, reason: "keys", error: "The server didn't accept the keys (HTTP 401). Check the header values." }));+ await settle();+ expect(card(app).querySelector('[role="alert"]')?.textContent).toBe(`${app.label} didn’t accept that key. Check it and connect again.`);+ expect(calls("PATCH")).toEqual([]);+ expect(card(app).querySelector('[aria-label="Connected"]')).toBeNull();+ });++ it("leaves the server off and gives the reason when its tools fail to load for anything else", async () => {+ await mount();+ await connectWith("sk-live");+ await act(async () => testRequest!.resolve({ ok: false, reason: "timeout", error: "The server did not answer in time." }));+ await settle();+ expect(card(app).querySelector('[role="alert"]')?.textContent).toBe(`${app.label}’s tools could not be loaded with that key: The server did not answer in time. Connect again to retry.`);+ expect(calls("PATCH")).toEqual([]);+ });++ it("replaces the key on the server it already has, under any name, instead of adding another", async () => {+ servers = [listing(app, { name: "calls", headerKeys: ["Authorization"] })];+ await mount();+ await connectWith("sk-new");+ expect(added()).toEqual([]);+ expect(calls("PUT")).toEqual([["/api/mcp/servers/calls", { type: "http", url: app.url, headers: { Authorization: "Bearer sk-new" }, enabled: false }]]);+ });++ it("deletes the server, and with it the key, on Disconnect", async () => {+ servers = [listing(app, { enabled: true, headerKeys: ["Authorization"] })];+ await mount();+ expect(card(app).querySelector('[aria-label="Connected"]')).not.toBeNull();+ await act(async () => button(app, "Disconnect").click());+ await settle();+ expect(calls("DELETE")).toEqual([[`/api/mcp/servers/${app.id}`, undefined]]);+ expect(fixture.api.mock.calls.some(([path]) => String(path).endsWith("/sign-out"))).toBe(false);+ expect(keyField()).not.toBeNull();+ });++ it("opens the service's own page for making a key", async () => {+ await mount();+ await act(async () => button(app, `Get a ${app.label} key`).click());+ expect(openExternalLink).toHaveBeenCalledWith(app.key.url);+ });+});+describe("the Agentcard tile", () => {it("draws a glyph and never an Agentcard logo, and says Agentcard keeps the cards", async () => {await mount();diff --git a/src/components/McpServersPanel.tsx b/src/components/McpServersPanel.tsxindex eb864a6826..c3ba95dda6 100644--- a/src/components/McpServersPanel.tsx+++ b/src/components/McpServersPanel.tsx@@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";import {Check,CheckCircle2,+ ExternalLink,FlaskConical,Globe,Loader2,@@ -30,7 +31,7 @@ import { HostedMcpIcon } from "./HostedMcpIcon";import type { McpMessage } from "./McpResultBudgetField";import { McpServerEditor, type McpServerSubmission } from "./McpServerEditor";import { isRemoteMcpListing, type McpServerListing } from "./mcp-draft";-import { HOSTED_MCP_APPS, hostedConnections, hostedMcpApp, hostedServerName, type HostedApp, type HostedConnections, type HostedMcpAppId } from "@/lib/hosted-mcp-apps";+import { HOSTED_KEY_HEADER, HOSTED_MCP_APPS, hostedConnections, hostedMcpApp, hostedServerName, type HostedApp, type HostedConnections, type HostedMcpAppId } from "@/lib/hosted-mcp-apps";import { POSTIZ_SERVER } from "../../shared/postiz";import { CHAT_TOOL_LIMIT, chatToolBudgetFit } from "../../shared/tool-budget";import { openBotSettings } from "./bot-panel/panel-link";@@ -68,13 +69,14 @@ async function toolsCheck(export async function signedInToolsCheck(name: string,request: (path: string, init?: RequestInit) => Promise<ProbeResult>,- signal: AbortSignal,+ signal: AbortSignal | undefined,service: string,+ failed: LocaleKey = "hostedMcp.testFailed",): Promise<ProbeResult> {const tested = await toolsCheck(name, request, signal);if (tested.ok) return tested;const reason = (tested.error ?? "").trim();- return { ...tested, error: t("hostedMcp.testFailed", { service, reason: reason && !/[.!?]$/.test(reason) ? `${reason}.` : reason }) };+ return { ...tested, error: t(failed, { service, reason: reason && !/[.!?]$/.test(reason) ? `${reason}.` : reason }) };}/** Security: names the headers, never their values. */@@ -131,6 +133,7 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = faconst [connecting, setConnecting] = useState<string | null>(null);/** A failed card action belongs to that card alone: the cards share one instance, and `error` shows on every one. */const [cardFailure, setCardFailure] = useState<{ id: HostedMcpAppId; message: string } | null>(null);+ const [keys, setKeys] = useState<Partial<Record<HostedMcpAppId, string>>>({});const loadGeneration = useRef(0);const mounted = useRef(true);const hostedOf = (server: McpServerListing) => isRemoteMcpListing(server) ? hostedMcpApp(server) : undefined;@@ -377,6 +380,7 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = faconst connectHosted = async (app: HostedApp) => {if (!servers || busy !== null || signingIn !== null) return;const existing = servers.find((server) => hostedOf(server) === app);+ if ("key" in app) { await connectWithKey(app, existing); return; }if (existing) { await signIn(existing); return; }setBusy(`hosted:${app.id}`);loadGeneration.current += 1;@@ -396,6 +400,34 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = faif (added && mounted.current) await signIn(added);};+ const connectWithKey = async (app: Extract<HostedApp, { key: unknown }>, existing: McpServerListing | undefined) => {+ const key = keys[app.id]?.trim();+ if (!servers || !key) return;+ setBusy(`hosted:${app.id}`);+ loadGeneration.current += 1;+ setError(null);+ setCardFailure(null);+ setNotice(null);+ const name = existing?.name ?? hostedServerName(app, servers);+ forgetProbe(name);+ try {+ const entry = { type: "http", url: app.url, headers: { [HOSTED_KEY_HEADER]: `Bearer ${key}` }, enabled: false };+ listed((await api(existing ? `/api/mcp/servers/${name}` : "/api/mcp/servers", {+ method: existing ? "PUT" : "POST",+ body: JSON.stringify(existing ? entry : { name, ...entry }),+ })).servers);+ const tested = await signedInToolsCheck(name, api, undefined, app.label, "hostedMcp.keyTestFailed");+ if (!mounted.current) return;+ setProbe((current) => ({ ...current, [name]: tested.reason === "keys" ? { ...tested, error: t("hostedMcp.keyRefused", { service: app.label }) } : tested }));+ if (!tested.ok) return;+ listed((await api(`/api/mcp/servers/${name}`, { method: "PATCH", body: JSON.stringify({ enabled: true }) })).servers);+ setKeys((current) => ({ ...current, [app.id]: "" }));+ setNotice({ key: "hostedMcp.connected", params: { service: app.label } });+ } catch (cause) {+ if (mounted.current) setCardFailure({ id: app.id, message: cause instanceof Error ? cause.message : String(cause) });+ } finally { if (mounted.current) setBusy(null); }+ };+const completeSignIn = async () => {if (!signingIn || !signInFlow?.flowId || completingSignIn) return;const controller = signInAbort.current;@@ -419,6 +451,11 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fasetNotice(null);forgetProbe(server.name);try {+ // A key card's server is the key, so disconnecting removes it and the key with it.+ if (card && "key" in card) {+ listed((await api(`/api/mcp/servers/${server.name}`, { method: "DELETE" })).servers);+ return;+ }if (hostedOf(server)) {listed((await api(`/api/mcp/servers/${server.name}`, { method: "PATCH", body: JSON.stringify({ enabled: false }) })).servers);}@@ -513,13 +550,24 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa</div>{server && signingIn === server.name ? <button type="button" onClick={() => signInAbort.current?.abort()} className="inline-flex h-7 shrink-0 items-center rounded-full bg-control/80 px-3 text-[13px] font-medium leading-5 text-ink">{t("mcp.auth.cancel")}</button> :<button type="button" aria-label={t(connected ? "hostedMcp.disconnect" : "hostedMcp.connect", { service: app.label })}- disabled={pending || (servers !== null && !connected && (Boolean(server?.managedBy) || (restricted && !policy?.mcp.allowlist.length)))}+ disabled={pending || (servers !== null && !connected && (Boolean(server?.managedBy) || (restricted && !policy?.mcp.allowlist.length) || ("key" in app && !keys[app.id]?.trim())))}onClick={() => void (servers === null ? load() : connected && server ? signOut(server, app) : connectHosted(app))}className="inline-flex h-7 min-w-[64px] shrink-0 items-center justify-center gap-2 rounded-full bg-control/80 px-3 text-[13px] font-medium leading-5 text-ink hover:bg-raised-hover disabled:opacity-40">{pending && (mine || busy === "load") ? <Loader2 size={14} className="animate-spin" /> : servers === null ? t("connectors.action.retry") : t(connected ? "connectors.disconnect" : "connectors.action.connect")}</button>}</div><div className="ps-[52px]">+ {"key" in app && !connected && servers !== null && <div className="mt-2 flex flex-col items-start gap-2">+ <input type="password" value={keys[app.id] ?? ""} disabled={pending} autoComplete="off" spellCheck={false}+ aria-label={t("hostedMcp.keyLabel", { service: app.label })} placeholder={t("hostedMcp.keyPlaceholder", { service: app.label })}+ onChange={(event) => { const value = event.target.value; setKeys((current) => ({ ...current, [app.id]: value })); }}+ onKeyDown={(event) => { if (event.key === "Enter") void connectHosted(app); }}+ className="h-8 w-full min-w-0 rounded-lg bg-inset px-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none focus:ring-1 focus:ring-accent/50" />+ <button type="button" onClick={() => void openExternalLink(app.key.url)} className="inline-flex items-center gap-1 text-[12px] font-medium text-accent-text hover:underline">+ {t("hostedMcp.getKey", { service: app.label })}+ <ExternalLink size={11} aria-hidden="true" />+ </button>+ </div>}{failed && <p role="alert" className="mt-1.5 text-[12px] text-danger">{typeof failed === "string" ? failed : t(failed.key, failed.params)}</p>}{server && renderSignIn(server)}<details className="mt-1 text-[12px] text-ink-secondary">diff --git a/src/lib/hosted-mcp-apps.test.ts b/src/lib/hosted-mcp-apps.test.tsindex 5c93eb853f..0a17aa85f5 100644--- a/src/lib/hosted-mcp-apps.test.ts+++ b/src/lib/hosted-mcp-apps.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { HOSTED_MCP_APPS, hostedConnections, hostedMcpApp, hostedServerName } from "./hosted-mcp-apps";+import { HOSTED_MCP_APPS, hostedConnections, hostedMcpApp, hostedServerName, type HostedApp } from "./hosted-mcp-apps";describe("hosted MCP apps", () => {it("has unique ids that are valid server names and unique https endpoints", () => {@@ -31,14 +31,31 @@ describe("hosted MCP apps", () => {expect(hostedServerName(app, [{ name: app.id }, { name: `${app.id}-2` }])).toBe(`${app.id}-3`);expect(hostedServerName(app, [{ name: `${app.id}-2` }])).toBe(app.id);});- it("is connected only while its server is on and signed in", () => {- const server = { type: "http", url: app.url };- const connected = (extra: { enabled: boolean; auth?: "signed-in" | "needs-sign-in" }) => hostedConnections([{ ...server, ...extra }])[app.id];- expect(connected({ enabled: true, auth: "signed-in" })).toBe(true);- expect(connected({ enabled: true })).toBe(false);- expect(connected({ enabled: true, auth: "needs-sign-in" })).toBe(false);- expect(connected({ enabled: false, auth: "signed-in" })).toBe(false);- });+ });++ type Extra = { enabled: boolean; auth?: "signed-in" | "needs-sign-in"; headerKeys?: string[] };+ const connectedWith = (app: HostedApp, extra: Extra) => hostedConnections([{ type: "http", url: app.url, ...extra }])[app.id];++ it.each(HOSTED_MCP_APPS.filter((app) => !("key" in app)))("$label is connected only while its server is on and signed in", (app) => {+ expect(connectedWith(app, { enabled: true, auth: "signed-in" })).toBe(true);+ expect(connectedWith(app, { enabled: true })).toBe(false);+ expect(connectedWith(app, { enabled: true, auth: "needs-sign-in" })).toBe(false);+ expect(connectedWith(app, { enabled: false, auth: "signed-in" })).toBe(false);+ expect(connectedWith(app, { enabled: true, headerKeys: ["Authorization"] })).toBe(false);+ });++ it.each(HOSTED_MCP_APPS.filter((app) => "key" in app))("$label is connected only while its server is on and holds its key", (app) => {+ expect(connectedWith(app, { enabled: true, headerKeys: ["Authorization"] })).toBe(true);+ expect(connectedWith(app, { enabled: true, headerKeys: ["authorization"] })).toBe(true);+ expect(connectedWith(app, { enabled: true, headerKeys: [] })).toBe(false);+ expect(connectedWith(app, { enabled: true, headerKeys: ["X-Api-Key"] })).toBe(false);+ expect(connectedWith(app, { enabled: false, headerKeys: ["Authorization"] })).toBe(false);+ expect(connectedWith(app, { enabled: true, auth: "signed-in" })).toBe(false);+ });++ it("takes a pasted key exactly for the services with no browser sign-in, each with an https page to make one", () => {+ expect(HOSTED_MCP_APPS.filter((app) => "key" in app).map((app) => app.id)).toEqual(["vapi", "telnyx"]);+ for (const app of HOSTED_MCP_APPS) if ("key" in app) expect(app.key.url).toMatch(/^https:\/\//);});it("counts each app on its own server", () => {diff --git a/src/lib/hosted-mcp-apps.ts b/src/lib/hosted-mcp-apps.tsindex 27e5a81045..65b6fb638c 100644--- a/src/lib/hosted-mcp-apps.ts+++ b/src/lib/hosted-mcp-apps.ts@@ -1,4 +1,4 @@-import { CreditCard, type LucideIcon } from "lucide-react";+import { CreditCard, Mail, PhoneCall, RadioTower, Smartphone, type LucideIcon } from "lucide-react";import whopLogo from "@/assets/whop/logo.png";import type { LocaleKey } from "@/locales";@@ -8,8 +8,11 @@ export interface HostedMcpApp {readonly id: string;/** The service's own name, never translated. */readonly label: string;- /** Its official hosted MCP endpoint, which signs in with browser OAuth instead of a pasted key. A server is this app only at exactly this address, over streamable HTTP. */+ /** Its official hosted MCP endpoint. A server is this app only at exactly this address, over streamable HTTP. */readonly url: string;+ /** A service with no browser sign-in takes a key the person pastes, sent as `Authorization: Bearer`; `url` is where+ * they make one. Without it the card signs in with browser OAuth. */+ readonly key?: { readonly url: string };/** Its licensed logo, or a neutral lucide glyph when the service publishes none we may ship. */readonly icon: { readonly image: string } | { readonly glyph: LucideIcon };readonly description: LocaleKey;@@ -41,6 +44,45 @@ export const HOSTED_MCP_APPS = [notice: "agentcard.notice",keywords: "agentcard agent card opencommerce shopping payments buy virtual debit card",},+ // None of these four publishes a logo licence we have checked, so neutral glyphs stand in.+ {+ id: "agentmail",+ label: "AgentMail",+ url: "https://mcp.agentmail.to/mcp",+ icon: { glyph: Mail },+ description: "agentmail.description",+ notice: "agentmail.notice",+ keywords: "agentmail email inbox mail address send reply",+ },+ {+ id: "vapi",+ label: "Vapi",+ url: "https://mcp.vapi.ai/mcp",+ key: { url: "https://dashboard.vapi.ai" },+ icon: { glyph: PhoneCall },+ description: "vapi.description",+ notice: "vapi.notice",+ keywords: "vapi phone call calls voice dial assistant",+ },+ {+ id: "telnyx",+ label: "Telnyx",+ url: "https://api.telnyx.com/v2/mcp",+ key: { url: "https://portal.telnyx.com/#/api-keys" },+ icon: { glyph: RadioTower },+ description: "telnyx.description",+ notice: "telnyx.notice",+ keywords: "telnyx phone number numbers sms text call calls international",+ },+ {+ id: "agentphone",+ label: "AgentPhone",+ url: "https://mcp.agentphone.ai/mcp",+ icon: { glyph: Smartphone },+ description: "agentphone.description",+ notice: "agentphone.notice",+ keywords: "agentphone phone number sms text call calls",+ },] as const satisfies readonly HostedMcpApp[];/** A row of the table, with its own literal id. */@@ -72,12 +114,16 @@ export function hostedServerName(app: HostedMcpApp, servers: ReadonlyArray<{ namreturn name;}-/** The one rule for "connected", shared by the cards, the Connected filter and the count: the server is on and signed in. */+export const HOSTED_KEY_HEADER = "Authorization";++/** The one rule for "connected", shared by the cards, the Connected filter and the count: the server is on and signed+ * in, or for a key app, on and holding its key. */export function hostedConnections(- servers: ReadonlyArray<ServerAddress & { enabled: boolean; auth?: "signed-in" | "needs-sign-in" }>,+ servers: ReadonlyArray<ServerAddress & { enabled: boolean; auth?: "signed-in" | "needs-sign-in"; headerKeys?: readonly string[] }>,): HostedConnections {+ const holdsKey = (server: (typeof servers)[number]) => server.headerKeys?.some((name) => name.toLowerCase() === HOSTED_KEY_HEADER.toLowerCase()) === true;return Object.fromEntries(HOSTED_MCP_APPS.map((app) => [app.id,- servers.some((server) => hostedMcpApp(server) === app && server.enabled && server.auth === "signed-in"),+ servers.some((server) => hostedMcpApp(server) === app && server.enabled && ("key" in app ? holdsKey(server) : server.auth === "signed-in")),])) as HostedConnections;}diff --git a/src/locales/en.json b/src/locales/en.jsonindex eba521b983..73b0602086 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -34,6 +34,19 @@"hostedMcp.loadingTools": "Signed in. Loading {service}’s tools…","agentcard.description": "Shop and pay from your own Agentcard account.","agentcard.notice": "Sign in with your Agentcard account. No API key needed. Agentcard keeps your cards and handles purchase approvals; OpenMausBot stores no card details. A bot that can use Agentcard can call all of its tools, including buying and showing card details, so choose which bots get it under Bot access.",+ "hostedMcp.keyLabel": "{service} API key",+ "hostedMcp.keyPlaceholder": "Paste your {service} key",+ "hostedMcp.getKey": "Get a {service} key",+ "hostedMcp.keyRefused": "{service} didn’t accept that key. Check it and connect again.",+ "hostedMcp.keyTestFailed": "{service}’s tools could not be loaded with that key: {reason} Connect again to retry.",+ "agentmail.description": "Email inboxes your bots send and receive from, on your own AgentMail account.",+ "agentmail.notice": "Sign in with your AgentMail account. No API key needed. A bot that can use AgentMail can make inboxes, read their mail and send from them, billed to your account, so choose which bots get it under Bot access. Sending follows Sending on your behalf. To have a bot answer new mail, add a webhook for that bot in Automations and paste its address into AgentMail.",+ "vapi.description": "Phone calls your bots place and answer, on your own Vapi account.",+ "vapi.notice": "Paste a private API key from your Vapi dashboard. OpenMausBot never shows it again, and Disconnect deletes it. A bot that can use Vapi can place calls billed to your account, and each call follows Sending on your behalf, so choose which bots get it under Bot access. Have your Vapi assistant open every call by saying it is an automated assistant calling for you and that the call is recorded.",+ "telnyx.description": "Phone numbers in many countries, texts and calls, on your own Telnyx account.",+ "telnyx.notice": "Paste an API key from your Telnyx portal. OpenMausBot never shows it again, and Disconnect deletes it. Telnyx reaches its whole API through one tool, so every Telnyx action a bot takes follows Sending on your behalf, including buying numbers billed to your account. Choose which bots get it under Bot access. To have a bot answer texts, add a webhook for that bot in Automations and set it on your Telnyx messaging profile.",+ "agentphone.description": "US and Canadian numbers for your bots, with texts and calls, on your own AgentPhone account.",+ "agentphone.notice": "Sign in with your AgentPhone account. No API key needed. A bot that can use AgentPhone can buy numbers, text and place calls, billed to your account; each of those follows Sending on your behalf, so choose which bots get it under Bot access. To have a bot answer texts and calls, add a webhook for that bot in Automations and set it in AgentPhone.","email.title": "Email","email.description": "Read and send mail on any mail host, with your address and password.","email.menu": "Email options",