Skip to main content
Connect your PraisonAI agents to Gmail, Google Calendar, Google Docs, and Google Drive through a local Google Workspace MCP server powered by your own Google Cloud OAuth credentials.
Only need Google Calendar in Python without running an MCP server? See Google Calendar Tools. Only need Google Drive? See the Google Drive Connector.
The user asks for a morning briefing; PraisonAI queries Google Calendar and Gmail via the Workspace MCP server and summarizes the day’s schedule alongside relevant threads.

How It Works

You enable only the Google APIs you want (for example Gmail and Calendar) in Google Cloud Console, pass your Desktop OAuth Client ID and Secret via environment variables, and run the Workspace MCP server locally over STDIO so credentials stay on your machine.

Step-by-Step Setup

1

Create Google Cloud OAuth credentials (one time)

  1. Open Google Cloud Console and create or select a project.
  2. Under APIs & Services → Library, enable only the APIs you need (for example Gmail API, Google Calendar API, Google Drive API, Google Docs API).
  3. Configure APIs & Services → OAuth consent screen and add your Google account under Test users.
  4. Under APIs & Services → Credentials → Create Credentials → OAuth client ID, choose Desktop app and copy the Client ID and Client Secret.
  5. Export both as environment variables:
2

Install prerequisites

Install PraisonAI with MCP support and uv (which provides uvx to run Python MCP servers cleanly in isolated environments):
3

Add the Google Workspace connector

Pass --tools to expose only the Google Workspace apps you actually need:
4

Verify and inspect tools

On first run, sign in with your Google account in the browser to authorize the requested scopes.
5

Run your agent safely


Scope Tools for Safety

Protect outbound emails and calendar invites. Pass --tools gmail calendar (only the services you need), list exact read/draft tools with praisonai mcp sync google-workspace, and keep approval="always" enabled so the agent cannot send emails or delete events silently.

Common Workflows

  • Morning Schedule & Inbox Digest: "List my calendar events today and highlight unread emails related to each meeting."
  • Draft-Only Replies: "Search Gmail for messages about the Q4 invoice and create a draft reply summarizing our latest status."

Troubleshooting


Best Practices

Loading every Google service adds dozens of tool schemas to every LLM call. Pass --tools gmail calendar (or drive docs) to keep prompts lean and focused.
Restrict automated inbox agents to reading threads and creating drafts so a human reviews every outbound email before sending.
Never commit GOOGLE_OAUTH_CLIENT_SECRET into config.yaml or Python files — always reference ${GOOGLE_OAUTH_CLIENT_SECRET}.

Google Drive Connector

Dedicated Google Drive MCP setup guide

Google Calendar Tools (Python)

Native Python tools for Google Calendar without MCP

List of Connectors

Browse all popular connectors and step-by-step guides

Human Approval

Require human approval before outbound actions