All integrations

Gmail

Hosted Gmail MCP for Claude, ChatGPT and Cursor. OAuth setup, read and send mail, and cross-tool attachment handoff via the private gateway.

OAuth 7 tools

Overview

Read and send email through Gmail API with AI clients. Use this Gmail MCP integration to connect Claude, ChatGPT, or Cursor to a Google mailbox with OAuth — no IMAP passwords in prompts.

Common use cases

  • Connect Gmail to ChatGPT or Claude — search threads, read messages, and draft replies through MCP tools.
  • Governed OAuth scopes — credentials stay in stackgate.ai; agents never see your Google password.
  • Cross-tool workflows — download attachments to Temp Storage and hand files to other integrations via the private gateway.

Prerequisites

  • A Google account with Gmail enabled
  • A stackgate.ai account

Getting credentials

  1. Sign in to stackgate.ai and open Integrations → Gmail.
  2. Click Activate, then Connect Gmail.
  3. Sign in with Google and grant the requested Gmail scopes.

stackgate.ai uses the same Google OAuth app as Google Calendar and Search Console where applicable.

Using with AI clients

  • Dedicated endpoint: POST /mcp/gmail
  • Private gateway: gmail__* tools

Set store_in_temp_storage=true on download_attachment to store an attachment in Temp Storage and receive a file_id for cross-tool handoff. Requires Temp Storage activated on My Integrations.

Troubleshooting

  • Insufficient scopes — reconnect Gmail to refresh OAuth permissions.
  • Send failures — verify the connected account has permission to send from the requested address.

Available tools

  • list_accounts

    List connected Gmail accounts for this hub user (id, label, email) and the default account.

  • list_labels

    List Gmail labels for the connected mailbox, including system labels like INBOX and UNREAD.

  • list_messages

    List or search Gmail messages in the connected mailbox. Returns message IDs and thread IDs; use get_message for full content.

  • get_message

    Get a Gmail message by ID, including headers and body when format is full.

  • download_attachment

    Download a Gmail attachment by message ID and attachment ID. Returns metadata plus embedded binary content for files under 10 MB, or a resource_link for larger files (fetch bytes via resources/read). Pass mime_type and filename from get_message payload parts when available. Set store_in_temp_storage=true to store in temp storage and receive a file_id for cross handoff.

  • send_message

    Send an email from the connected Gmail account. Supports plain text or HTML body. Pass thread_id to reply in an existing conversation.

  • modify_message_labels

    Add or remove Gmail labels on a message. Use list_labels to discover label IDs.

MCP endpoint: https://stackgate.ai/mcp/gmail (HTTP) or via the private gateway.