How to Connect Google Workspace to OpenClaw
Blog

How to Connect Google Workspace to OpenClaw

Google's new Workspace CLI ships with 100+ OpenClaw skills and 50 curated recipes for Gmail, Calendar, Drive, Docs, and Sheets. This guide walks through creating a Google Cloud project, setting up OAuth credentials, and connecting each service — including Google Analytics, which no other guide covers. All APIs are completely free with generous rate limits.

TL;DR
  • Google's Workspace CLI ships with 100+ OpenClaw skills and 50 curated recipes — all free
  • Two integration paths: CLI skills for quick setup, or MCP server for 54 structured tools
  • Sign up at openclaw.direct to get your AI agent running in minutes
  • Create a Google Cloud project, enable APIs, set up OAuth credentials — takes about 15 minutes
  • Start with read-only scopes for safety, then expand permissions as you verify the agent's behavior
  • Connect Gmail, Calendar, Drive, and Analytics for AI-powered morning briefings and email triage
OpenClaw Direct Team ·

You’ve got an AI agent that can reason, plan, and write — but it can’t check your email. It can’t see what’s on your calendar tomorrow, can’t pull that proposal from Google Drive, and has absolutely no idea how your website performed last week. It’s like hiring a brilliant assistant and then locking them out of the office.

The fix takes about fifteen minutes. And once you connect Google Workspace to your OpenClaw agent, the difference isn’t incremental — it’s transformational.

With roughly three billion people using Google Workspace every month, there’s a good chance your entire professional life already lives inside Gmail, Calendar, and Drive. Connecting your agent to those services means connecting it to you.

TL;DR

Google’s new Workspace CLI ships with 100+ OpenClaw skills and 50 curated recipes for Gmail, Calendar, Drive, Docs, and Sheets — all completely free. Sign up at openclaw.direct to get your agent running, set up a Google Cloud project, create OAuth credentials, and your agent gets full access to your email, schedule, files, and analytics.

First Things First: Get Your OpenClaw Agent Running

Before you can connect anything to Google Workspace, you need an OpenClaw agent that’s actually running. If you haven’t set one up yet, the fastest way is to sign up at openclaw.direct. It takes about two minutes.

OpenClaw Direct hosts your agent for you, which means it stays online around the clock — no server to maintain, no Docker containers to babysit, no worrying about your laptop going to sleep and killing your cron jobs. You manage everything from your browser, and your agent is ready to accept integrations the moment you sign up. If you already have OpenClaw running locally or on your own VPS, that works too. But from what we’ve seen, most people who try the self-hosted route eventually switch to Direct for the convenience of not dealing with uptime themselves.

Either way, make sure your agent is responding to messages before you move on. Send it a quick “hello” and confirm it replies. Good? Let’s keep going.

Why Google Workspace Is the Integration That Changes Everything

There’s a reason the most recommended tools for OpenClaw almost always include Google Workspace. It’s not because it’s the flashiest integration or the one that demos the best at conferences.

It’s because Google Workspace is where your work actually happens. Your inbox is your to-do list, your calendar is your commitment ledger, your Drive is your filing cabinet, and your Sheets are your dashboards. An AI agent without access to these services is operating blind, no matter how intelligent the model underneath might be.

And the timing here couldn’t be better. Google quietly released an official Workspace CLI on GitHub that was practically designed for AI agent integration. It ships with over a hundred OpenClaw-compatible skills and fifty curated recipes covering Gmail, Calendar, Drive, Docs, and Sheets. Matthew Ganzak, who’s been documenting AI agent workflows on Instagram, called it a “massive win for us running AI agents” — and he’s not wrong.

The CLI dynamically supports every Google Workspace API through Google’s Discovery Service, which means your agent can access not just the big four (Gmail, Calendar, Drive, Sheets) but also Docs, Slides, Chat, Tasks, Keep, Meet, and more. All free. All with generous rate limits that would cost real money through third-party alternatives.

