Integrations

How to Connect Google Workspace to OpenClaw: Setup, Models, and Workflow Guide

·17 min read

If you're searching for "how to connect Google Workspace to OpenClaw", the real question is usually not just whether the connection is possible. It's how to make Google Workspace usable inside an OpenClaw workflow with the right model, the right context, and the right level of control.

That's the practical framing.

OpenClaw gives you the orchestration layer: connectors, skills, tools, prompts, approvals, and the ability to run workflows where your team already works. Google Workspace provides the domain context. The integration becomes valuable when those two pieces are connected cleanly.

Google Workspace Is Not One MCP Server. It Is Nine.

This is the first thing every "connect Google Workspace to OpenClaw" guide gets wrong, including our own base data until this page was rewritten. Google Workspace has no single workspace-mcp endpoint. Google ships nine separate first-party remote MCP servers, one per product, each with its own hostname, its own API enablement, its own OAuth scopes, and its own toolset.

Google's official documentation for configuring the Google Workspace MCP servers — prerequisites, API enablement, and per-product endpoints

Product MCP endpoint Tools
Gmail https://gmailmcp.googleapis.com/mcp/v1 search_threads, get_thread, get_message, create_draft, list_drafts, list_labels, label_thread, label_message, unlabel_thread, unlabel_message
Google Drive https://drivemcp.googleapis.com/mcp/v1 search_files, read_file_content, download_file_content, create_file, copy_file, get_file_metadata, get_file_permissions, list_recent_files
Google Docs https://docsmcp.googleapis.com/mcp/v1 read_doc, update_doc
Google Sheets https://sheetsmcp.googleapis.com/mcp/v1 get_values, get_spreadsheet, update_values, update_formulas, update_spreadsheet, insert_dimension
Google Slides https://slidesmcp.googleapis.com/mcp/v1 read_presentation, update_presentation
Google Calendar https://calendarmcp.googleapis.com/mcp/v1 list_events, get_event, search_events, list_calendars, suggest_time, create_event, update_event, delete_event, respond_to_event
Google Chat https://chatmcp.googleapis.com/mcp/v1 search_conversations, list_messages, search_messages, send_message, mark_as_read, mark_as_unread, list_memberships, get_notification_settings, update_notification_settings
People API https://people.googleapis.com/mcp/v1 get_user_profile, search_contacts, search_directory_people
Google Classroom https://classroommcp.googleapis.com/mcp/v1 get_courses, list_course_summaries, get_course_work, create_course_work, create_announcement, get_course_roster, list_course_work_submissions, and 7 more

Gmail MCP server reference — the endpoint URL and the full tool list for gmailmcp.googleapis.com

The practical consequence: "connect Google Workspace to OpenClaw" is nine connections, not one. A workflow that reads a Gmail thread, summarises the attached Doc, and puts the numbers in a Sheet needs Gmail, Drive, and Sheets configured and authenticated independently — three endpoint entries, three token stores, and three consent screens. Plan for that up front instead of discovering it when the third tool call 401s.

Two APIs Per Product, and Only One of Them Is Obvious

Every Workspace MCP server requires two Google Cloud APIs enabled, not one:

  1. The product API — gmail.googleapis.com, drive.googleapis.com, docs.googleapis.com, sheets.googleapis.com, slides.googleapis.com, calendar-json.googleapis.com, chat.googleapis.com, people.googleapis.com, classroom.googleapis.com
  2. The MCP API — gmailmcp.googleapis.com, drivemcp.googleapis.com, docsmcp.googleapis.com, sheetsmcp.googleapis.com, slidesmcp.googleapis.com, calendarmcp.googleapis.com, chatmcp.googleapis.com, classroommcp.googleapis.com (People has no separate MCP service — people.googleapis.com covers it)

This is the single most common silent failure. You enable the Gmail API because Gmail is the thing you want, authentication succeeds because the OAuth client is fine, and then every tool call fails — because gmailmcp.googleapis.com was never enabled and the MCP endpoint effectively does not exist for your project.

# Enable both layers in one shot (adjust the list to the products you need)
gcloud services enable \
  gmail.googleapis.com gmailmcp.googleapis.com \
  drive.googleapis.com drivemcp.googleapis.com \
  docs.googleapis.com docsmcp.googleapis.com \
  sheets.googleapis.com sheetsmcp.googleapis.com \
  calendar-json.googleapis.com calendarmcp.googleapis.com \
  --project=YOUR_PROJECT_ID

Drive MCP server reference — a second endpoint, a second API to enable, a second consent screen

The OAuth Client Must Be Marked as an AI Agent Client

The second silent failure, and the one Google explicitly calls out in its troubleshooting section: your OAuth 2.0 client must have "Use this client for an AI-powered agent" selected in Google Auth Platform → Clients.

