diff --git a/doc/connections/GOOGLE-WORKSPACE.md b/doc/connections/GOOGLE-WORKSPACE.md index d515c78b9ab..251b02b534a 100644 --- a/doc/connections/GOOGLE-WORKSPACE.md +++ b/doc/connections/GOOGLE-WORKSPACE.md @@ -482,7 +482,8 @@ profiles. 5. Choose the services and sign in with Google. Google's guide: -[Configure Google Workspace MCP servers](https://developers.google.com/workspace/guides/configure-mcp-servers). +[Create an OAuth client ID](https://developers.google.com/workspace/guides/create-credentials#oauth-client-id). +The setup screen links to the same guide. An unverified Google app shows a warning screen and has a user cap; only you can decide whether to submit your own app for Google's verification. diff --git a/packages/shared/src/app-definitions/google-workspace.json b/packages/shared/src/app-definitions/google-workspace.json index c3b55dc3ec5..7a4acb34fb2 100644 --- a/packages/shared/src/app-definitions/google-workspace.json +++ b/packages/shared/src/app-definitions/google-workspace.json @@ -16,7 +16,6 @@ "urlPatterns": [ "https://workspace.google.com/*" ], - "docsUrl": "https://developers.google.com/workspace/guides/configure-mcp-servers", "setupPrerequisite": { "title": "Google Developer Preview access required", "description": "Google must register the Workspace email and the Cloud project that owns the OAuth client before these services can be used.", @@ -111,10 +110,10 @@ "prompt": "consent" } }, - "guidanceMd": "Enable the Google Workspace MCP APIs and register Paperclip's callback URI. Choose which permissions to grant on Google's consent screen; declined permissions disable only the corresponding actions.", + "guidanceMd": "Enable the Gmail, Drive, Docs, Sheets, Slides, and Calendar APIs in your Google Cloud project and register Paperclip's callback URI. Choose which permissions to grant on Google's consent screen; declined permissions disable only the corresponding actions.", "consoleLinks": { "register": "https://console.cloud.google.com/auth/clients", - "docs": "https://developers.google.com/workspace/guides/configure-mcp-servers" + "docs": "https://developers.google.com/workspace/guides/create-credentials#oauth-client-id" }, "riskTier": "S4" } diff --git a/packages/shared/src/google-workspace-setup-links.test.ts b/packages/shared/src/google-workspace-setup-links.test.ts new file mode 100644 index 00000000000..d86428b26e7 --- /dev/null +++ b/packages/shared/src/google-workspace-setup-links.test.ts @@ -0,0 +1,31 @@ +import { describe, expect, it } from "vitest"; +import { getConnectableAppDefinition } from "./app-definitions.js"; + +const MCP_SERVERS_GUIDE = "configure-mcp-servers"; +const OAUTH_CLIENT_GUIDE = "https://developers.google.com/workspace/guides/create-credentials#oauth-client-id"; + +describe("Google Workspace setup links and copy", () => { + const app = getConnectableAppDefinition("google-workspace")!; + const method = (key: string) => app.methods.find((candidate) => candidate.key === key)!; + + it("never sends a user to Google's MCP servers guide", () => { + expect(JSON.stringify(app)).not.toContain(MCP_SERVERS_GUIDE); + }); + + it("gives the Paperclip-managed sign-in no requirements link", () => { + expect(app.docsUrl).toBeUndefined(); + expect(method("paperclip-workspace").consoleLinks?.docs).toBeUndefined(); + }); + + it("links the customer-owned client method to Google's OAuth client guide", () => { + expect(method("customer-workspace-oauth").consoleLinks?.docs).toBe(OAUTH_CLIENT_GUIDE); + }); + + it("does not mention MCP in user-facing method text", () => { + for (const entry of app.methods) { + for (const text of [entry.label, entry.whenToUse, entry.guidanceMd, ...(entry.warnings ?? [])]) { + expect(text ?? "").not.toMatch(/\bMCP\b/); + } + } + }); +}); diff --git a/server/src/__tests__/google-workspace-rest-transport.test.ts b/server/src/__tests__/google-workspace-rest-transport.test.ts index 4fad149c81f..c603cbe9fc7 100644 --- a/server/src/__tests__/google-workspace-rest-transport.test.ts +++ b/server/src/__tests__/google-workspace-rest-transport.test.ts @@ -280,6 +280,7 @@ const support = await getEmbeddedPostgresTestSupport(); const audit = await db.select().from(toolAccessAuditEvents).where(and(eq(toolAccessAuditEvents.companyId, f.company.id), eq(toolAccessAuditEvents.action, "call_completed"))); expect(audit).toHaveLength(1); expect(JSON.stringify(audit[0])).toContain("Google Workspace REST"); + expect(JSON.stringify(audit[0])).not.toContain("mcpMethod"); expect(JSON.stringify([invocation, audit])).not.toContain("workspace-access-1"); }); diff --git a/server/src/services/tool-gateway.ts b/server/src/services/tool-gateway.ts index 18caa403fcb..4781ea2f768 100644 --- a/server/src/services/tool-gateway.ts +++ b/server/src/services/tool-gateway.ts @@ -641,7 +641,7 @@ type RemoteHttpExecutionAudit = { protocol: "MCP JSON-RPC 2.0" | "Railway GraphQL" | "Railway GraphQL + SSH" | "Google Workspace REST"; httpMethod: "POST"; endpoint: string; - mcpMethod: "tools/call"; + mcpMethod?: "tools/call"; requestId: string; upstreamToolName: string; dispatched: true; @@ -8419,6 +8419,7 @@ export function createToolGatewayService( }; if (workspaceTarget?.transport === "paperclip_rest") { execution.request.protocol = "Google Workspace REST"; + delete execution.request.mcpMethod; execution.request.endpoint = googleWorkspaceRestAuditEndpoint(workspaceTarget.service); await assertWorkspaceGrantCurrent(); const signal = taskSignals.run ? AbortSignal.any([controller.signal, taskSignals.run]) : controller.signal; diff --git a/tests/runner-e2e/source-sdk-public-inputs.json b/tests/runner-e2e/source-sdk-public-inputs.json index e96931b7fe5..a849307dc1c 100644 --- a/tests/runner-e2e/source-sdk-public-inputs.json +++ b/tests/runner-e2e/source-sdk-public-inputs.json @@ -130,7 +130,7 @@ "packages/shared/src/app-definitions/google-sheets.json": "de87b58007fca0b719d242148a838e2b5c26ddca", "packages/shared/src/app-definitions/google-slides.json": "289366009d46be6b770eee6cd0bc650eb59a240c", "packages/shared/src/app-definitions/google-workspace-search.json": "f3ec9d00ed0116b7cb8b9b1b71353cb8d6dc8cf4", - "packages/shared/src/app-definitions/google-workspace.json": "c3b55dc3ec502f6b86008e1e5b421748bdd50e91", + "packages/shared/src/app-definitions/google-workspace.json": "7a4acb34fb2ab5106860e910de50573070cbed2b", "packages/shared/src/app-definitions/google.json": "f0bab0467612f915c88137eddbac0b320ac1aa2a", "packages/shared/src/app-definitions/gsc-wizard.json": "a4ba6f183d5f35a25d0a420ade18f00d3fb64534", "packages/shared/src/app-definitions/honcho.json": "17185eaf5189fc8c443388997c90ebf833bc9327", @@ -272,6 +272,7 @@ "packages/shared/src/google-sign-in-deployment.ts": "2e4e4cc3c24347642e20c91186581e1dce81d740", "packages/shared/src/google-workspace-connectors.test.ts": "26316900a50e5ab384e0dcf9c45a2bb4abc0830d", "packages/shared/src/google-workspace-connectors.ts": "88d942d1e66d7facc68cf8645f665cdc80c8c005", + "packages/shared/src/google-workspace-setup-links.test.ts": "d86428b26e74e54ab2902d1a14c0f06f562de775", "packages/shared/src/grok-bot.ts": "9de68f00e7926c397729ff62bf8e277f5a41c525", "packages/shared/src/heartbeat-inbox.ts": "227dc89705c20460ca02194091cb162e11503186", "packages/shared/src/home-paths.test.ts": "81235c17c376224e1be3abd3f034a8400f079c66", diff --git a/ui/src/features/connections/ConnectionSetupFlow.tsx b/ui/src/features/connections/ConnectionSetupFlow.tsx index 110edcf9dee..1b6de4cd3c9 100644 --- a/ui/src/features/connections/ConnectionSetupFlow.tsx +++ b/ui/src/features/connections/ConnectionSetupFlow.tsx @@ -3131,7 +3131,7 @@ export function OAuthConnectStateScreen({ return (