Two Ways to Connect: CLI Skills or MCP Server

Before you start clicking through the Google Cloud Console, it helps to know there are two distinct paths for connecting Google Workspace to OpenClaw. Which one you choose depends on how you prefer your agent to work.

The Google Workspace CLI Path

The first approach uses Google’s official Workspace CLI, which you install with npm install -g @googleworkspace/cli. This gives your agent over a hundred skills organized by service — Gmail skills for reading and sending emails, Calendar skills for managing events, Drive skills for file operations, and so on.

Each skill is a self-contained SKILL.md file that your agent reads and follows, and the CLI handles all the API communication underneath. What makes this path especially appealing is that Google ships fifty curated recipes — pre-built multi-step workflows like “summarize today’s unread emails and calendar events” — that your agent can run out of the box.

The MCP Server Path

The second approach uses a Model Context Protocol server that exposes Google Workspace as fifty-four structured tools. Ten for Gmail, ten for Calendar, eight for Drive, eight for Sheets, six for Docs, five for Slides, four for Chat, and two for People/Contacts.

If you’ve already set up other MCP servers for your OpenClaw (and if you’re running recommended skills, you probably have), this path fits naturally into that architecture. Configure it in ~/.openclaw/mcp-servers.json and your agent discovers all fifty-four tools automatically.

Either path works. Some people use both simultaneously. The CLI gives you more pre-built workflows and tends to be simpler for getting started fast. The MCP path gives more granular control and plays nicely with other MCP-based tools. For this guide, we’ll walk through the setup that both paths share — the Google Cloud project and OAuth credentials — and then you pick whichever suits you.

Setting Up Your Google Cloud Project

This sounds intimidating. It isn’t.

Everything your agent needs to access Google Workspace flows through a Google Cloud project, and creating one is free. You can even have your OpenClaw agent walk you through it step by step while you do the clicking.

Head to console.cloud.google.com and create a new project. Name it something descriptive like “OpenClaw Workspace” — you’ll thank yourself later when you have multiple projects and can’t remember which is which. Once the project is created, navigate to “APIs & Services” and click “Library.”

Search for and enable each API you want. At minimum: Gmail API, Google Calendar API, and Google Drive API. Want spreadsheets? Enable Sheets too.

And here’s a tip the other guides miss: enable the Google Analytics Data API as well. No existing tutorial covers this one, but once your agent can pull analytics alongside your email and calendar, you unlock morning briefings that include traffic trends, keyword rankings, and conversion data — all without you opening a single dashboard.

Creating Your OAuth Credentials

With the APIs enabled, you need to tell Google how your agent will authenticate. Navigate to “APIs & Services,” then “OAuth consent screen.” Choose “External” as the user type (unless you’re on a Google Workspace organization, where “Internal” works too). Fill in the app name, your email, and the developer contact. Skip the logo and privacy policy — this is for your personal agent, not a public app.

Now here’s the step that trips up almost everyone.

Go to the “Test users” section and add your own Google email address. While your app is in “Testing” status (which is the default), only listed test users can authorize it. Miss this and you’ll hit an “Access blocked” error that won’t tell you why. We’ve seen people burn twenty minutes on confused debugging over this one. It’s one of those gotchas that wastes time if you don’t know about it in advance.

Next, go to “Credentials” and click “Create Credentials,” then “OAuth client ID.” Select “Desktop app” as the application type, give it a name, and click create. Google will show you a client ID and client secret — download the JSON file and save it to ~/.config/gws/client_secret.json.

Treat this file like a password. Don’t commit it to Git, don’t share it, don’t leave it in a public directory.

Connecting Gmail: Your Agent’s Most Powerful New Ability

With the Cloud project and credentials in place, this is where things get exciting. Run gws auth login (or just tell your OpenClaw agent to do it), and a browser window opens asking you to authorize the app.

