How to integrate Gmail MCP with Antigravity

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Gmail logo
Antigravity logo
divider

How to integrate Gmail MCP with Antigravity

Antigravity IDE is Google's agentic IDE, built on a VS Code-style editor and powered by models like Gemini 3.5 Flash, Gemini 3.1 Pro, Opus 4.6, and more. It treats the AI agent as a first-class teammate, planning, coding, and validating work through an Agent Manager dashboard with deep browser connectivity.

In this guide, I will explain the easiest and most secure way to connect your Gmail account to Antigravity IDE via Composio Connect, so it can summarize unread emails from this morning, create draft replies to urgent messages, fetch contact details for recent senders, and more without ever putting your account credentials at risk.

Also integrate Gmail with

Why use Composio?

Composio provides:

  • Access to 1,000+ managed apps from a single MCP endpoint. This makes it convenient for agents to run cross-app workflows.
  • Programmatic tool calling. Allows LLMs to write code in a remote workbench to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
  • Large tool response handling outside the LLM context. This minimizes context bloat from large tool responses.
  • Dynamic just-in-time access to thousands of tools across hundreds of apps. Composio loads the tools your agent needs, so LLMs are not overwhelmed by tools they do not need.

Connect Gmail to Antigravity

Antigravity does not ship with one-click custom MCP install links yet, so configuration goes through the IDE's raw config file. The process takes under a minute.

1. Open the MCP Config

Go to Antigravity Settings, open the Customizations tab, then click Open MCP Config to open mcp_config.json in the editor.

Antigravity Customizations settings with Open MCP Config button

2. Get your API key

Go to the Composio Dashboard and copy your API key.

Composio Dashboard showing where to get the API key

3. Add Composio to mcp_config.json

Paste the following configuration into the file:

bash
{
  "mcpServers": {
    "remote-composio": {
      "serverUrl": "https://connect.composio.dev/mcp",
      "headers": {
        "x-consumer-api-key": "your-composio-api-key"
      }
    }
  }
}

Note: Antigravity uses serverUrl, not url, for remote HTTP-based MCP servers. This differs from the url key used in Cursor and VS Code configs.

Save the file and click refresh in the Installed MCP Servers section.

Antigravity showing Composio tools after MCP setup

Connect your Gmail account

Back in the Antigravity agent panel, ask the agent to connect to Gmail or give it any Gmail-related task.

For example, ask it to:

  • "Summarize unread emails from this morning"
  • "Create draft replies to urgent messages"
  • "Fetch contact details for recent senders"

It will prompt you to authenticate and authorize access to Gmail.

That is it. Composio tools are now available in Antigravity, and your Gmail account is ready to use.

Supported Tools & Triggers

