Skip to main content

Google Workspace

Synapse integrates with Google Workspace (Gmail, Calendar, Drive, Docs, Sheets) via an OAuth-authenticated MCP server. Once connected, agents can read/write emails, create calendar events, manage Drive files, and more.

Setup

Step 1 — Create a Google Cloud OAuth app

  1. Go to console.cloud.google.com and create a project
  2. Enable the APIs you need:
    • Gmail API
    • Google Calendar API
    • Google Drive API
    • Google Docs API / Google Sheets API
  3. Go to APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID
  4. Choose Web application
  5. Add http://localhost:8000/api/mcp/oauth/callback to Authorised redirect URIs
  6. Download the credentials JSON

Step 2 — Upload credentials to Synapse

Go to Settings → Google Workspace and upload the downloaded credentials JSON file.

Step 3 — Authenticate

Click Connect Google Account. A browser window opens for the Google OAuth flow. After authorising, the connection is confirmed.

Step 4 — Available tools

Once connected, Google Workspace tools become available to all agents:

ToolDescription
gmail_readRead emails by label, search query, or ID
gmail_sendSend an email
gmail_replyReply to a thread
calendar_listList upcoming events
calendar_createCreate a calendar event
drive_listList Drive files
drive_readRead a file's content
drive_uploadUpload a file to Drive
sheets_readRead cells from a Google Sheet
sheets_writeWrite data to a Sheet
docs_readRead a Google Doc
docs_createCreate a new Doc

Example agent prompts

Check my calendar for tomorrow and send a summary to slack.
Read the latest 5 emails with subject "invoice" and extract the amounts into a spreadsheet.
Create a Google Doc with the draft report and share it with the team.

Token storage

OAuth tokens are stored in:

  • DATA_DIR/token.json — main token
  • DATA_DIR/google-credentials/token.json — workspace MCP token

Tokens are refreshed automatically. If the connection expires, go to Settings → Google Workspace and click Reconnect.

Required scopes

The OAuth app requests these scopes:

  • https://www.googleapis.com/auth/gmail.modify
  • https://www.googleapis.com/auth/calendar
  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/documents
  • https://www.googleapis.com/auth/spreadsheets

You can restrict scopes in the Google Cloud console if you don't need all of them.