Pay attention to the permissions list. If you only need your agent to read emails, request only the gmail.readonly scope. You can always expand later. Starting narrow is smart.

Once authorized, your agent can search your inbox, read specific messages, check for unread mail from particular senders, and draft responses for your review. The Gmail API gives you a generous 1.2 million quota units per minute per project, and since reading a single message costs just 5 units, your agent could theoretically read 240,000 emails per minute. You’ll never come close to that ceiling, but it’s nice to know it’s there.

The most common first workflow? Email triage. Tell your agent something like “every morning, check my inbox for emails from clients, flag anything that needs a response today, and send me a summary on Telegram.” Combined with a cron job running at 7 AM, it handles this autonomously every single day. You wake up to a clean summary instead of a cluttered inbox, and you’ve already saved twenty minutes before your first coffee.

Adding Google Calendar: Your Agent Learns Your Schedule

Calendar integration turns your agent from smart to contextually aware. That’s a bigger leap than it sounds.

When your agent knows your schedule, it can warn you about back-to-back meetings, suggest prep time before important calls, and — when combined with Gmail — tell you that the person you’re meeting at 2 PM sent you an email at midnight you haven’t read yet. That kind of ambient awareness is what separates “I have an AI tool” from “I have an AI assistant that actually understands my day.”

Setup mirrors what you did for Gmail. The same OAuth credentials work across all Google APIs, so your agent just needs the calendar.readonly scope (or calendar.events if you want it to create and modify events). Rate limits are equally generous.

Here’s a pattern people tend to overlook: ask your agent to cross-reference your calendar with your research monitoring. If you’ve got proactive research monitoring set up, your agent can surface relevant industry news before meetings with specific clients. Walking into a call already knowing that your client’s company just raised a funding round? That used to require a dedicated research analyst. Now it’s a cron job.

Google Drive: Giving Your Agent a Filing Cabinet

Drive extends your agent’s reach into documents and files. Search by name or content, read documents and spreadsheets, create new files, organize folders. The Drive API allows 12,000 queries per minute and up to 750 GB of uploads per day — practically infinite for what an AI agent needs.

A smart scope to start with is drive.file instead of full access. This lets your agent see and modify only files it created itself — reports, drafts, research documents — without having access to everything in your Drive. It’s a clean security boundary. Expand to read-only or full access later when you’re comfortable.

The workflow that tends to unlock the most value? Automated reporting. Connect Drive with Sheets and your agent pulls data from spreadsheets, analyzes trends, and saves summaries directly to a shared folder. If you run a team, you can have a weekly performance report waiting in a shared folder every Monday morning. No dashboard logins, no copy-pasting between tabs. Just a finished document ready when your team arrives.

Google Analytics: The Integration Nobody Else Covers

Here’s where this guide diverges from everything else online.

Every other tutorial stops at Gmail, Calendar, and Drive. But if you’re running a website — and if you’re reading a blog about AI agent automation, you almost certainly are — the Google Analytics Data API ties everything together. Enable it in your Cloud project the same way you did the others, add the scope, and suddenly your agent can answer “how did my blog do last week?” without you ever opening an analytics dashboard.

Combine this with the morning briefing pattern and you get something genuinely useful. Your agent wakes up at 7 AM, pulls email highlights, checks your calendar, grabs analytics data, and delivers one synthesized message: “You have three meetings today, the earliest at 10 AM. Two client emails need responses. Blog traffic was up 12% yesterday, with the new post on AI-powered blog SEO driving most of the growth. Your top keyword gained two positions.”

That’s not a collection of data points. That’s a briefing from an assistant that understands how your work connects.

How Should You Handle Security?

The PwC AI Agent Survey found that only 27% of organizations fully trust autonomous AI agents — down from 43% the year before. That declining trust isn’t paranoia. It’s a growing awareness that connecting powerful tools to sensitive data requires deliberate guardrails.

