Skip to content
Gmail logoGmail logo

Gmail Integrations

Email

Build Gmail automations with your AI agent. Run them on Zapier.

Add Zapier to Claude, ChatGPT, Cursor, or another AI agent, and your agent can build automations across Gmail and 10,000+ other apps.
apps to connect
10,000+
ways to start a workflow
8
available app actions
15
  • Dependable AI workflows
  • Full audit trails and controls
  • Easy visual workflow manager
  • Free tier available
  • SOC 2 Type II, SOC 3, GDPR, and CCPA compliant

Top teams trust Zapier to automate work

  • Samsung
  • Okta
  • Mastercard
  • Nvidia
  • Airbnb

Gmail MCP server: connect Gmail to your AI agent with Zapier

Install Zapier once, then tell your agent what you want done. Behind the scenes, Zapier MCP finds the right triggers and actions to use with Gmail and runs them—all with your credentials managed by Zapier and kept out of the model.

Paste into any AI tool
Connect to Zapier MCP at https://mcp.zapier.com/api/v1/connect and help me sign in to Zapier or sign up. Then connect my Gmail account and help me build a Zap with Gmail: ask me what I want to automate. Read the setup steps at https://zapier.com/AGENTS.md if you can't connect.

Paste this prompt into Claude, ChatGPT, Cursor, or your preferred AI agent to build Gmail automations.

MCP server · Streamable HTTP
https://mcp.zapier.com/api/v1/connect

Install this server in Claude, ChatGPT, Cursor, VS Code, or any MCP client. You sign in once with OAuth.

Terminal · in your project
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli
npx zapier-sdk login
npx zapier-sdk create-connection gmail

Call any app action from TypeScript. Zapier handles OAuth, token refresh, retries, and rate limits.

Terminal · no project
npx @zapier/install-zapier

Run this command to print setup instructions for your client, then follow the prompts to sign in.

Ask your AI agent to do it

Tell Claude, ChatGPT, or your go-to AI agent to install Zapier MCP, and it’ll get you started with Zapier.

Wire it into your own code

Connect your agent to Gmail and 10,000+ more apps with the TypeScript SDK. Zapier handles OAuth and token refresh.

Set it up from your terminal

Tell your coding agent to run one command. It installs Zapier MCP so your agent can use Gmail and other apps.

Use a premade Gmail automation template to start building from anywhere: in your go-to agent interface, in code, or in Zapier.

With Zapier MCP installed, your AI agent can build automations across 10,000+ apps and 90,000+ triggers and actions. Automations run reliably on Zapier from an app event, on a schedule (cron), or from a webhook. Here are the Gmail triggers and actions your agent can build with right away.

  • New Attachment

    Triggers when you receive a new attachment. Each check only finds emails received in the last hour, so attachments on older emails will not trigger, even if they appear in test results.

  • New Label

    Triggers when you add a new label.

  • New Labeled Conversation

    Triggers the first time a label is added to a conversation. Replies within that conversation will not trigger again.

  • New Labeled Email

    Triggers when an email is labeled. Also triggers when a reply is added to the conversation.

  • New Email

    Triggers when a new email appears in the specified mailbox. Each check only finds emails received in the last hour, so older emails moved into the mailbox or label will not trigger, even if they appear in test results. To trigger on older emails you label, use New Labeled Email.

  • New Email Matching Search

    Triggers when you receive a new email that matches a search string you provide. Each check only finds emails received in the last hour, so older emails that match later (for example, after you label them) will not trigger, even if they appear in test results. To trigger on older emails you label, use New Labeled Email.

  • New Starred Email

    Triggers when you receive a new email and star it within two days.

  • New Conversation

    Triggers when a new email conversation begins in your inbox. Each check only finds conversations with an email received in the last hour, so older conversations moved into a label will not trigger, even if they appear in test results. To trigger on older conversations you label, use New Labeled Conversation.

Your agent picks the right Gmail action from what you ask. Connect Zapier once and it can use 22 Gmail tools, each with typed inputs. Zapier handles Gmail’s login, so you never paste an API key. The same actions run from TypeScript through the Zapier SDK.

Set up Gmail MCP in Claude, Claude Code, ChatGPT, Cursor, and Codex

Zapier MCP works with any MCP client that supports Streamable HTTP. Connect or add Zapier in your AI tool, sign in when prompted, then ask for Gmail.

MCP server · Streamable HTTP · OAuth
https://mcp.zapier.com/api/v1/connect
  • Claude

    Connect Zapier in Claude and sign in when prompted. Claude setup guide

  • Claude Code

    Install Zapier MCP in Claude Code, then sign in from the terminal. Claude Code setup guide

  • ChatGPT

    Connect Zapier in ChatGPT and approve the sign-in. ChatGPT setup guide

  • Cursormcp.json

    Add Zapier to Cursor and sign in. Cursor setup guide

  • Codex

    Add Zapier to Codex and sign in. Codex setup guide

  • VS Code and other clientsmcp.json

    Add Zapier to any MCP client that supports Streamable HTTP.

  • OpenCodeopencode.json

    Add Zapier to OpenCode.

  • Terminal auto-installer

    Install Zapier MCP in whichever client you have.

