Google Workspace MCP Server
Access Google Sheets, Gmail, Calendar, and Drive from workflows
The Google Workspace MCP server provides tools for Google Sheets, Gmail, Calendar, and Drive. Each organization uses its own Google Cloud project for full isolation.
Setup
1. Create a Google Cloud Project
- Go to Google Cloud Console.
- Create a new project (or use an existing one).
- Enable the following APIs:
- Google Sheets API
- Gmail API
- Google Calendar API
- Google Drive API
2. Create OAuth Credentials
- Go to APIs & Services > Credentials.
- Click Create Credentials > OAuth 2.0 Client ID.
- Select Web application as the application type.
- Add an authorized redirect URI:
https://<your-domain>/api/auth/google-workspace/callback - Copy the Client ID and Client Secret.
3. Configure in FlowTrux
- Go to Settings > MCP Servers > Add Server.
- Select Google Workspace.
- Enter the Client ID and Client Secret.
- Click Save.
4. Connect Your Google Account
After saving the credentials:
- A Connect Google Account button appears on the server configuration.
- Click it to open Google's consent screen.
- Authorize FlowTrux to access Sheets, Gmail, Calendar, and Drive.
- On success, you are redirected back to FlowTrux and the server shows a green Connected badge with the authorized email address.
The refresh token is stored encrypted in the database. Google's OAuth library handles automatic token refresh.
5. Assign to a Workspace
- Go to Settings > Workspaces > Edit.
- Enable google-workspace under MCP Servers.
- Click Save.
Reconnecting
If the connection expires or you need to switch Google accounts, click the Reconnect button on the server configuration in Settings.
Tools
Google Sheets
sheets_read
Read data from a spreadsheet range.
| Parameter | Type | Required | Description |
|---|---|---|---|
spreadsheetId | string | Yes | The spreadsheet ID (from the URL) |
range | string | Yes | A1 notation range (e.g., Sheet1!A1:D10) |
sheets_write
Write or overwrite data in a range.
| Parameter | Type | Required | Description |
|---|---|---|---|
spreadsheetId | string | Yes | The spreadsheet ID |
range | string | Yes | A1 notation range |
values | array | Yes | 2D array of values (rows and columns) |
sheets_append
Append rows to the end of a range.
| Parameter | Type | Required | Description |
|---|---|---|---|
spreadsheetId | string | Yes | The spreadsheet ID |
range | string | Yes | A1 notation range (data is appended after existing rows) |
values | array | Yes | 2D array of values to append |
sheets_create
Create a new spreadsheet.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Name for the new spreadsheet |
Gmail
gmail_send
Send an email with optional file attachments.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
subject | string | Yes | Email subject line |
body | string | Yes | Email body (plain text or HTML) |
isHtml | boolean | No | Send body as HTML (default: false) |
cc | string | No | CC recipients (comma-separated) |
bcc | string | No | BCC recipients (comma-separated) |
attachments | array | No | File attachments (see below) |
Attachment object:
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | File name (e.g., offer.pdf) |
mimeType | string | Yes | MIME type (e.g., application/pdf) |
content | string | Yes | Base64-encoded file content |
Example with attachment:
{
"to": "candidate@example.com",
"subject": "Your Offer Letter",
"body": "Please find attached your offer letter.",
"attachments": [
{
"filename": "offer-letter.pdf",
"mimeType": "application/pdf",
"content": "JVBERi0xLjQK..."
}
]
}
gmail_search
Search emails using Gmail search syntax.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Gmail search query (e.g., from:user@example.com subject:invoice) |
maxResults | number | No | Maximum emails to return |
labelIds | array | No | Filter by label IDs (e.g., CATEGORY_UPDATES, UNREAD, INBOX) |
gmail_read
Read a specific email by ID. Returns body text and attachment metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Gmail message ID (from gmail_search results) |
Response includes an attachments array with metadata for each attached file:
| Field | Type | Description |
|---|---|---|
attachmentId | string | Use with gmail_get_attachment to download |
filename | string | Original file name |
mimeType | string | MIME type of the attachment |
size | number | Size in bytes |
gmail_get_attachment
Download a specific attachment from an email as base64-encoded content.
| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | string | Yes | Gmail message ID |
attachmentId | string | Yes | Attachment ID (from gmail_read response) |
filename | string | No | Original filename (included in output for reference) |
Google Calendar
calendar_list_events
List upcoming events.
| Parameter | Type | Required | Description |
|---|---|---|---|
calendarId | string | No | Calendar ID (default: primary) |
timeMin | string | No | Start of time range (ISO 8601) |
timeMax | string | No | End of time range (ISO 8601) |
maxResults | number | No | Maximum events to return |
calendar_create_event
Create a calendar event.
| Parameter | Type | Required | Description |
|---|---|---|---|
summary | string | Yes | Event title |
start | string | Yes | Start time (ISO 8601) |
end | string | Yes | End time (ISO 8601) |
description | string | No | Event description |
attendees | array | No | List of attendee email addresses |
calendar_delete_event
Delete a calendar event.
| Parameter | Type | Required | Description |
|---|---|---|---|
eventId | string | Yes | Event ID (from calendar_list_events) |
calendarId | string | No | Calendar ID (default: primary) |
Google Drive
drive_list_files
List files in Drive.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Drive search query (e.g., mimeType='application/pdf') |
pageSize | number | No | Maximum files to return |
drive_upload
Upload a text file to Drive.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | File name |
content | string | Yes | File content |
mimeType | string | No | MIME type (default: auto-detect) |
folderId | string | No | Destination folder ID |
drive_download
Download file content.
| Parameter | Type | Required | Description |
|---|---|---|---|
fileId | string | Yes | Drive file ID (from drive_list_files) |
Example Workflow
A reporting workflow that writes results to a Google Sheet:
- Trigger -- Cron schedule (weekly on Monday)
- Action -- HTTP request to fetch analytics data
- Agent -- Analyze data and format as rows, tools:
google-workspace:sheets_append - The agent appends the weekly metrics to an existing spreadsheet.