The good news: the integration has security built in. The MCP server encrypts stored tokens with AES-256-GCM encryption, using a salt derived from your hostname and username. Your credentials stay on your machine. Google’s OAuth lets you control exactly which permissions your agent has.

Start read-only across the board. Grant gmail.readonly, calendar.readonly, drive.readonly. Run with those for a week. Watch what your agent does. Only then consider write permissions.

Want your agent to manage your calendar? Add calendar.events. Draft emails? Add gmail.send. Each expansion is a deliberate choice, not a blanket grant. And if you’re running in Docker, set a stable hostname via environment variable — container restarts change the hostname by default, which breaks the token encryption salt and forces re-authentication.

What Your Morning Looks Like After Setup

Remember that brilliant assistant locked out of the office? They’ve got the keys now.

Your agent wakes up before you do (assuming you’ve set up cron jobs), scans your inbox, checks your calendar, pulls analytics, and sends one concise morning briefing. Throughout the day, it monitors your email and nudges you when something genuinely needs attention. Before each meeting, it surfaces recent emails from that contact, related documents in Drive, research it’s flagged. When you ask it to draft a follow-up or create a meeting summary, it saves to Drive and shares with the right people.

Research suggests AI agents save workers 40 to 60 minutes per day on routine tasks. Email triage and calendar management alone can account for most of that. When Gartner projects that 40% of enterprise apps will embed AI agents by the end of 2026 (up from under 5% in 2025), this is the integration that drives it — not flashy demos, but the daily, genuinely-useful-at-8-AM value that makes you wonder how you managed before.

And if you signed up at OpenClaw Direct like we suggested at the start, all of this runs around the clock without you thinking about it. Morning briefings fire when they’re supposed to. Email monitors keep watching. Your agent keeps working when you’re not — which is kind of the whole point.

Frequently Asked Questions

Does connecting Google Workspace to OpenClaw cost anything?

No. All Google Workspace APIs are free with generous rate limits — the Gmail API gives you 1.2 million quota units per minute, the Drive API allows 12,000 queries per minute, and there are no per-request charges. You need a Google Cloud project (free) and OAuth credentials (also free). The only costs are your OpenClaw plan and AI model usage.

Is it safe to give my AI agent access to my email?

It can be, if you’re thoughtful about it. Start with gmail.readonly so your agent can see emails but can’t send, delete, or modify anything. OpenClaw runs on your own infrastructure, so email data doesn’t flow through a third-party server. Tokens are encrypted with AES-256-GCM. Start minimal, verify behavior, then expand. Our AI agent safety guide covers more best practices.

Which integration path should I choose — CLI or MCP?

Want the fastest setup? Go with the Google Workspace CLI — a hundred-plus skills and fifty curated workflows, ready immediately. Prefer structured, programmatic control? The MCP server gives you fifty-four granular tools across eight services. Both use the same Cloud project and OAuth credentials, so you can switch (or use both) without repeating setup.

Can I connect Google Workspace to OpenClaw on a VPS or server?

Yes. The OAuth step needs a browser, but on a headless server you can use manual mode: your agent displays a URL, you open it on any device, authorize, and paste the code back. After that, tokens are stored locally and the browser isn’t needed again. In Docker, set a stable hostname via environment variable to prevent token encryption from breaking on restart.

Do I need an OpenClaw account to get started?

You need a running OpenClaw agent, yes. The fastest way is to sign up at openclaw.direct — your agent will be live in about two minutes with 24/7 uptime handled for you. If you prefer self-hosting, that works too, but you’ll need to manage your own server and uptime.


Sources: This article is adapted from Matthew Ganzak’s Instagram reel on Google Workspace integration with OpenClaw. Additional information from Google Workspace CLI on GitHub, Gmail API Usage Quotas, Drive API Usage Limits, Calendar API Quotas, Google Workspace MCP Analysis, Google Workspace Statistics 2025, PwC AI Agent Survey, and AI Agent Enterprise Adoption Statistics.