How your agent gets these tools

  1. Connect Zapier to your AI tool (pick yours above) and sign in once in the browser. Zapier sets up your MCP server, with no token to paste.
  2. Ask your agent to connect Gmail. It calls discover_zapier_actions to find the Gmail actions, then enable_zapier_action to add them.
  3. Approve the Gmail sign-in when prompted. If Gmail isn’t connected yet, the first call returns a sign-in link.
  4. Ask for what you want done in plain language. Each enabled action becomes its own tool, named as below. Until then, execute_zapier_read_action and execute_zapier_write_action run it.

Use Gmail in 36 AI tools with Zapier MCP

22 Gmail MCP tools

ToolMCP nameWhat it does
New Attachmentgmail_new_attachment

Trigger · Read-only. Triggers when you receive a new attachment. Each check only finds emails received in the last hour, so attachments on older emails will not trigger, even if they appear in test results.

Optional: label_ids (Label or mailbox), query (Search keywords)

New Labelgmail_new_label

Trigger · Read-only. Triggers when you add a new label.

New Labeled Conversationgmail_new_labeled_conversation

Trigger · Read-only. Triggers the first time a label is added to a conversation. Replies within that conversation will not trigger again.

Required: labelId (Label or mailbox)

New Labeled Emailgmail_new_labeled_email

Trigger · Read-only. Triggers when an email is labeled. Also triggers when a reply is added to the conversation.

Required: label_ids (Label or mailbox)

Optional: extended_polling_window (Increase polling window)

New Emailgmail_new_email

Trigger · Read-only. Triggers when a new email appears in the specified mailbox. Each check only finds emails received in the last hour, so older emails moved into the mailbox or label will not trigger, even if they appear in test results. To trigger on older emails you label, use New Labeled Email.

Optional: label_ids (Label or mailbox)

New Email Matching Searchgmail_new_email_matching_search

Trigger · Read-only. Triggers when you receive a new email that matches a search string you provide. Each check only finds emails received in the last hour, so older emails that match later (for example, after you label them) will not trigger, even if they appear in test results. To trigger on older emails you label, use New Labeled Email.

Required: query (Search keywords)

New Starred Emailgmail_new_starred_email

Trigger · Read-only. Triggers when you receive a new email and star it within two days.

New Conversationgmail_new_conversation

Trigger · Read-only. Triggers when a new email conversation begins in your inbox. Each check only finds conversations with an email received in the last hour, so older conversations moved into a label will not trigger, even if they appear in test results. To trigger on older conversations you label, use New Labeled Conversation.

Optional: label_ids (Label/Mailbox)

Get Attachment by Filenamegmail_get_attachment_by_filename

Search · Read-only. Retrieves a specific Gmail message attachment by Filename.

Required: message_id (Message ID), attachment_filename (Attachment Filename)

Optional: attachment_size (Attachment Size)

Find Emailgmail_find_email

Search · Read-only. Finds an email message.

Required: query (Search String)

Example prompt: “Find the latest email from billing@example.com.”

Add Label to Emailgmail_add_label_to_email

Action · Writes data. Add a label to an email message.

Required: new_label_ids (Label), message_id (Message)

Example prompt: “Label the latest invoice from Acme as Finance.”

Archive Emailgmail_archive_email

Action · Writes data. Archive an email message.

Required: message_id (Message)

Delete Emailgmail_delete_email

Action · Writes data. Sends an email message to the trash.

Required: message_id (Message)

Create Draftgmail_create_draft

Action · Writes data. Create a draft email message.

Required: subject, body

Optional: to, cc, bcc, from, from_name, body_type (Body type), signature (Add signature default), render_signature_in_html (Render signature in HTML), signature_delimiter (Signature delimiter), label_ids (Label or mailbox), file (Attachments)

Example prompt: “Draft an email to Jo asking to move Thursday’s review to Friday.”

Create Draft Replygmail_create_draft_reply

Action · Writes data. Create a draft reply to an existing email.

Required: thread_id (Thread), body

Optional: to, cc, bcc, from, from_name, body_type (Body type), signature (Add signature default), render_signature_in_html (Render signature in HTML), signature_delimiter (Signature delimiter), label_ids (Label or mailbox), file (Attachments)

Forward Emailgmail_forward_email

Action · Writes data. Forward an existing email message to new recipients.

Required: message_id (Message)

Optional: to, cc, bcc, from, from_name, reply_to, additional_message (Note), body_type (Note format), include_attachments (Include original attachments), label_ids (Label or mailbox)

Get Conversationgmail_get_conversation

Action · Writes data. Retrieves every message in a Gmail conversation by its thread ID.

Required: thread_id (Conversation)

Optional: format

Example prompt: “Summarize the thread with the vendor about renewal.”

Create Labelgmail_create_label

Action · Writes data. Creates a new label.

Required: name (Name of label)

Send Emailgmail_send_email

Action · Writes data. Create and send a new email message.

Required: subject, body

