FlowTruxFlowTrux/Docs
Docsmcp

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

  1. Go to Google Cloud Console.
  2. Create a new project (or use an existing one).
  3. Enable the following APIs:
    • Google Sheets API
    • Gmail API
    • Google Calendar API
    • Google Drive API

2. Create OAuth Credentials

  1. Go to APIs & Services > Credentials.
  2. Click Create Credentials > OAuth 2.0 Client ID.
  3. Select Web application as the application type.
  4. Add an authorized redirect URI:
    https://<your-domain>/api/auth/google-workspace/callback
    
  5. Copy the Client ID and Client Secret.

3. Configure in FlowTrux

  1. Go to Settings > MCP Servers > Add Server.
  2. Select Google Workspace.
  3. Enter the Client ID and Client Secret.
  4. Click Save.

4. Connect Your Google Account

After saving the credentials:

  1. A Connect Google Account button appears on the server configuration.
  2. Click it to open Google's consent screen.
  3. Authorize FlowTrux to access Sheets, Gmail, Calendar, and Drive.
  4. 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

  1. Go to Settings > Workspaces > Edit.
  2. Enable google-workspace under MCP Servers.
  3. 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.

ParameterTypeRequiredDescription
spreadsheetIdstringYesThe spreadsheet ID (from the URL)
rangestringYesA1 notation range (e.g., Sheet1!A1:D10)
sheets_write

Write or overwrite data in a range.

ParameterTypeRequiredDescription
spreadsheetIdstringYesThe spreadsheet ID
rangestringYesA1 notation range
valuesarrayYes2D array of values (rows and columns)
sheets_append

Append rows to the end of a range.

ParameterTypeRequiredDescription
spreadsheetIdstringYesThe spreadsheet ID
rangestringYesA1 notation range (data is appended after existing rows)
valuesarrayYes2D array of values to append
sheets_create

Create a new spreadsheet.

ParameterTypeRequiredDescription
titlestringYesName for the new spreadsheet

Gmail

gmail_send

Send an email with optional file attachments.

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringYesEmail subject line
bodystringYesEmail body (plain text or HTML)
isHtmlbooleanNoSend body as HTML (default: false)
ccstringNoCC recipients (comma-separated)
bccstringNoBCC recipients (comma-separated)
attachmentsarrayNoFile attachments (see below)

Attachment object:

FieldTypeRequiredDescription
filenamestringYesFile name (e.g., offer.pdf)
mimeTypestringYesMIME type (e.g., application/pdf)
contentstringYesBase64-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..."
    }
  ]
}

Search emails using Gmail search syntax.

ParameterTypeRequiredDescription
querystringYesGmail search query (e.g., from:user@example.com subject:invoice)
maxResultsnumberNoMaximum emails to return
labelIdsarrayNoFilter by label IDs (e.g., CATEGORY_UPDATES, UNREAD, INBOX)
gmail_read

Read a specific email by ID. Returns body text and attachment metadata.

ParameterTypeRequiredDescription
messageIdstringYesGmail message ID (from gmail_search results)

Response includes an attachments array with metadata for each attached file:

FieldTypeDescription
attachmentIdstringUse with gmail_get_attachment to download
filenamestringOriginal file name
mimeTypestringMIME type of the attachment
sizenumberSize in bytes
gmail_get_attachment

Download a specific attachment from an email as base64-encoded content.

ParameterTypeRequiredDescription
messageIdstringYesGmail message ID
attachmentIdstringYesAttachment ID (from gmail_read response)
filenamestringNoOriginal filename (included in output for reference)

Google Calendar

calendar_list_events

List upcoming events.

ParameterTypeRequiredDescription
calendarIdstringNoCalendar ID (default: primary)
timeMinstringNoStart of time range (ISO 8601)
timeMaxstringNoEnd of time range (ISO 8601)
maxResultsnumberNoMaximum events to return
calendar_create_event

Create a calendar event.

ParameterTypeRequiredDescription
summarystringYesEvent title
startstringYesStart time (ISO 8601)
endstringYesEnd time (ISO 8601)
descriptionstringNoEvent description
attendeesarrayNoList of attendee email addresses
calendar_delete_event

Delete a calendar event.

ParameterTypeRequiredDescription
eventIdstringYesEvent ID (from calendar_list_events)
calendarIdstringNoCalendar ID (default: primary)

Google Drive

drive_list_files

List files in Drive.

ParameterTypeRequiredDescription
querystringNoDrive search query (e.g., mimeType='application/pdf')
pageSizenumberNoMaximum files to return
drive_upload

Upload a text file to Drive.

ParameterTypeRequiredDescription
namestringYesFile name
contentstringYesFile content
mimeTypestringNoMIME type (default: auto-detect)
folderIdstringNoDestination folder ID
drive_download

Download file content.

ParameterTypeRequiredDescription
fileIdstringYesDrive file ID (from drive_list_files)

Example Workflow

A reporting workflow that writes results to a Google Sheet:

  1. Trigger -- Cron schedule (weekly on Monday)
  2. Action -- HTTP request to fetch analytics data
  3. Agent -- Analyze data and format as rows, tools: google-workspace:sheets_append
  4. The agent appends the weekly metrics to an existing spreadsheet.