Connect Google to Claude: Manage Files, Folders & Workspace Data
Learn how to connect Google to Claude using a managed MCP server. Automate Google Drive, Calendar, Gmail, and Workspace administration via natural language.
If you need to connect Google to Claude to automate Gmail, Google Drive, Calendar, or Workspace administration, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's tool calls and Google's REST APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL. If your team uses ChatGPT, check out our guide on connecting Google to ChatGPT or explore our broader architectural overview on connecting Google to AI Agents.
Giving a Large Language Model (LLM) read and write access to a sprawling enterprise ecosystem like Google Workspace is an engineering challenge. You have to handle OAuth 2.0 token lifecycles, map massive JSON schemas to MCP tool definitions, and deal with Google's specific rate limits. Every time Google updates an endpoint or deprecates a field, you have to update your server code, redeploy, and test the integration. This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Google, connect it natively to Claude, and execute complex workflows using natural language.
The Engineering Reality of the Google API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against Google's APIs is painful. You are not just integrating "Google" - you are integrating the Gmail API, Drive API, Calendar API, and Admin SDK, all of which have different design patterns, error formats, and quirks.
If you decide to build a custom MCP server for Google, you own the entire API lifecycle. Here are the specific challenges you will face:
Fragmented Pagination Models
Google does not use a single pagination standard. The Drive API uses pageToken and nextPageToken. The Calendar API uses syncToken for incremental syncs. If you expose these raw parameters to Claude, the model will frequently hallucinate token values or misunderstand how to iterate through pages. Truto normalizes this across all Google endpoints into a standard limit and next_cursor schema, explicitly instructing the LLM to pass cursor values back unchanged.
Strict Data Formats and Encoding
Google APIs require highly specific data formats that LLMs struggle to generate consistently from scratch. The Gmail API requires raw message payloads to be Base64url encoded strings. The Calendar API strictly enforces RFC3339 timestamps for start and end times. The Drive API relies on specific MIME types (like application/vnd.google-apps.document) to differentiate between file types. A managed MCP server handles this translation, allowing Claude to pass standard JSON while the proxy layer formats the request exactly as Google expects.
Handling Rate Limits
Google enforces strict rate limits across Workspace APIs. When an upstream API returns an HTTP 429 Too Many Requests, Truto passes that error directly to the caller. Truto normalizes upstream rate limit info into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. Your MCP client or agent framework is responsible for reading these headers and applying exponential backoff. Do not expect the proxy layer to absorb or retry these errors automatically.
OAuth Scope Management
Google requires highly granular OAuth scopes. Reading a file requires drive.readonly, creating a file requires drive.file, and managing users requires admin.directory.user. If your application requests all of them at once, you will trigger intense security warnings and likely fail Google's CASA Tier 2 certification. Truto manages this OAuth lifecycle, refreshing tokens shortly before they expire and ensuring the MCP server only exposes tools that match the authorized scopes.
sequenceDiagram
participant C as Claude
participant M as Truto MCP Server
participant P as Truto Proxy Layer
participant G as Google API
C->>M: Call list_all_google_files<br>with limit=10
M->>P: Validate Token & Map to REST
P->>G: GET /drive/v3/files<br>with OAuth Bearer
G-->>P: JSON Response<br>(nextPageToken)
P-->>M: Normalized Schema<br>(next_cursor)
M-->>C: JSON-RPC ResultHow to Generate a Google MCP Server with Truto
Truto derives MCP tools dynamically from the integration's resource definitions and documentation. A tool only appears in the MCP server if it has a corresponding documentation entry, ensuring Claude only sees well-documented endpoints.
Method 1: Via the Truto UI
This is the fastest path for internal tooling and testing.
- Navigate to the integrated account page for your Google connection in the Truto dashboard.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration. You can name the server, restrict it to specific methods (e.g., read-only), and set an expiration date.
- Copy the generated MCP server URL. This URL contains a cryptographic token that authenticates requests for this specific Google account.
Method 2: Via the API
For production deployments, you will generate MCP servers programmatically when your users need them.
Make a POST request to /integrated-account/:id/mcp:
curl -X POST https://api.truto.one/integrated-account/YOUR_ACCOUNT_ID/mcp \
-H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Google Workspace Agent",
"config": {
"methods": ["read", "write"]
}
}'The API returns a database record containing the ready-to-use URL:
{
"id": "abc-123",
"name": "Google Workspace Agent",
"config": { "methods": ["read", "write"] },
"expires_at": null,
"url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}Connecting the MCP Server to Claude
Once you have the Truto MCP URL, you can connect it to Claude. The server URL is fully self-contained - the URL alone is enough to authenticate and serve tools.
Method A: Via the Claude UI
If you are using Claude Desktop or Claude for Enterprise, you can add the server directly through the interface.
- Open Claude and navigate to Settings.
- Select Integrations (or Connectors depending on your tier).
- Click Add MCP Server or Add custom connector.
- Paste the Truto MCP URL and click Add.
Claude will immediately ping the server, execute the initialization handshake, and populate its context with the available Google tools.
Method B: Via Manual Config File
For developers running custom agents or using the standard Claude Desktop configuration file, you can define the server manually using Server-Sent Events (SSE).
Edit your claude_desktop_config.json file:
{
"mcpServers": {
"google-workspace": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/YOUR_GENERATED_TOKEN"
]
}
}
}Restart Claude Desktop. The client will connect over the HTTP-Streamable transport protocol and discover the tools.
Security and Access Control
Exposing an entire Google Workspace to an LLM requires strict boundaries. Truto provides several mechanisms to lock down your MCP servers:
- Method filtering: Restrict the MCP server to read-only operations by passing
config.methods: ["read"]during creation. This prevents Claude from accidentally deleting files or sending emails. - Tag filtering: Restrict the server to specific resource types using tags. For example, pass
config.tags: ["drive"]to expose only file and folder tools, completely blocking access to Gmail or Calendar. - Token auth: Set
require_api_token_auth: truefor enterprise environments. This forces the MCP client to provide a valid Truto API token in theAuthorizationheader, meaning possession of the URL alone is not enough to execute tools. - Ephemeral access: Set an
expires_atdatetime for temporary credentials. This is ideal for contractor access or short-lived automated workflows. The platform schedules work ahead of token expiry to automatically clean up the database record and associated state.
Hero Tools for Google Workspace
When Claude connects to the Truto MCP server, it gains access to dozens of Google API endpoints mapped as executable tools. Here are the most powerful tools for agentic workflows.
list_all_google_files
- Description: Retrieves the user's files stored in Google Drive. This method allows filtering results using the
qparameter, which accepts search queries to find specific files based on name, type, ownership, and other metadata. - Example Prompt: "Pull a list of all PDF files created in the last 7 days that are owned by me."
create_a_google_document
- Description: Create a new Google Docs document. Returns the created document object including its document ID and title.
- Example Prompt: "Create a new Google Doc called 'Q3 Marketing Plan' and return the file ID."
list_all_google_events
- Description: List events in a Google Calendar. Returns a collection of event items for the specified calendar, allowing Claude to read schedules and check availability.
- Example Prompt: "Check my primary calendar for any meetings scheduled tomorrow between 1 PM and 5 PM."
create_a_google_event
- Description: Create a new event in a Google Calendar. Returns the created event object. Claude can use this to schedule meetings, set start and end times, and invite attendees.
- Example Prompt: "Schedule a 45-minute sync with engineering@example.com for tomorrow at 10 AM."
list_all_google_messages
- Description: List Gmail messages in the authenticated user's mailbox. Returns ID and threadId for matched messages. Claude can use standard Gmail search operators in the query.
- Example Prompt: "Find all unread emails from the domain @acmecorp.com received this week."
create_a_google_user
- Description: Create a new Google Workspace user in the directory with a primary email, name, and password. Essential for IT onboarding automation.
- Example Prompt: "Provision a new Google Workspace account for Jane Doe with the email jane.doe@ourcompany.com."
Full Google Tool Inventory
Here is the complete inventory of additional Google tools available. For full schema details, visit the Google integration page.
- get_single_google_file_by_id: Retrieves metadata or content from a single file on the user's Google Drive. It always requires the ID to fetch.
- list_all_google_folders: List all Google Drive folders. Returns folder objects including id, name, and mimeType, filtered automatically to items of type folder.
- get_single_google_folder_by_id: Get a single Google Drive folder by id. Returns the full folder metadata including id, name, mimeType, and parents.
- list_all_google_drive: List all shared drives available in Google Drive. Returns an array of drive objects including their metadata.
- get_single_google_drive_by_id: Get a single Google Drive shared drive by id. Returns the full drive object including its metadata.
- list_all_google_search: Retrieves the user's files stored in Google Drive. This method allows filtering results using the q parameter to find specific files or folders based on metadata like name and ownership.
- get_single_google_file_export_by_id: Export a Google Drive file to a specified MIME type. Returns the exported file content as a binary stream.
- list_all_google_drive_items: List files and folders in Google Drive, including items from all shared drives. Returns an array of file metadata objects.
- get_single_google_drive_item_by_id: Get a single Google Drive file or folder by id. Returns the full file metadata object.
- list_all_google_user_info: Retrieves basic profile information about the authenticated user in Google Calendar, including name, email, and profile picture.
- get_single_google_form_by_id: Get a single Google Form by id. Returns the full form object including its structure, title, and items.
- list_all_google_forms: List all Google Forms accessible in Google Drive. Returns an array of file objects representing forms.
- list_all_google_responses: List all responses submitted to a specific Google Form. Returns an array of form response objects.
- get_single_google_response_by_id: Get a single response submitted to a Google Form by its id. Returns the full response object.
- list_all_google_conference_records: List Google Meet conference records. Returns a collection of conferenceRecords objects from the Google Meet API.
- get_single_google_conference_record_by_id: Get a single Google Meet conference record by id. Returns the conference record object.
- list_all_google_conference_record_transcripts: List transcripts for a Google Meet conference record. Returns a collection of transcript objects.
- get_single_google_conference_record_transcript_by_id: Get a single transcript from a Google Meet conference record by id. Returns the transcript object.
- list_all_google_conference_record_transcript_entries: List transcript entries for a specific Google Meet conference record transcript. Returns a collection of transcript entries.
- get_single_google_conference_record_transcript_entry_by_id: Get a single transcript entry from a Google Meet conference record transcript by id.
- list_all_google_conference_record_participants: List participants for a specific Google Meet conference record. Returns an array of participant objects.
- get_single_google_conference_record_participant_by_id: Get a single participant from a Google Meet conference record by id. Returns the participant object.
- list_all_google_documents: List Google Drive documents (Google Docs files). Returns an array of file objects including id, name, and mimeType.
- get_single_google_document_by_id: Get a single Google Drive document by id. Returns the full file metadata object.
- list_all_google_document_content: Get a Google document by page_id. Returns the full document object including its body content and title.
- google_document_content_batch_update: Apply one or more structured updates to a Google document identified by document_id.
- list_all_google_calendar_lists: List all entries on the Google Calendar list for a user. Returns an array of calendar list items including calendar ids.
- get_single_google_calendar_list_by_id: Get a single entry from the Google Calendar list by id. Returns the calendar list entry details.
- create_a_google_calendar_list: Add a calendar to the authenticated user's Google Calendar list. Returns the newly created calendar list entry.
- update_a_google_calendar_list_by_id: Update an existing entry on the Google Calendar list by id. Returns the updated calendar list entry.
- delete_a_google_calendar_list_by_id: Delete a calendar entry from the Google Calendar list by id. Returns an empty response on success.
- google_calendar_lists_watch: Watch for changes to the Google Calendar list for a user. Returns a channel object for push notifications.
- get_single_google_calendar_by_id: Get metadata for a calendar by id in Google Calendar, such as summary, description, and timeZone.
- create_a_google_calendar: Create a secondary calendar with summary in Google Calendar. Returns the created calendar's id and details.
- update_a_google_calendar_by_id: Update metadata for a calendar using id in Google Calendar. Returns updated calendar fields.
- delete_a_google_calendar_by_id: Delete a secondary calendar by id in Google Calendar. Returns an empty response body on success.
- google_calendars_clear: Clear all events from the calendar identified by id in Google Calendar. Deletes all events associated with the calendar.
- get_single_google_event_by_id: Get a single Google Calendar event by id. Returns the full event object for the specified calendar.
- update_a_google_event_by_id: Partially update an existing Google Calendar event using a patch. Returns the updated event object.
- google_events_quick_add: Quickly create a Google Calendar event from a free-text description string.
- google_events_move: Move a Google Calendar event to a different calendar. Returns the updated event object reflecting its new calendar.
- delete_a_google_event_by_id: Delete a Google Calendar event by id. Returns an empty response on success.
- google_events_import: Import a Google Calendar event into the specified calendar, typically used to add an existing iCalendar event.
- google_events_watch: Subscribe to push notifications for changes to Google Calendar events in a specific calendar.
- list_all_google_event_instances: Get instances of a recurring event by calendar_id and id in Google Calendar.
- list_all_google_free_busy: Get free/busy information for a set of calendars in Google Calendar. Returns busy time ranges.
- list_all_google_search_contacts: Get a list of contacts matching the query in Google Calendar. Returns matched contacts with names, emails, and phone numbers.
- get_single_google_search_contact_by_id: Get information about a specific contact by id in Google Calendar, including names and organizations.
- delete_a_google_search_contact_by_id: Delete a contact person by id in Google Calendar. The response is empty if successful.
- list_all_google_other_contacts: Get a list of other contacts matching the query in Google Calendar, returning email addresses and names.
- list_all_google_acl: Get the access control list rules for the calendar with calendar_id in Google Calendar.
- get_single_google_acl_by_id: Get an access control rule for a calendar in Google Calendar using calendar_id and id.
- delete_a_google_acl_by_id: Delete an access control rule for a calendar in Google Calendar. Requires calendar_id and id.
- update_a_google_acl_by_id: Update an access control rule for a calendar in Google Calendar using calendar_id and id.
- create_a_google_acl: Create an access control rule for a calendar in Google Calendar using calendar_id.
- google_acl_watch: Watch for changes to ACL resources for calendar identified by calendar_id in Google Calendar.
- google_channels_stop: Stop watching resources through a channel in Google Calendar. Returns an empty response on success.
- list_all_google_colors: Get color definitions for calendars and events in Google Calendar.
- list_all_google_settings: Get all user settings for the authenticated user in Google Calendar. Supports pagination and incremental sync.
- get_single_google_setting_by_id: Get a single user setting by id in Google Calendar. Returns the setting's id and value.
- google_settings_watch: Watch for changes to Settings resources in Google Calendar. Creates a notification channel.
- get_single_google_customer_by_id: Get a Google Admin Directory customer by id. Returns the customer object from the Admin Directory API.
- list_all_google_licenses: List Google Workspace product licenses assigned to users for a given product.
- list_all_google_usage_reports: List Google Admin usage reports for all users on a specific date. Returns usage activity records.
- list_all_google_users: List all Google Workspace users in the directory, including id, primaryEmail, and name.
- get_single_google_user_by_id: Get a single Google Workspace user by id. Returns full user object and associated account details.
- update_a_google_user_by_id: Update an existing Google Workspace user by id, replacing the resource with the supplied fields.
- delete_a_google_user_by_id: Delete a Google Workspace user by id. Returns an empty 204 response on success.
- list_all_google_groups: List groups in the Google Directory. Returns an array of group objects for the customer.
- get_single_google_group_by_id: Get a single Google Directory group by id. Returns the full group object.
- create_a_google_oauth_token: Exchange an authorization code or refresh token for a Google OAuth access token via the Google OAuth2 token endpoint.
- list_all_google_roles: List all roles defined in the Google Admin Directory for the authenticated customer.
- list_all_google_role_assignments: List all role assignments for your Google Admin Directory customer account.
- list_all_google_tokens: List all OAuth tokens issued by a Google user to third-party applications.
- list_all_google_accounts: List all Google Analytics accounts accessible to the authenticated user.
- list_all_google_group_members: List all members of a Google group. Returns member records for the specified group.
- get_single_google_group_member_by_id: Get a single member of a Google group by id. Returns the member record.
- create_a_google_group_member: Add a new member to a Google group. Returns the created member record.
- update_a_google_group_member_by_id: Update an existing member of a Google group by id. Returns the updated member record.
- delete_a_google_group_member_by_id: Remove a member from a Google group by id. Returns an empty response on success.
- list_all_google_account_users: List Google Analytics account user links (entityUserLinks) for a specific account.
- get_single_google_message_by_id: Get a single Gmail message by id. Returns the full message resource.
- create_a_google_message: Send a Gmail message on behalf of the authenticated user. Returns the sent message resource.
- delete_a_google_message_by_id: Permanently delete a Gmail message by id. Returns an empty response on success.
- update_a_google_message_by_id: Modify label assignments on a Gmail message by id. Returns the updated message resource.
- list_all_google_threads: List Gmail threads for the authenticated user. Returns a list of thread objects.
- get_single_google_thread_by_id: Get a single Gmail thread by id. Returns full thread object including messages and metadata.
- update_a_google_thread_by_id: Modify labels on a Gmail thread by id. Returns the updated thread object.
- delete_a_google_thread_by_id: Permanently delete a Gmail thread by id. Returns an empty response on success.
- create_a_google_batch: Send a batch of Google Gmail API requests in a single HTTP call using a raw-format body.
- list_all_google_batch: Send a batch of Google Gmail API requests in a single HTTP call using a JSON-format body.
- list_all_google_labels: List all labels in the user's mailbox in Gmail. Returns label id, name, and visibility settings.
- get_single_google_label_by_id: Get the specified label by id for user_id in Gmail. Returns label details.
- create_a_google_label: Create a new label for the user identified by user_id in Gmail.
- delete_a_google_label_by_id: Delete a label by id for the user_id in Gmail. Permanently removes the label.
- update_a_google_label_by_id: Patch the specified label for user_id and id in Gmail. Returns updated label details.
- get_single_google_attachment_by_id: Get a specific attachment from a Gmail message by attachment id.
- list_all_google_permissions: List permissions for a Google Drive file, including id, role, and email address.
- list_all_google_drive_labels: List Google Drive labels available in the account. Returns a collection of label objects.
- list_all_google_file_labels: List labels applied to a specific Google Drive file.
- list_all_google_org_units: List Google organizational units for the customer from the Admin Directory API.
- list_all_google_people: List people from the Google directory via the People API.
- list_all_google_comments: List all comments on a Google Drive file, including author and content.
- get_single_google_comment_by_id: Get a single comment on a Google Drive file by id, including replies.
- list_all_google_revisions: List all revisions for a Google Drive file. Returns a collection of revision objects.
- get_single_google_revision_by_id: Get a single revision of a Google Drive file by revision id.
Workflows in Action
Connecting Claude to Google Workspace allows you to string multiple API calls together to execute complex, multi-step operations. Here is how Claude handles real-world scenarios.
Scenario 1: IT Onboarding Automation
"We just hired Alex Chen as a Senior Engineer. Provision his Google Workspace account (alex.chen@ourcompany.com), add him to the Engineering Google Group, and schedule his IT orientation meeting for next Monday at 10 AM."
Step-by-step Execution:
- Claude calls
create_a_google_userwith the provided name and email to generate the core Workspace identity. - Claude calls
list_all_google_groupswith a search query for "Engineering" to retrieve the correct Group ID. - Claude calls
create_a_google_group_memberusing the Group ID and Alex's new email address to grant him access to team resources. - Claude calls
create_a_google_eventto block out the IT orientation on the calendar, automatically adding Alex as an attendee.
Result: The user receives a confirmation that the account is active, the group permissions are set, and the calendar invite has been sent. A process that typically requires clicking through three different Google admin panels is completed in seconds.
Scenario 2: Automated Meeting Preparation
"Find the latest email thread with Acme Corp regarding our Q3 contract. Extract the key action items, put them in a new Google Doc called 'Acme Q3 Prep', and drop that document into our Shared Drive."
Step-by-step Execution:
- Claude calls
list_all_google_messageswith the search queryfrom:acmecorp.com subject:Q3 contractto locate the relevant email thread. - Claude calls
get_single_google_thread_by_idto read the full context of the messages. - Claude uses its internal reasoning to summarize the thread and extract action items.
- Claude calls
create_a_google_documentwith the title "Acme Q3 Prep". - Claude calls
google_document_content_batch_updateto insert the summarized text into the newly created document.
Result: The user gets a direct link to a newly generated, formatted Google Doc containing the exact summary requested, fully bypassing the manual work of searching Gmail, copying text, and formatting a new document.
FAQ
- How do I connect Google Workspace to Claude?
- You need an MCP server to act as a translation layer between Claude and Google's APIs. You can generate a managed MCP server URL using Truto and add it directly to Claude's integration settings.
- Can Claude read my Google Drive files?
- Yes. By exposing the list_all_google_files and get_single_google_file_by_id tools through an MCP server, Claude can search your Drive and read specific file contents.
- How does Truto handle Google API rate limits for AI agents?
- Truto normalizes Google's rate limit data into standard IETF headers (ratelimit-limit, ratelimit-remaining). When Google returns a 429 error, Truto passes it to the caller, requiring your agent framework to handle exponential backoff.
- Is it secure to give Claude access to Google Workspace?
- Yes, if configured correctly. You can restrict the MCP server to read-only methods, filter access to specific tags (like Calendar only), and require API token authentication for every request.