diff --git a/docs/custom-mcp-servers.md b/docs/custom-mcp-servers.md index ca9374f556b..d3d2b997eed 100644 --- a/docs/custom-mcp-servers.md +++ b/docs/custom-mcp-servers.md @@ -126,6 +126,29 @@ key named **MCP Client** under **Settings → API Keys**, where revoking it ends the connection. The key lasts one year, then the card asks you to sign in again. See [BubblaV's OpenMausBot guide](https://docs.bubblav.com/user-guide/integrations/openmausbot). +### Gemini Notebook + +In Plugins, find **Gemini Notebook** and click **Connect**. The card uses +Google's official hosted MCP endpoint, `https://notebook.googleapis.com/mcp` +(Gemini Notebook API, public preview). Google signs in only an app you +register yourself, so the card asks for its client ID and secret first: + +1. In a Google Cloud project of your own, enable the API: + `gcloud services enable notebook.googleapis.com --project=`. No + billing account is needed. +2. Under **Google Auth Platform**, set up the consent screen for an + **External** audience, add yourself under **Test users**, and add the + scope `https://www.googleapis.com/auth/notebook` under **Data access**. +3. Under **Clients**, create a **Desktop app** client and paste its client ID + and secret into the card. + +**Connect** then opens Google's sign-in. The card saves the app like +**Sign-in app** below, so later sign-ins need no paste. While the API is in +preview it accepts personal Google accounts only, and each account must have +opened `notebook.google.com` once. Its tools create, list and rename notebooks +and add web, YouTube and text sources; it cannot delete, upload files or read a +notebook's contents yet. + ### Servers that ask you to sign in Some URL servers take no token; they want you to sign in with your browser @@ -160,7 +183,9 @@ has nothing to work on. Background checks never do this. address or removing the server drops them. **Sign out** revokes them when the server offers that, then forgets them. - **Refresh.** A token is refreshed shortly before it expires. If the server - refuses the refresh, the server goes back to **Needs sign-in**. + refuses the refresh, the server goes back to **Needs sign-in**. Google + issues a refresh token only when asked for offline access, so a sign-in at + `accounts.google.com` asks for it and shows Google's consent page each time. #### Signing in from another computer diff --git a/server/mcp-oauth-vendor-wiring.test.ts b/server/mcp-oauth-vendor-wiring.test.ts new file mode 100644 index 00000000000..b423256b1d0 --- /dev/null +++ b/server/mcp-oauth-vendor-wiring.test.ts @@ -0,0 +1,55 @@ +import { mkdtempSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + +const vendor = vi.hoisted(() => ({ issuer: "", calls: [] as string[] })); +vi.mock("./mcp-oauth-vendor.ts", () => ({ + vendorAuthorizationParams: (issuer: string) => { + vendor.calls.push(issuer); + return issuer === vendor.issuer ? { access_type: "offline", prompt: "consent" } : {}; + }, +})); + +import { McpOAuthManager } from "./mcp-oauth.ts"; +import { startFakeHttpMcp, type FakeHttpMcp } from "./testing/fake-http-mcp-server.ts"; +import { startFakeOAuth, type FakeOAuth } from "./testing/fake-oauth-server.ts"; + +let dir: string; +let oauth: FakeOAuth; +let mcp: FakeHttpMcp; +let manager: McpOAuthManager; + +beforeEach(async () => { + dir = mkdtempSync(join(tmpdir(), "mcp-oauth-vendor-")); + vendor.calls = []; + oauth = await startFakeOAuth(); + mcp = await startFakeHttpMcp({ acceptBearer: oauth.isValid, wwwAuthenticate: oauth.challenge }); + manager = new McpOAuthManager({ file: join(dir, "mcp-oauth.json") }); +}); +afterEach(async () => { + manager.dispose(); + await mcp.close(); + await oauth.close(); + rmSync(dir, { recursive: true, force: true }); +}); + +describe("authorization request parameters a vendor needs", () => { + it("asks the discovered issuer's vendor parameters and puts them on the authorization link", async () => { + vendor.issuer = oauth.issuer; + const started = await manager.start("docs", mcp.url); + expect(vendor.calls).toEqual([oauth.issuer]); + const link = new URL(started.authorizationUrl!); + expect(link.searchParams.get("access_type")).toBe("offline"); + expect(link.searchParams.get("prompt")).toBe("consent"); + expect(link.searchParams.get("code_challenge_method")).toBe("S256"); + }); + + it("adds nothing when the issuer's vendor needs nothing", async () => { + vendor.issuer = "https://accounts.google.com"; + const started = await manager.start("docs", mcp.url); + const link = new URL(started.authorizationUrl!); + expect(link.searchParams.has("access_type")).toBe(false); + expect(link.searchParams.has("prompt")).toBe(false); + }); +}); diff --git a/server/mcp-oauth-vendor.test.ts b/server/mcp-oauth-vendor.test.ts new file mode 100644 index 00000000000..450fead3c79 --- /dev/null +++ b/server/mcp-oauth-vendor.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, it } from "vitest"; + +import { vendorAuthorizationParams } from "./mcp-oauth-vendor.ts"; + +describe("vendorAuthorizationParams", () => { + it("asks Google for offline access and a fresh consent, with or without the trailing slash", () => { + expect(vendorAuthorizationParams("https://accounts.google.com")).toEqual({ access_type: "offline", prompt: "consent" }); + expect(vendorAuthorizationParams("https://accounts.google.com/")).toEqual({ access_type: "offline", prompt: "consent" }); + }); + + it("adds nothing for any other issuer, including look-alikes", () => { + expect(vendorAuthorizationParams("https://login.microsoftonline.com/tenant/v2.0")).toEqual({}); + expect(vendorAuthorizationParams("https://accounts.google.com.evil.example")).toEqual({}); + expect(vendorAuthorizationParams("http://accounts.google.com")).toEqual({}); + }); +}); diff --git a/server/mcp-oauth-vendor.ts b/server/mcp-oauth-vendor.ts new file mode 100644 index 00000000000..6753311427d --- /dev/null +++ b/server/mcp-oauth-vendor.ts @@ -0,0 +1,13 @@ +const GOOGLE_ISSUER = "https://accounts.google.com"; + +/** + * Authorization request parameters an authorization server needs beyond RFC 6749 to issue a refresh token. + * + * Google issues a refresh token only when the request asks for `access_type=offline`, and to an app the account has + * approved before only with `prompt=consent`; it does not honour the `offline_access` scope + * (https://developers.google.com/identity/protocols/oauth2/native-app#step-2:-send-a-request-to-googles-oauth-2.0-server). + * Without them a Google MCP server (Gmail, Calendar, Gemini Notebook) is signed out when its one-hour token expires. + */ +export function vendorAuthorizationParams(issuer: string): Record { + return issuer.replace(/\/+$/u, "") === GOOGLE_ISSUER ? { access_type: "offline", prompt: "consent" } : {}; +} diff --git a/server/mcp-oauth.test.ts b/server/mcp-oauth.test.ts index aafbcd3bb86..7770c12287d 100644 --- a/server/mcp-oauth.test.ts +++ b/server/mcp-oauth.test.ts @@ -62,6 +62,7 @@ describe("McpOAuthManager sign-in", () => { expect(link.origin + link.pathname).toBe(`${oauth.issuer}/authorize`); expect(link.searchParams.get("code_challenge_method")).toBe("S256"); expect(link.searchParams.get("resource")).toBe(mcp.url); + expect(link.searchParams.has("access_type")).toBe(false); expect(link.searchParams.get("redirect_uri")).toMatch(/^http:\/\/127\.0\.0\.1:\d+\/mcp-oauth\/callback$/); const page = await approve(started); diff --git a/server/mcp-oauth.ts b/server/mcp-oauth.ts index a147505210e..20970d544a4 100644 --- a/server/mcp-oauth.ts +++ b/server/mcp-oauth.ts @@ -6,6 +6,7 @@ import { isDeepStrictEqual } from "node:util"; import type { McpServerSpec } from "./contracts.ts"; import { discoverMcpAuth, type McpAuthMetadata } from "./mcp-oauth-discovery.ts"; +import { vendorAuthorizationParams } from "./mcp-oauth-vendor.ts"; import { McpOAuthStore, type McpOAuthRecord, type McpOAuthTokens } from "./mcp-oauth-store.ts"; import type { McpOAuthClientConfig } from "./mcp-registry.ts"; @@ -707,6 +708,7 @@ export class McpOAuthManager { authorize.searchParams.set("code_challenge_method", "S256"); authorize.searchParams.set("resource", meta.resource); if (scopes?.length) authorize.searchParams.set("scope", scopes.join(" ")); + for (const [key, value] of Object.entries(vendorAuthorizationParams(meta.issuer))) authorize.searchParams.set(key, value); const status: McpSignInStatus = { phase: "waiting", diff --git a/src/components/McpServersPanel.hosted.test.ts b/src/components/McpServersPanel.hosted.test.ts index 268effa08a8..334ede99f3b 100644 --- a/src/components/McpServersPanel.hosted.test.ts +++ b/src/components/McpServersPanel.hosted.test.ts @@ -28,7 +28,7 @@ vi.mock("./bot-panel/panel-link", () => ({ openBotSettings: fixture.openBotSetti 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 } +interface Listing { name: string; type: "http"; url: string; headerKeys: string[]; enabled: boolean; auth: "signed-in" | "needs-sign-in"; managedBy?: string; oauth?: { clientId: string; scopes: string[]; clientSecretConfigured: boolean } } const listing = (app: HostedApp, extra: Partial = {}): Listing => ({ name: app.id, type: "http", url: app.url, headerKeys: [], enabled: false, auth: "needs-sign-in", ...extra }); let host: HTMLDivElement; @@ -68,7 +68,11 @@ beforeEach(() => { const body = init?.body ? JSON.parse(init.body as string) : undefined; 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 } & Record) => ({ ...entry, headerKeys: Object.keys(headers ?? {}).sort() }); + const saved = ({ headers, oauth, ...entry }: { headers?: Record; oauth?: { clientId: string; clientSecret?: string; scopes?: string[] } } & Record) => ({ + ...entry, + headerKeys: Object.keys(headers ?? {}).sort(), + ...(oauth ? { oauth: { clientId: oauth.clientId, scopes: oauth.scopes ?? [], clientSecretConfigured: Boolean(oauth.clientSecret) } } : {}), + }); if (path === "/api/mcp/servers" && init?.method === "POST") { servers.push({ auth: "needs-sign-in", ...saved(body) } as Listing); return Promise.resolve({ servers: structuredClone(servers) }); @@ -93,7 +97,7 @@ afterEach(async () => { host.remove(); }); -describe.each(HOSTED_MCP_APPS.filter((app) => !("key" in app)))("The $label card", (app) => { +describe.each(HOSTED_MCP_APPS.filter((app) => !("key" in app) && !("client" in app)))("The $label card", (app) => { async function connect() { await act(async () => button(app, "Connect").click()); await settle(); @@ -410,3 +414,127 @@ describe("the person's own MCP servers in the Connected view", () => { expect(host.querySelector("[data-mcp-tile]")).toBeNull(); }); }); + +describe.each(HOSTED_MCP_APPS.filter((app) => "client" in app))("The $label card, which signs in only an app registered in advance", (app) => { + const field = (label: string) => card(app).querySelector(`input[aria-label="${label}"]`)!; + const idField = () => field(`${app.label} client ID`); + const secretField = () => field(`${app.label} client secret`); + const connectButton = () => button(app, "Connect") as HTMLButtonElement; + + async function type(input: HTMLInputElement, value: string) { + await act(async () => { + Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, value); + input.dispatchEvent(new Event("input", { bubbles: true })); + }); + } + + async function connectWith(clientId: string, secret: string) { + await type(idField(), clientId); + await type(secretField(), secret); + await act(async () => connectButton().click()); + await settle(); + } + + it("keeps Connect off until both a client ID and its secret are typed, and hides the secret", async () => { + await mount(); + expect(secretField().type).toBe("password"); + expect(connectButton().disabled).toBe(true); + await type(idField(), "123.apps.googleusercontent.com"); + expect(connectButton().disabled).toBe(true); + await type(secretField(), " "); + expect(connectButton().disabled).toBe(true); + await type(secretField(), "GOCSPX-secret"); + expect(connectButton().disabled).toBe(false); + }); + + it("saves the app with its scopes on a server left off, then signs in as that app", async () => { + await mount(); + await connectWith(" 123.apps.googleusercontent.com ", " GOCSPX-secret "); + expect(added()).toEqual([{ + name: app.id, type: "http", url: app.url, enabled: false, + oauth: { clientId: "123.apps.googleusercontent.com", clientSecret: "GOCSPX-secret", scopes: [...app.client.scopes] }, + }]); + expect(fixture.runMcpSignIn).toHaveBeenCalledWith(app.id, expect.anything()); + expect(fixture.api.mock.calls.map(([path]) => String(path)).some((path) => path.includes("GOCSPX"))).toBe(false); + }); + + it("signs in again with the saved app without asking for it", async () => { + servers = [listing(app, { oauth: { clientId: "123.apps.googleusercontent.com", scopes: [...app.client.scopes], clientSecretConfigured: true } })]; + await mount(); + expect(card(app).textContent).toContain("Signs in with the saved app 123.apps.googleusercontent.com."); + expect(connectButton().disabled).toBe(false); + await act(async () => connectButton().click()); + await settle(); + expect(added()).toEqual([]); + expect(calls("PUT")).toEqual([]); + expect(fixture.runMcpSignIn).toHaveBeenCalledWith(app.id, expect.anything()); + }); + + it("replaces the app on the server it already has, under any name, instead of adding another", async () => { + servers = [listing(app, { name: "notebooks", oauth: { clientId: "old", scopes: [], clientSecretConfigured: true } })]; + await mount(); + await connectWith("new.apps.googleusercontent.com", "GOCSPX-new"); + expect(added()).toEqual([]); + expect(calls("PUT")).toEqual([["/api/mcp/servers/notebooks", { + type: "http", url: app.url, enabled: false, + oauth: { clientId: "new.apps.googleusercontent.com", clientSecret: "GOCSPX-new", scopes: [...app.client.scopes] }, + }]]); + expect(fixture.runMcpSignIn).toHaveBeenCalledWith("notebooks", expect.anything()); + }); + + it("opens the provider's page for registering the app", async () => { + await mount(); + await act(async () => button(app, `Create a ${app.label} sign-in app`).click()); + expect(openExternalLink).toHaveBeenCalledWith(app.client.url); + }); + + const savedApp = { clientId: "123.apps.googleusercontent.com", scopes: [...app.client.scopes], clientSecretConfigured: true }; + + it("never signs in with the saved app while a half-typed replacement is in the fields", async () => { + servers = [listing(app, { oauth: savedApp })]; + await mount(); + await type(secretField(), "GOCSPX-new"); + expect(connectButton().disabled).toBe(true); + await act(async () => secretField().dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }))); + await settle(); + expect(fixture.runMcpSignIn).not.toHaveBeenCalled(); + expect(calls("PUT")).toEqual([]); + }); + + it("turns the server on once its tools load after sign-in", async () => { + await mount(); + await connectWith("123.apps.googleusercontent.com", "GOCSPX-secret"); + await act(async () => testRequest!.resolve({ ok: true, tools: [{ name: "list_notebooks" }] })); + await settle(); + expect(calls("PATCH")).toEqual([[`/api/mcp/servers/${app.id}`, { enabled: true }]]); + }); + + it("turns the server off and signs out on Disconnect, keeping the saved app", async () => { + servers = [listing(app, { enabled: true, auth: "signed-in", oauth: savedApp })]; + await mount(); + expect(card(app).querySelector('[aria-label="Connected"]')).not.toBeNull(); + await act(async () => button(app, "Disconnect").click()); + await settle(); + expect(calls("DELETE")).toEqual([]); + expect(fixture.api.mock.calls.map(([path]) => path).slice(-2)).toEqual([`/api/mcp/servers/${app.id}`, `/api/mcp/servers/${app.id}/sign-out`]); + expect(card(app).textContent).toContain("Signs in with the saved app 123.apps.googleusercontent.com."); + }); + + it("cannot connect, by button or Enter, a server the organization manages or a policy that allows no custom servers", async () => { + servers = [listing(app, { managedBy: "Acme", oauth: savedApp })]; + await mount(); + expect(connectButton().disabled).toBe(true); + expect(idField().disabled).toBe(true); + expect(secretField().disabled).toBe(true); + await act(async () => secretField().dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }))); + await settle(); + expect(fixture.runMcpSignIn).not.toHaveBeenCalled(); + await act(async () => root.unmount()); + host.remove(); + servers = []; + fixture.store = { ...fixture.store, config: { managedPolicy: { organizationName: "Acme", mcp: { allowCustom: false, allowlist: [] } } } }; + await mount(); + expect(connectButton().disabled).toBe(true); + expect(secretField().disabled).toBe(true); + }); +}); diff --git a/src/components/McpServersPanel.tsx b/src/components/McpServersPanel.tsx index e2196d1b005..c1438013c3c 100644 --- a/src/components/McpServersPanel.tsx +++ b/src/components/McpServersPanel.tsx @@ -79,6 +79,10 @@ export async function signedInToolsCheck( return { ...tested, error: t(failed, { service, reason: reason && !/[.!?]$/.test(reason) ? `${reason}.` : reason }) }; } +function savedClient(server: McpServerListing): string | undefined { + return isRemoteMcpListing(server) && server.oauth?.clientId && server.oauth.clientSecretConfigured ? server.oauth.clientId : undefined; +} + /** Security: names the headers, never their values. */ function failureReason(server: McpServerListing, result: ProbeResult): string { if (result.reason !== "keys" || !isRemoteMcpListing(server)) return result.error ?? ""; @@ -138,6 +142,7 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa /** 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>>({}); + const [clients, setClients] = useState>>({}); const [loadError, setLoadError] = useState(null); const loadGeneration = useRef(0); const mounted = useRef(true); @@ -394,6 +399,7 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa 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 ("client" in app) { await connectWithClient(app, existing); return; } if (existing) { await signIn(existing); return; } setBusy(`hosted:${app.id}`); loadGeneration.current += 1; @@ -441,6 +447,35 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa } finally { if (mounted.current) setBusy(null); } }; + const connectWithClient = async (app: Extract, existing: McpServerListing | undefined) => { + if (!servers) return; + const typed = clients[app.id]; + const clientId = typed?.id.trim() ?? ""; + const secret = typed?.secret.trim() ?? ""; + if (!clientId && !secret && existing && savedClient(existing)) { await signIn(existing); return; } + if (!clientId || !secret) return; + setBusy(`hosted:${app.id}`); + loadGeneration.current += 1; + setError(null); + setCardFailure(null); + setNotice(null); + const name = existing?.name ?? hostedServerName(app, servers); + forgetProbe(name); + let saved: McpServerListing | undefined; + try { + const entry = { type: "http", url: app.url, oauth: { clientId, clientSecret: secret, scopes: [...app.client.scopes] }, enabled: false }; + saved = listed((await api(existing ? `/api/mcp/servers/${name}` : "/api/mcp/servers", { + method: existing ? "PUT" : "POST", + body: JSON.stringify(existing ? entry : { name, ...entry }), + })).servers).find((server: McpServerListing) => server.name === name && hostedOf(server) === app); + if (!saved) throw new Error(t("hostedMcp.setupFailed", { service: app.label })); + setClients((current) => ({ ...current, [app.id]: { id: "", secret: "" } })); + } catch (cause) { + if (mounted.current) setCardFailure({ id: app.id, message: cause instanceof Error ? cause.message : String(cause) }); + } finally { if (mounted.current) setBusy(null); } + if (saved && mounted.current) await signIn(saved); + }; + const completeSignIn = async () => { if (!signingIn || !signInFlow?.flowId || completingSignIn) return; const controller = signInAbort.current; @@ -544,6 +579,38 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa ); } + function clientReady(app: HostedApp, server: McpServerListing | undefined): boolean { + const typed = clients[app.id]; + const clientId = typed?.id.trim(); + const secret = typed?.secret.trim(); + return clientId || secret ? Boolean(clientId && secret) : Boolean(server && savedClient(server)); + } + + function connectBlocked(server: McpServerListing | undefined): boolean { + return Boolean(server?.managedBy) || (restricted && !policy?.mcp.allowlist.length); + } + + function renderClientFields(app: Extract, server: McpServerListing | undefined, locked: boolean) { + const typed = clients[app.id] ?? { id: "", secret: "" }; + const set = (patch: Partial<{ id: string; secret: string }>) => setClients((current) => ({ ...current, [app.id]: { ...typed, ...current[app.id], ...patch } })); + const field = "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"; + const saved = server ? savedClient(server) : undefined; + return
+ {saved &&

{t("hostedMcp.clientSaved", { clientId: saved })}

} + set({ id: event.target.value })} className={field} /> + set({ secret: event.target.value })} + onKeyDown={(event) => { if (event.key === "Enter" && !locked && clientReady(app, server)) void connectHosted(app); }} className={field} /> + +
; + } + function renderHostedCard(app: HostedApp) { const server = servers?.find((listed) => hostedOf(listed) === app); const connected = Boolean(connections?.[app.id]); @@ -563,7 +630,7 @@ export function McpServersPanel({ embedded = false, hostedCards, hideHosted = fa {server && signingIn === server.name ? : } + {"client" in app && !connected && servers !== null && renderClientFields(app, server, pending || connectBlocked(server))} {failed &&

{typeof failed === "string" ? failed : t(failed.key, failed.params)}

} {server && renderSignIn(server)}
diff --git a/src/lib/hosted-mcp-apps.test.ts b/src/lib/hosted-mcp-apps.test.ts index e55a817bcfc..f7b712a4f2c 100644 --- a/src/lib/hosted-mcp-apps.test.ts +++ b/src/lib/hosted-mcp-apps.test.ts @@ -54,6 +54,16 @@ describe("hosted MCP apps", () => { expect(connectedWith(app, { enabled: true, auth: "signed-in" })).toBe(false); }); + it("takes a registered app exactly for the services that sign in no other, each with an https page to make one and its scopes", () => { + expect(HOSTED_MCP_APPS.filter((app) => "client" in app).map((app) => app.id)).toEqual(["gemini-notebook"]); + for (const app of HOSTED_MCP_APPS) { + if (!("client" in app)) continue; + expect(app.client.url).toMatch(/^https:\/\//); + expect(app.client.scopes.length).toBeGreaterThan(0); + expect("key" in app).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:\/\//); diff --git a/src/lib/hosted-mcp-apps.ts b/src/lib/hosted-mcp-apps.ts index 2bad09d2c13..a7f3725d6a9 100644 --- a/src/lib/hosted-mcp-apps.ts +++ b/src/lib/hosted-mcp-apps.ts @@ -1,4 +1,4 @@ -import { Blocks, Clapperboard, CreditCard, Mail, PhoneCall, RadioTower, Smartphone, type LucideIcon } from "lucide-react"; +import { Blocks, Clapperboard, CreditCard, Mail, NotebookPen, PhoneCall, RadioTower, Smartphone, type LucideIcon } from "lucide-react"; import bubblavLogo from "@/assets/bubblav/logo.png"; import whopLogo from "@/assets/whop/logo.png"; @@ -15,6 +15,9 @@ export interface HostedMcpApp { /** 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 }; + /** A service that signs in only an app registered in advance, with no self-registration: the person pastes that app's + * client ID and secret, made at `url`, and the card signs in with browser OAuth as that app with these scopes. */ + readonly client?: { readonly url: string; readonly scopes: readonly 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; @@ -104,6 +107,17 @@ export const HOSTED_MCP_APPS = [ notice: "higgsfield.notice", keywords: "higgsfield ai image video generate generation picture clip film soul kling seedance", }, + { + id: "gemini-notebook", + label: "Gemini Notebook", + url: "https://notebook.googleapis.com/mcp", + client: { url: "https://console.cloud.google.com/auth/clients", scopes: ["https://www.googleapis.com/auth/notebook"] }, + // Google's product logos are not licensed for this use, so a neutral glyph stands in. + icon: { glyph: NotebookPen }, + description: "geminiNotebook.description", + notice: "geminiNotebook.notice", + keywords: "gemini notebook notebooklm google notebooks sources research", + }, { id: "composio-connect", label: "Composio Connect", diff --git a/src/locales/en.json b/src/locales/en.json index 044c99d0d8c..e82daf5e9ba 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -37,6 +37,12 @@ "hostedMcp.keyLabel": "{service} API key", "hostedMcp.keyPlaceholder": "Paste your {service} key", "hostedMcp.getKey": "Get a {service} key", + "hostedMcp.clientIdLabel": "{service} client ID", + "hostedMcp.clientIdPlaceholder": "Client ID of your sign-in app", + "hostedMcp.clientSecretLabel": "{service} client secret", + "hostedMcp.clientSecretPlaceholder": "Client secret of your sign-in app", + "hostedMcp.clientSaved": "Signs in with the saved app {clientId}. Paste another client ID and secret to replace it.", + "hostedMcp.getClient": "Create a {service} sign-in app", "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.", @@ -51,6 +57,8 @@ "bubblav.notice": "Sign in with BubblaV and choose one chatbot. No API key needed. With Full access, a bot that can use BubblaV can read that chatbot’s conversations and leads and change or delete its knowledge and settings, so choose which bots get it under Bot access. Choose Read only on BubblaV’s consent page to block every change.", "higgsfield.description": "AI images and videos your bots make with Higgsfield models, on your own Higgsfield account.", "higgsfield.notice": "Sign in with your Higgsfield account. No API key needed. A bot that can use Higgsfield can start image and video generations that spend credits on your account, so choose which bots get it under Bot access.", + "geminiNotebook.description": "Create Gemini Notebook (NotebookLM) notebooks and add web, YouTube and text sources, through Google's official MCP server.", + "geminiNotebook.notice": "Google signs in only an app you register yourself. In a Google Cloud project, enable the Gemini Notebook API, add the notebook scope and yourself as a test user, then create a Desktop app OAuth client and paste its client ID and secret here. Personal Google accounts only while the API is in preview. A bot that can use Gemini Notebook can create and rename notebooks and add sources, but cannot delete them or read their contents yet.", "composioConnect.description": "Your own Composio account over one MCP connection: the apps already authorized there, without signing in to each one again.", "composioConnect.notice": "Sign in with Composio. One connection carries every app authorized in your Composio account, so choose which bots can reach it under Bot access. It is separate from Connected apps: OpenMausBot's own Composio key and its per-app controls do not apply here.", "email.title": "Email", diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json index 29d6d06e276..f6085e3fbe9 100644 --- a/src/locales/pt-br.json +++ b/src/locales/pt-br.json @@ -53,6 +53,12 @@ "hostedMcp.keyLabel": "Chave de API de {service}", "hostedMcp.keyPlaceholder": "Cole sua chave de {service}", "hostedMcp.getKey": "Obter uma chave de {service}", + "hostedMcp.clientIdLabel": "ID do cliente de {service}", + "hostedMcp.clientIdPlaceholder": "ID do cliente do seu app de login", + "hostedMcp.clientSecretLabel": "Segredo do cliente de {service}", + "hostedMcp.clientSecretPlaceholder": "Segredo do cliente do seu app de login", + "hostedMcp.clientSaved": "Entra com o app salvo {clientId}. Cole outro ID e segredo do cliente para substituí-lo.", + "hostedMcp.getClient": "Criar um app de login de {service}", "hostedMcp.keyRefused": "{service} não aceitou essa chave. Verifique-a e conecte novamente.", "hostedMcp.keyTestFailed": "Não foi possível carregar as ferramentas de {service} com essa chave: {reason} Conecte novamente para tentar de novo.", "agentmail.description": "Caixas de entrada de e-mail das quais seus bots enviam e recebem mensagens, na sua própria conta AgentMail.", @@ -12039,6 +12045,8 @@ "alwaysOn.status.noWay": "Casa ligada · nenhum celular ou computador consegue alcançá-la ainda", "higgsfield.description": "Imagens e vídeos de IA que seus bots criam com os modelos da Higgsfield, na sua própria conta da Higgsfield.", "higgsfield.notice": "Entre com a sua conta da Higgsfield. Não é preciso chave de API. Um bot que pode usar a Higgsfield pode iniciar gerações de imagens e vídeos que gastam créditos da sua conta, então escolha quais bots recebem esse acesso em Acesso dos bots.", + "geminiNotebook.description": "Crie notebooks do Gemini Notebook (NotebookLM) e adicione fontes da web, do YouTube e de texto, pelo servidor MCP oficial do Google.", + "geminiNotebook.notice": "O Google só aceita o login de um app que você mesmo registra. Em um projeto do Google Cloud, ative a API do Gemini Notebook, adicione o escopo notebook e inclua você como usuário de teste. Depois crie um cliente OAuth do tipo app para computador e cole aqui o ID e o segredo do cliente. Enquanto a API estiver em prévia, só contas pessoais do Google funcionam. Um bot que pode usar o Gemini Notebook pode criar e renomear notebooks e adicionar fontes, mas ainda não pode excluí-los nem ler o conteúdo deles.", "composioConnect.description": "A sua própria conta do Composio em uma única conexão MCP: os apps já autorizados lá, sem entrar em cada um de novo.", "composioConnect.notice": "Entre com o Composio. Uma conexão leva todos os apps autorizados na sua conta do Composio, então escolha quais bots podem alcançá-la em Acesso dos bots. Ela é separada dos Apps conectados: a chave própria do OpenMausBot para o Composio e os controles por app não valem aqui.", "imageGen.slot.needsHiggsfield": "Precisa da Higgsfield conectada: conecte abaixo.", diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json index 37b728c2a8e..cac2801cfbe 100644 --- a/src/locales/zh-tw.json +++ b/src/locales/zh-tw.json @@ -9724,6 +9724,12 @@ "hostedMcp.keyLabel": "{service} API 金鑰", "hostedMcp.keyPlaceholder": "貼上你的 {service} 金鑰", "hostedMcp.getKey": "取得 {service} 金鑰", + "hostedMcp.clientIdLabel": "{service} 用戶端 ID", + "hostedMcp.clientIdPlaceholder": "登入用 App 的用戶端 ID", + "hostedMcp.clientSecretLabel": "{service} 用戶端密鑰", + "hostedMcp.clientSecretPlaceholder": "登入用 App 的用戶端密鑰", + "hostedMcp.clientSaved": "使用已儲存的 App {clientId} 登入。貼上新的用戶端 ID 和密鑰即可替換。", + "hostedMcp.getClient": "建立 {service} 登入用 App", "hostedMcp.keyRefused": "{service} 沒有接受該金鑰。請檢查後再重新連線。", "hostedMcp.keyTestFailed": "無法使用該金鑰載入 {service} 的工具:{reason} 請重新連線以重試。", "agentmail.description": "讓機器人在你自己的 AgentMail 帳號下收發電子郵件的信箱。", @@ -10477,6 +10483,8 @@ "serverError.voice.deepseekKeyRequired": "請在「設定 → API 金鑰」中新增 DeepSeek API 金鑰,才能用 DeepSeek 聲音和機器人對話。", "higgsfield.description": "你的機器人用 Higgsfield 模型產生的 AI 圖片和影片,使用你自己的 Higgsfield 帳號。", "higgsfield.notice": "請使用你的 Higgsfield 帳號登入。不需要 API 金鑰。能使用 Higgsfield 的機器人可以發起圖片和影片產生,這會消耗你帳號的額度,所以請在「機器人存取權」中選擇哪些機器人可以使用。", + "geminiNotebook.description": "透過 Google 官方 MCP 伺服器,建立 Gemini Notebook(NotebookLM)筆記本,並加入網頁、YouTube 和文字來源。", + "geminiNotebook.notice": "Google 只接受你自己註冊的 App 登入。請在 Google Cloud 專案啟用 Gemini Notebook API,加入 notebook 範圍並把自己設為測試使用者,再建立「電腦版應用程式」OAuth 用戶端,把用戶端 ID 和密鑰貼到這裡。API 預覽期間只支援個人 Google 帳戶。能使用 Gemini Notebook 的機器人可以建立、重新命名筆記本並加入來源,但目前不能刪除,也不能讀取筆記本內容。", "imageGen.slot.needsHiggsfield": "需要連接 Higgsfield:請在下方連接。", "imageGen.higgsfield.connected": "已連接到你的 Higgsfield 帳號", "imageGen.higgsfield.notConnected": "未連接,或登入已失效",