Skip to main content

Gmail MCP

In one line: Connect your Gmail account so your UnleashX agent can send, search, label, and triage email for you.
CategoryCommunication
AuthenticationOAuth (Google sign-in)
Setup time~2 minutes
DifficultyEasy
Best forTeams who want an AI assistant to draft, send, and organize email without leaving UnleashX

1. Overview

Gmail is Google’s email service, part of Google Workspace. It holds your inbox, sent mail, drafts, labels, and attachments. Once connected, your UnleashX agent can send emails (including CC/BCC and attachments), search and read messages, create and send drafts, apply or remove labels, and triage your inbox — marking messages read/unread, important, archived, or trashed. Connecting Gmail to UnleashX turns email into something your agent can act on directly: it can answer “did the invoice from Acme arrive?”, send a follow-up, or label and archive a thread — all from a natural-language request, so you spend less time clicking around your inbox.

2. What you’ll need

1

A Google account with Gmail

Any personal Gmail account or a Google Workspace account with Gmail enabled.
2

Permission to grant access

You must be able to complete the Google sign-in and approve the requested permissions. On Workspace accounts, your admin may restrict third-party app access.
3

An UnleashX agent

An agent in your UnleashX workspace where you’ll add the Gmail connector.
No admin access? On personal Gmail you can connect yourself. On a managed Google Workspace account, your admin may need to allow UnleashX in the Google Admin console before the authorize step succeeds.

3. Get your credentials

Gmail uses Google OAuth 2.0. You do not create or paste an API key. Instead, UnleashX redirects you to Google, you sign in once, and Google issues an access token to UnleashX automatically.
1

Start the connection in UnleashX

In your agent’s Data Connectors, find Gmail and click Connect (see Section 4). This launches Google’s secure sign-in page.
2

Sign in with Google

Choose the Google account whose Gmail you want to connect.
3

Review and approve the requested scopes

Google shows exactly what UnleashX is asking for. Click Allow to grant access. Google then sends you back to UnleashX and the connection completes.
There is no key to copy. Access is granted by your Google sign-in, and you can revoke it at any time from your Google Account permissions page.
Scopes UnleashX requests for Gmail:
ScopeWhy UnleashX needs it
https://www.googleapis.com/auth/gmail.readonlyRead messages, search emails, list labels and attachments.
https://www.googleapis.com/auth/gmail.sendSend emails and send drafts on your behalf.
https://www.googleapis.com/auth/gmail.composeCreate drafts in your account.
https://www.googleapis.com/auth/gmail.modifyApply/remove labels, mark read/unread/important, archive, and trash/untrash.
https://www.googleapis.com/auth/userinfo.emailIdentify which account is connected.
https://www.googleapis.com/auth/userinfo.profileRead your basic profile (name, picture).
openidSign-in / identity verification.

4. Connect on UnleashX

1

Open your agent

Sign in at https://www.tryunleashx.com and open the agent you want to give email access to.
2

Go to Data Connectors

In the agent, open Data Connectors.
3

Find Gmail and connect

Locate Gmail and click Connect / Add / Configure.
4

Authorize with Google

Click Authorize, sign in with Google, and approve the requested permissions.
5

Confirm success

You’ll return to UnleashX and the connector status will show a Connected badge.
01 gmail connector

5. Available tools

ToolWhat it doesChanges data?
Send EmailSend an email, with optional CC/BCC.✏️ Yes
Fetch Recent EmailsFetch recent emails from a folder (e.g. INBOX).No
Download AttachmentDownload an attachment from a URL.No
List AttachmentsList attachments on a message (name, size, id).No
Send Email with URL AttachmentSend an email with an attachment pulled from a URL.✏️ Yes
Get Prestaged AttachmentGet the path of a pre-staged attachment.No
Send Email with Prestaged AttachmentSend an email with a pre-staged attachment.✏️ Yes
Get ProfileGet the connected Gmail account’s profile info.No
Search EmailsSearch emails using Gmail search syntax.No
Get EmailGet a specific email by message ID.No
Create DraftCreate a draft email.✏️ Yes
Send DraftSend an existing draft.✏️ Yes
Add LabelAdd a label to a message.✏️ Yes
Remove LabelRemove a label from a message.✏️ Yes
Fetch LabelsList all available Gmail labels.No
Create LabelCreate a new Gmail label.✏️ Yes
Trash EmailMove an email to Trash.⚠️ Yes
Untrash EmailRestore an email from Trash.✏️ Yes
Mark as ReadMark a message as read.✏️ Yes
Mark as UnreadMark a message as unread.✏️ Yes
Mark as ImportantMark a message as important.✏️ Yes
Mark as UnimportantRemove the important marker.✏️ Yes
Archive EmailArchive a message (remove from inbox).✏️ Yes
Unarchive EmailUnarchive a message (return to inbox).✏️ Yes

6. Example usage

“Send an email to maria@acme.com with the subject ‘Q3 report’ and attach the file at this link.” Runs Send Email with URL Attachment (or Send Email if there’s no attachment).
“Find the unread emails from billing and mark them as read.” Runs Search Emails to find them, then Mark as Read on each.

7. Permissions & data access

UnleashX can:
  • Send emails and send your drafts.
  • Read messages and search your mailbox.
  • Create drafts and labels.
  • Apply/remove labels and mark messages read, unread, important, archived, or trashed.
UnleashX cannot:
  • Permanently delete email (trashing is reversible via untrash).
  • Change your Gmail account password or security settings.
  • Access other Google services unless you connect those integrations separately.
To disconnect: In UnleashX, open Data Connectors → Gmail → Disconnect. You can also revoke access at https://myaccount.google.com/permissions. Revoking takes effect immediately. The connection authenticates each request with your Google OAuth access token (resolved from an access-token header, a gmail_access_token header, or an Authorization: Bearer header, falling back to your UnleashX session), and refreshes it automatically when it expires.

8. Troubleshooting

ProblemWhat it meansHow to fix it
401 UnauthorizedThe access token is missing or expired.Reconnect Gmail in Data Connectors to refresh the Google sign-in.
403 ForbiddenThe granted scopes don’t cover the action, or admin policy blocks the app.Re-authorize and approve all requested scopes; on Workspace, ask your admin to allow UnleashX.
Invalid grant after a whileGoogle revoked or expired the refresh token.Disconnect and reconnect to start a fresh OAuth session.
Attachment fails to sendThe source URL is unreachable or too large.Verify the URL is public/valid and within Gmail’s 25 MB attachment limit.
For general connector issues, see /mcp/integrations.

9. Frequently asked questions

Is my email stored by UnleashX? UnleashX reads and acts on messages to fulfill your requests. It does not create a permanent copy of your mailbox; it works through Google’s API in real time. Can multiple team members connect Gmail? Yes. Each person authorizes their own Google account, and the agent acts as that connected user. How do I rotate or revoke access? There’s no key to rotate. To revoke, disconnect in UnleashX or remove UnleashX at https://myaccount.google.com/permissions, then reconnect to grant fresh access.

10. References