If it is not set, requests to the MCP servers are rejected — not with a helpful error, just rejected. And critically:

  • This setting cannot be changed on an existing OAuth client. If you built the client for something else, you must create a new one and migrate.
  • A single client should not span both worlds. If an existing client powers your AI agent and non-agent features, Google recommends creating a separate OAuth client for the agent and keeping the old one for everything else.
  • Apps Script cannot select the flag at all. Scripts get a Google-managed default OAuth client where the flag is unavailable — even on a standard Cloud project. The workaround is to create the client manually, authorise through the OAuth2 for Apps Script library, and pass that access token instead of ScriptApp.getOAuthToken().

Two exceptions where the flag does not apply, both worth knowing:

  • Service accounts with domain-wide delegation cannot have the flag set (service accounts are not managed in Auth Platform → Clients), and Google's docs state those requests are not rejected for this reason — access is governed by the DWD configuration your Workspace admin controls.
  • Antigravity and Claude are the two clients Google documents end-to-end, with their own redirect URIs (https://antigravity.google/oauth-callback and https://claude.ai/api/mcp/auth_callback).

The Hourly Re-Sign-In Is a Missing access_type=offline

The symptom: the connection works, then roughly an hour later every call fails and the user is asked to sign in again. Some guides describe this as a Google limitation. It is not — it is a client configuration bug.

Google's OAuth 2.0 server issues a refresh token only when the authorization request includes access_type=offline. Requesting only the OpenID Connect offline_access scope does not return one. That distinction is the whole trap: offline_access looks like it means "offline access", and it does not give you a refresh token here.

If your MCP client supports custom authorization parameters, add:

  • access_type=offline to the authorization request
  • prompt=consent when you need a new refresh token for a user who already granted access (re-granting without prompt=consent returns no refresh token)

If your client does not support custom auth parameters, you cannot fix this — the user signs in again every time the access token expires. That is a client limitation, not a Google one, and it is the reason the token-refresh design has to be settled before you automate anything.

Scope Sets Are Per Product, and Calendar's Read Set Is Narrower Than You Think

Google documents an explicit scope list per product, and the lists are deliberately minimal. The two that surprise people:

Gmail asks for gmail.readonly + gmail.compose — compose, not send. The server can create a draft (create_draft) and cannot send mail. That is a design choice, not an oversight, and it means "let the agent reply to this thread" is a draft-and-human-sends workflow.

Google Calendar asks for calendar.calendarlist.readonly, calendar.events.readonly, and calendar.events.freebusy — but not calendar.readonly in the broad sense. Reading events and freely checking availability are two different scopes (calendar.events.readonly vs calendar.events.freebusy), and suggest_time depends on the freebusy one. Grant only the events scope and scheduling suggestions fail while event listing works.

The Docs, Sheets, and Slides servers each request their product scope plus drive.readonly and drive.file, because in Google's model a Doc, Sheet, or Slide is a Drive file. If those Drive scopes are missing from the consent screen, the product server cannot resolve the file ID it was given.

Wiring It Into OpenClaw

Two routes, and they are not equivalent.

Route A — one MCP entry per product (Google's documented path). Streamable HTTP, OAuth 2.0, one serverUrl each. Google's own client example uses serverUrl plus an oauth block with your client ID and secret:

// ~/.openclaw/settings.json — one entry per product, all sharing one AI-agent OAuth client
{
  mcpServers: {
    gmail: {
      serverUrl: "https://gmailmcp.googleapis.com/mcp/v1",
      oauth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
    },
    drive: {
      serverUrl: "https://drivemcp.googleapis.com/mcp/v1",
      oauth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
    },
    calendar: {
      serverUrl: "https://calendarmcp.googleapis.com/mcp/v1",
      oauth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
    },
  },
}

Note the key is serverUrl, not httpUrl — the same trap that bites on the Sheets-only setup, and it applies to every Workspace server.

Route B — skip the Google Cloud work entirely. If the job is "answer questions across my inbox, calendar and Drive from Slack", the OAuth client, nine API enablements, nine consent screens, and the refresh-token plumbing are the price of admission for self-hosting, and none of it is the interesting part. Cody ships the Google Workspace integration already connected, so Gmail, Calendar and Drive context lands in Slack without anyone owning a project or a token store.

Verifying the Connection Without Guessing

Google publishes a set of test prompts that map to specific tools, which is a far better smoke test than "ask it something about email". Use them in this order — each one exercises a different server, so a failure localises:

  1. "What did Ariel say in her last email about our marketing plan?" → gmail.search_threads then gmail.get_thread
  2. "Draft an email to ariel@example.com saying I approve the plan." → gmail.create_draft (lands in Drafts, does not send)
  3. "Summarize the file Marketing Plan." → drive.search_files then drive.read_file_content
  4. "Show me the structural contents of the Google Doc Meeting Notes." → docs.read_doc
  5. "Read sheet Sheet1 from Google Sheet Quarterly Sales." → sheets.get_values
  6. "When is my next meeting with Ariel?" → calendar.list_events

You can also list tools directly, which proves the endpoint and the MCP API enablement independently of your client:

curl --location 'https://gmailmcp.googleapis.com/mcp/v1' \
  --header 'content-type: application/json' \
  --header 'accept: application/json, text/event-stream' \
  --data '{ "method": "tools/list", "jsonrpc": "2.0", "id": 1 }'

If this returns an empty or error response while your product API is enabled, check gmailmcp.googleapis.com — not your OAuth client.

Developer Preview Is a Hard Gate

Every one of these pages carries the same banner: Developer Preview, available as part of the Google Workspace Developer Preview Program. Membership is an application and a review, and it is a prerequisite, not a formality. Without it the MCP services are not available to your project no matter how correct your OAuth setup is.

That has two consequences worth planning around:

  • Do not build the team's critical workflow on it yet. Preview terms change, and Google's own product surface here is moving — the configuration guide was updated on 2026-10-27, while the individual product references still carry July 2026 timestamps.
  • Budget for the product API path as the fallback. The Gmail, Drive, Calendar and Docs REST APIs are GA. If the MCP preview gate is a blocker, a proxy endpoint plus a skill file against the stable REST APIs is the boring, durable answer — the "Step-by-Step" section above is exactly that path.

Real Workflows Worth Building

Morning triage with a draft-first rule. Ask for anything from a named sender in the last 24 hours, summarise the threads, and create drafts for the ones that need a reply. The draft limitation is a feature here: nothing leaves the account without a human sending it.

Meeting prep from three sources at once. "For my next meeting with Ariel, pull the latest thread, the last doc mentioned in it, and any open action items." That is calendar.list_events → gmail.search_threads → drive.search_files → docs.read_doc, one answer, four servers. This is the workflow that justifies the multi-server setup; single-product integrations cannot do it.

Sheet update from a conversation. "Take the numbers from the Q3 thread and put them in the Revenue tab." gmail.get_thread for the figures, sheets.update_values for the write. Use update_formulas if the target cell must hold a formula =SUM() rather than its computed value.

Scheduling that respects availability. "Find 45 minutes with Ariel this week." calendar.suggest_time depends on the freebusy scope, so this is also the fastest way to discover a missing calendar scope.

Google Workspace-Specific Pitfalls

  1. Nine servers, not one. There is no workspace-mcp endpoint. Each product needs its own connection and its own consent.
  2. Two APIs per product. Enabling gmail.googleapis.com without gmailmcp.googleapis.com produces an auth that works and tools that do not exist.
  3. The AI-agent OAuth flag cannot be retrofitted. Create the client with "Use this client for an AI-powered agent" from the start; an existing client cannot be converted.
  4. offline_access is not access_type=offline. Only the latter returns a refresh token, which is why the hourly re-sign-in happens.
  5. Gmail MCP cannot send mail. gmail.compose gives you drafts. "Reply to this thread" means draft plus a human click.
  6. Calendar needs the freebusy scope for suggest_time. Event listing working does not mean scheduling works.
  7. Docs, Sheets and Slides need Drive scopes too. A Doc is a Drive file; without drive.readonly / drive.file the product server cannot resolve file IDs.
  8. Google Chat needs an app configured first. The Chat MCP server requires a Chat API app configuration (name, avatar, interactive features off, log errors to Logging) before it will work at all.
  9. Apps Script cannot use the AI-agent flag. Scripts get a Google-managed client with the flag unavailable; authorise with your own client and pass that token.
  10. Developer Preview gates everything. No program membership, no MCP services — regardless of how correct the rest of the setup is.
  11. Indirect prompt injection is your problem, not Google's. Google's own page warns that with these tools connected, a malicious email or document can hijack the session and "modify, steal, or delete your data". For any workflow that summarises other people's mail or files, use read-only scopes and require approval on writes.
  12. Service accounts with DWD bypass the flag. They are not rejected, which means an over-broad DWD grant is not caught by any of the MCP-side checks — it is caught only in the Workspace admin console.

When Not to Build This

If the requirement is "our team can ask questions about email, calendar and files from Slack", the self-hosted version of this page is nine MCP servers, nine OAuth scopes, nine consent screens, a refresh-token strategy, a Developer Preview membership, and an ongoing maintenance surface against a preview API. That is a real project with a real owner.

Cody ships Google Workspace as a connected integration instead, so the assistant has Gmail, Calendar and Drive context without a Cloud project or a delegation setup. If you want the self-hosted route — full control over scopes and data flow — the nine-server structure above is the honest map, and everything on this page is what makes it survive its first week.

Related: Google Sheets to OpenClaw, Google Analytics to OpenClaw, the Google Workspace MCP server overview, the Google Sheets MCP server, and how to connect Notion to OpenClaw if your document context lives outside Google.

What “Connect Google Workspace to OpenClaw” Actually Means

In practice, connecting Google Workspace to OpenClaw usually involves four layers:

  • Authentication so OpenClaw can securely access Google Workspace
  • Tooling or proxy endpoints that expose the right Google Workspace actions and data
  • Skills/instructions that tell OpenClaw how to reason over Google Workspace context
  • Model selection so the assistant uses the right LLM for the job

That last piece matters more than most people expect.

Which Models Can You Use?

OpenClaw is model-flexible, so a Google Workspace integration does not need to be tied to a single provider. Depending on your setup, teams commonly want to use:

  • OpenAI models for broad reasoning, structured extraction, and tool use
  • Anthropic models for writing, analysis, and long-context work
  • Google models for multimodal and large-context workflows
  • Other model backends if your OpenClaw environment exposes them

Model names and availability change frequently, so check your OpenClaw model catalogue rather than copying a version from a guide. The practical point is that you can connect Google Workspace once, then choose a supported model for each workflow.

For example:

  • Use Claude for nuanced summarisation or drafting
  • Use OpenAI for structured extraction, tool-heavy workflows, or general-purpose copiloting
  • Use Gemini when multimodal or very large context windows matter

A Good Integration Pattern for Google Workspace

A strong Google Workspace + OpenClaw setup usually looks like this:

  1. OpenClaw receives a request in chat or from an automation
  2. It calls the right Google Workspace endpoint or proxy
  3. The selected model reasons over the returned context
  4. OpenClaw returns an answer, draft, classification, or action
  5. High-risk actions stay behind approvals or structured guardrails

That is what makes the setup operational rather than just experimental.

Step-by-Step: Connect Google Workspace to OpenClaw

Step 1: Create a Google Cloud Project and Enable APIs

In Google Cloud Console, create a project and enable the APIs you need: Gmail API, Google Calendar API, Google Drive API. Each must be enabled individually. Then create OAuth 2.0 credentials or a Service Account depending on whether you need user-specific access or workspace-wide access.

Step 2: Handle Domain-Wide Delegation (If Needed)

For a service account to access Gmail or Calendar on behalf of workspace users, you need to configure Domain-Wide Delegation in Google Admin console and grant the service account access to the specific OAuth scopes. This is an admin-level action and requires a Google Workspace admin.

Step 3: Build Separate Proxy Endpoints and a Combined Skill File

Build proxy endpoints for each service you're integrating. They have separate API base URLs and different response shapes. Write ~/.openclaw/skills/google-workspace.md explaining what's available across Gmail, Calendar, and Drive so Claude knows which service to query for which type of question.

Model-Specific Workflow Ideas

Google Workspace + OpenAI

Use this when you want a strong general-purpose setup for extraction, classification, action planning, and tool-driven workflows around Google Workspace.

Google Workspace + Claude

Use this when you want better writing quality, clearer summaries, stronger nuance, and reliable long-context reasoning over Google Workspace data.

Google Workspace + Gemini

Use this when the workflow benefits from large context windows, multimodal inputs, or Google-native ecosystem alignment.

Common Mistakes

Most teams do not fail because the model is bad. They fail because:

  • the Google Workspace connection is too thin
  • the model lacks the right live context
  • prompts are vague
  • no structured outputs are enforced
  • permissions and approvals are skipped
  • one model is forced to do every job, even when another would be a better fit

The best setup is usually one integration layer, multiple model options, and clear guardrails.

Challenges and Caveats

This Is Multiple Integrations in One

Google Workspace isn't a single API. It is 5-10 separate APIs, each with their own rate limits, scopes, and response formats. Building a coherent integration across all of them is a significant project.

Gmail Scopes Are Sensitive

Gmail API scopes are classified as sensitive or restricted. If your OAuth app accesses Gmail for non-personal use, Google may require an app verification process before it can be used by more than a small number of test users.

Want Google Workspace Connected to OpenClaw Without Building the Whole Stack Yourself?

Cody gives your team a Google Workspace assistant in Slack, so people can triage Gmail, prep for meetings, search Drive and Docs, and draft follow-ups without setting up Google Cloud projects, domain delegation, or OAuth plumbing.

Get started with Cody →


Related OpenClaw Guides


Looking for a more workflow-first angle? See: Google Workspace AI Automation and Google Workspace AI Assistant.

More Google Workspace Resources