Optional: to, cc, bcc, from, from_name, reply_to, body_type (Body type), signature (Add signature default), render_signature_in_html (Render signature in HTML), signature_delimiter (Signature delimiter), label_ids (Label or mailbox), file (Attachments), send_to_groups (Send message to Google Contacts Group/Label)

Example prompt: “Email the team the agenda for tomorrow’s kickoff.”

Remove Label From Emailgmail_remove_label_from_email

Action · Writes data. Remove a label from an email message.

Required: message_id (Message), label_ids (Label(s) to remove)

Remove Label From Conversationgmail_remove_label_from_conversation

Action · Writes data. Remove a specified label from all emails within a conversation.

Required: thread_id (Thread), label_ids (Label(s) to remove)

Reply to Emailgmail_reply_to_email

Action · Writes data. Send a reply to an email message.

Required: thread_id (Thread), body

Optional: to, cc, bcc, from, from_name, reply_to, subject, body_type (Body type), signature (Add signature default), render_signature_in_html (Render signature in HTML), signature_delimiter (Signature delimiter), label_ids (Label or mailbox), file (Attachments)

Example prompt: “Reply to Dana’s last email and confirm the new date.”

Gmail API with the Zapier SDK: find emails and create drafts without pasting an API key

The Zapier SDK gives your code one way to call Gmail. You connect your account once, and your code references that connection instead of a raw token.

message (Find Email) requires query. draft_v2 (Create Draft) requires subject and body. Every Gmail action and its inputs are listed under Gmail triggers and actions above. Zapier handles OAuth, token refresh, retries and rate limits. Read the SDK docs

Terminal · in your project
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli
npx zapier-sdk login
npx zapier-sdk create-connection gmail
TypeScript
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();
const { data: connection } = await zapier.findFirstConnection({ app: "gmail", owner: "me" });

// Find an email
await zapier.runAction({
  app: "gmail",
  actionType: "search",
  action: "message",
  connection: connection.id,
  inputs: {
    query: "from:billing@example.com newer_than:7d",
  },
});

// Create a draft
const { data } = await zapier.runAction({
  app: "gmail",
  actionType: "write",
  action: "draft_v2",
  connection: connection.id,
  inputs: {
    to: "jo@example.com",
    subject: "Moving Thursday’s review",
    body: "Can we move our review to Friday?",
  },
});
Zapier SDK CLI
npx zapier-sdk run-action gmail search message \
  --inputs '{"query":"from:billing@example.com newer_than:7d"}'

Frequently asked questions about automating with Gmail

Can I trigger on specific senders?

Yes. Use search queries or filters to narrow which emails trigger workflows.

Will replies trigger workflows?

Replies can trigger depending on how search criteria are defined.

How do I avoid automation loops?

Exclude automated emails from trigger conditions.

When should I use Email by Zapier instead?

Use Email by Zapier for simple notifications without inbox context.

How do I connect Gmail to Claude?

Connect Zapier in Claude, sign in to Zapier, then ask Claude to connect Gmail. Claude finds the Gmail actions and adds them. You approve the Google sign-in once.

Can I use the Gmail API without setting up Google Cloud?

With the Zapier SDK you connect your Google account to Zapier once, and your code runs actions through that connection. Zapier handles Google’s login, so you never paste an API key.

Can an AI agent send email from my Gmail account?

Yes. Once you connect Gmail through Zapier MCP, your agent can create drafts, reply to threads, and send email. You can ask it to create a draft first so you review before anything goes out.

My AI agent already connects to my apps. Why add Zapier?

Your AI agent’s built-in or native connectors cover a limited set of popular apps. Zapier reaches 10,000+ apps and 90,000+ triggers and actions. Zapier also adds what your AI agent can’t: one place to manage logins and credentials, so you never paste an API key; automations that keep running after the chat closes, with fixes you can review when a run hits a snag; and the freedom to switch agent interfaces without starting over.

Can’t my AI agent already run tasks on a schedule?

Most popular AI agents can run scheduled tasks. And for simple recurring jobs, that might be all you need. Automations that run on Zapier can run on a schedule too, but they can also start the moment something happens in your apps—like when a new lead/ticket comes in or you get an email reply. Zapier also uses AI only in the steps that need judgment, so routine steps like posting to Slack or updating Salesforce don’t burn model tokens.

Why not have my AI agent write me a script?

You can, and the first version will probably work. The trouble comes later: a script needs somewhere to run, a way to hear about events, and someone to keep it going. If an API changes or a login expires, your script can quietly stop until you notice. It also holds your keys, often in a repo, where a leak can expose your accounts. With Zapier, your agent builds the automation, and you publish it. Zapier hosts it, handles your logins and credentials, and records every run. If a run fails, Zapier diagnoses what went wrong and prepares a fix you can review. Or you can decide which fixes Zapier can apply for you.

Point your AI agent to this page’s markdown file to build Gmail automations. It covers how Gmail connects, every trigger and action with its inputs, and how to run them with Zapier MCP, the SDK, or the CLI. To start from a ready-made Zap instead, have it search zapier.sh.

About Gmail

One of the most popular email services, Gmail keeps track of all your emails with threaded conversations, tags, and Google-powered search to find any message you need.

Related categories: Email, Google