Tools
Triggers
Modify email labelsAdds and/or removes specified Gmail labels for a message; ensure `message_id` and all `label_ids` are valid (use 'listLabels' for custom label IDs).
Batch delete Gmail messagesTool to permanently delete multiple Gmail messages in bulk, bypassing Trash with no recovery possible.
Batch modify Gmail messagesModify labels on multiple Gmail messages in one efficient API call.
Create email draftCreates a Gmail email draft.
Create Gmail filterTool to create a new Gmail filter with specified criteria and actions.
Create labelCreates a new label with a unique name in the specified user's Gmail account.
Create Prompt PostSend a one-shot prompt to the Sanity Content Agent.
Delete DraftPermanently deletes a specific Gmail draft using its ID with no recovery possible; verify the correct `draft_id` and obtain explicit user confirmation before calling.
Delete Gmail filterTool to permanently delete a Gmail filter by its ID.
Delete label from account (permanent)Permanently DELETES a user-created Gmail label from the account (not from a message).
Delete messagePermanently deletes a specific email message by its ID from a Gmail mailbox; for `user_id`, use 'me' for the authenticated user or an email address to which the authenticated user has delegated access.
Delete threadTool to immediately and permanently delete a specified thread and all its messages.
Fetch emailsFetches a list of email messages from a Gmail account, supporting filtering, pagination, and optional full content retrieval.
Fetch message by message IDFetches a specific email message by its ID, provided the `message_id` exists and is accessible to the authenticated `user_id`.
Fetch Message by Thread IDRetrieves messages from a Gmail thread using its `thread_id`, where the thread must be accessible by the specified `user_id`.
Forward email messageForward an existing Gmail message to specified recipients, preserving original body and attachments.
Get Gmail attachmentRetrieves a specific attachment by ID from a message in a user's Gmail mailbox, requiring valid message and attachment IDs.
Get Auto-Forwarding SettingsTool to get the auto-forwarding setting for the specified account.
Get contactsFetches contacts (connections) for the authenticated Google account, allowing selection of specific data fields and pagination.
Get DraftRetrieves a single Gmail draft by its ID.
Get Gmail filterTool to retrieve a specific Gmail filter by its ID.
Get label detailsGets details for a specified Gmail label.
Get Language SettingsTool to retrieve the language settings for a Gmail user.
Get PeopleRetrieves either a specific person's details (using `resource_name`) or lists 'Other Contacts' (if `other_contacts` is true), with `person_fields` specifying the data to return.
Get ProfileRetrieves Gmail profile information (email address, aggregate messagesTotal/threadsTotal, historyId) for a user.
Get Vacation SettingsTool to retrieve vacation responder settings for a Gmail user.
Import messageTool to import a message into the user's mailbox with standard email delivery scanning and classification.
Insert message into mailboxTool to insert a message into the user's mailbox similar to IMAP APPEND.
List CSE identitiesTool to list client-side encrypted identities for an authenticated user.
List CSE key pairsTool to list client-side encryption key pairs for an authenticated user.
List DraftsRetrieves a paginated list of email drafts from a user's Gmail account.
List Gmail filtersTool to list all Gmail filters (rules) in the mailbox.
List forwarding addressesTool to list all forwarding addresses for the specified Gmail account.
List Gmail historyTool to list Gmail mailbox change history since a known startHistoryId.
List Gmail labelsRetrieves all system and user-created labels for a Gmail account in a single unpaginated response.
List send-as aliasesLists the send-as aliases for a Gmail account, including the primary address and custom 'from' aliases.
List S/MIME configsLists S/MIME configs for the specified send-as alias.
List threadsRetrieves a list of email threads from a Gmail account, identified by `user_id` (email address or 'me'), supporting filtering and pagination.
Modify thread labelsAdds or removes specified existing label IDs from a Gmail thread, affecting all its messages; ensure the thread ID is valid.
Trash threadMoves the specified thread to the trash.
Move to TrashMoves an existing, non-deleted email message to the trash for the specified user.
Patch LabelPatches the specified user-created label.
Patch send-as aliasTool to patch the specified send-as alias for a Gmail user.
Reply to email threadSends a reply within a specific Gmail thread using the original thread's subject; do not provide a custom subject as it will start a new conversation instead of replying in-thread.
Search PeopleSearches contacts by matching the query against names, nicknames, emails, phone numbers, and organizations, optionally including 'Other Contacts'.
Send DraftSends an existing draft email AS-IS to recipients already defined within the draft.
Send EmailSends an email via Gmail API using the authenticated user's Google profile display name.
Get IMAP SettingsRetrieves the IMAP settings for a Gmail user account, including whether IMAP is enabled, auto-expunge behavior, expunge behavior, and maximum folder size.
Get POP settingsTool to retrieve POP settings for a Gmail account.
Get send-as aliasTool to retrieve a specific send-as alias configuration for a Gmail user.
Stop watch notificationsTool to stop receiving push notifications for a Gmail mailbox.
Untrash MessageTool to remove a message from trash in Gmail.
Untrash threadTool to remove a thread from trash in Gmail.
Update draftUpdates (replaces) an existing Gmail draft's content in-place by draft ID.
Update IMAP settingsTool to update IMAP settings for a Gmail account.
Update LabelTool to update the properties of an existing Gmail label.
Update Language SettingsTool to update the language settings for a Gmail user.
Update POP settingsTool to update POP settings for a Gmail account.
Update send-as aliasTool to update a send-as alias for a Gmail user.
Update User Attributes ValuesUpdate user attribute values for a resource.
Update Vacation SettingsTool to update vacation responder settings for a Gmail user.

Conclusion

You have successfully connected Gmail to Antigravity using Composio Connect. Your agent can now use Gmail securely without exposing credentials in prompts or local scripts.

How to build Gmail MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Gmail MCP?

With a standalone Gmail MCP server, the agents and LLMs can only access a fixed set of Gmail tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Gmail and many other apps based on the task at hand, all through a single MCP endpoint.

Can I use Tool Router MCP with Antigravity?

Yes, you can. Antigravity fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Gmail tools.

Can I manage the permissions and scopes for Gmail while using Tool Router?

Yes, absolutely. You can configure which Gmail scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Gmail data and credentials are handled as safely as possible.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.