Gmail MCP Server — Hosted Ai Integration
MCP Server language Hosted language PublicRead, send, and search Gmail messages — manage labels, drafts, and attachments with full inbox control.
Use with AI AssistantsMCP
Connect Claude, Cursor, or any MCP-compatible client — then call tools directly
① Add This MCP Server
Paste into your AI client config — then all its tools are available instantly.
{
"mcpServers": {
"gmail": {
"url": "https://mcp.aerostack.dev/s/aerostack/mcp-gmail",
"headers": {
"Authorization": "Bearer YOUR_AEROSTACK_TOKEN"
}
}
}
}Replace YOUR_AEROSTACK_TOKEN with your API token from the dashboard.
② Call a Tool
Ask your AI assistant to call a specific tool, or send raw JSON-RPC:
Natural Language Prompt
“Use the _ping tool to verify gmail credentials by calling a lightweight read endpoint. used internally by aerostack to validate credentials”
Using a Workspace?
Add this MCP to your Workspace — your team shares one token, secrets are stored securely, and every AI agent in the workspace can call it without per-user setup.
description Overview
mcp-gmail — Gmail MCP Server
Give AI agents full access to Gmail — read, search, send, reply, organize, and manage email conversations programmatically.
Gmail is the world's most widely used email platform. This MCP server gives your agents complete access to the Gmail API: searching and reading messages, sending emails and replies, managing labels and folders, forwarding threads, drafting emails, and downloading attachments — enabling fully automated email workflows without human intervention.
Live endpoint: https://mcp.aerostack.dev/s/aerostack/mcp-gmail
What You Can Do
- Search and read incoming emails with Gmail's full query syntax (sender, subject, date, labels, attachments)
- Draft and send emails or replies on behalf of a user automatically from any trigger
- Organize inboxes by applying, creating, or removing labels based on email content
- Build email-driven automation — parse invoices, route support requests, or triage leads
Available Tools
| Tool | Description |
|---|---|
| list_messages | List Gmail messages matching an optional query with pagination |
| get_message | Get a specific message by ID with headers, body, and labels |
| search_messages | Search messages using Gmail query syntax (from:, subject:, has:attachment, etc.) |
| list_threads | List conversation threads matching an optional query |
| get_thread | Get a full conversation thread including all messages |
| send_email | Send an email with plain text or HTML body, CC, and BCC |
| reply_to_message | Reply to a message in the same thread with correct email headers |
| forward_message | Forward a message to one or more recipients with an optional note |
| create_draft | Create a draft email without sending it |
| list_labels | List all Gmail labels including system and user-created labels |
| get_label | Get details of a specific label with message counts |
| create_label | Create a new label for organizing messages |
| modify_message_labels | Add or remove labels on a message (use to mark read, move to folder, etc.) |
| trash_message | Move a message to trash (recoverable for 30 days) |
| delete_message | Permanently delete a message — cannot be undone |
| mark_as_read | Mark a message as read |
| mark_as_unread | Mark a message as unread |
| get_profile | Get the authenticated Gmail user's profile and message counts |
| list_drafts | List draft emails in the drafts folder |
| get_attachment | Download a message attachment by attachment ID |
Configuration
| Variable | Required | Description | How to Get |
|---|---|---|---|
| GMAIL_ACCESS_TOKEN | Yes | OAuth 2.0 access token with gmail.send and gmail.readonly scopes |
Google Cloud Console → APIs → Gmail API → OAuth 2.0 credentials |
Quick Start
Add to Aerostack Workspace
- Go to aerostack.dev → Your Project → MCPs
- Search for "Gmail" and click Add to Workspace
- Add your
GMAIL_ACCESS_TOKENunder Project → Secrets
Once added, every AI agent in your workspace can read and send Gmail automatically — no per-user setup needed.
Example Prompts
"Search my inbox for unread emails from customers asking about pricing and summarize them"
"Reply to the email from alice@acme.com saying I'll send the proposal by Friday"
"Label all emails from support@stripe.com as 'Billing' and mark them as read"
Direct API Call
curl -X POST https://mcp.aerostack.dev/s/aerostack/mcp-gmail \
-H 'Content-Type: application/json' \
-H 'X-Mcp-Secret-GMAIL-ACCESS-TOKEN: your-token' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_messages","arguments":{"query":"is:unread from:boss@example.com"}}}'
License
MIT
terminal Tools (21)
Available tools on this MCP server. Each tool can be called directly from any AI agent.
_ping #1 Verify Gmail credentials by calling a lightweight read endpoint. Used internally by Aerostack to validate credentials.
list_messages #2 List Gmail messages matching an optional query using Gmail search syntax. Returns message IDs and thread IDs. Use search_messages for a more descriptive search-focused tool.
get_message #3 Get a specific Gmail message by ID. Returns full message details including headers, body, and labels. Use format=metadata for just headers.
search_messages #4 Search Gmail messages using Gmail search syntax. Supports complex queries like "from:alice is:unread subject:invoice after:2024/01/01 has:attachment". Returns message list with snippets.
list_threads #5 List Gmail conversation threads matching an optional query. Threads group related messages together. Use query with Gmail search syntax.
get_thread #6 Get a full conversation thread by thread ID, including all messages in the thread. Returns all messages with their snippets and IDs.
send_email #7 Send an email via Gmail. Supports plain text and HTML bodies, CC, BCC. Builds a proper RFC 2822 message and sends it via the Gmail API.
reply_to_message #8 Reply to an existing Gmail message in the same thread. Automatically sets In-Reply-To and References headers and keeps the message in the same thread.
forward_message #9 Forward a Gmail message to one or more recipients. Fetches the original message and creates a new message with "Fwd:" subject prefix.
create_draft #10 Create a draft email in Gmail without sending it. The draft can be edited and sent later from the Gmail UI or via the send API.
list_labels #11 List all Gmail labels in the account, including system labels (INBOX, SENT, TRASH, SPAM) and user-created labels.
get_label #12 Get details of a specific Gmail label by ID, including message counts and visibility settings.
create_label #13 Create a new Gmail label for organizing messages.
modify_message_labels #14 Add and/or remove labels from a Gmail message. Use this to label messages, move them between folders, or mark them as read/unread.
trash_message #15 Move a Gmail message to the Trash. Trashed messages are auto-deleted after 30 days. Use delete_message for immediate permanent deletion.
delete_message #16 Permanently delete a Gmail message. This cannot be undone. Use trash_message if you want a recoverable delete.
mark_as_read #17 Mark a Gmail message as read by removing the UNREAD label.
mark_as_unread #18 Mark a Gmail message as unread by adding the UNREAD label.
get_profile #19 Get the Gmail profile for the authenticated user including email address, message count, thread count, and history ID.
list_drafts #20 List draft emails in the Gmail drafts folder.
get_attachment #21 Download a Gmail message attachment by its attachment ID. Returns the base64url-encoded attachment data.
Details
language Live Endpoint
https://mcp.aerostack.dev/s/aerostack/mcp-gmail
Sub-50ms globally · Zero cold start
Publisher
Pre-built functions for the most common MCP tool patterns. Clone, extend, and deploy.
More in AI
Browse AI MCPs →Canva Design Platform
by @aerostack
Design creation, AI generation, editing, export, assets, brand kits, folders via Canva's official MCP
Intercom Messaging
by @aerostack
Conversations, contacts, tickets, articles via Intercom's official MCP
Anthropic
by @aerostack
Call Claude models directly — run AI conversations, tool-use chains, batch jobs, and model comparisons from any agent.
Vercel Deployments
by @aerostack
Deployments, projects, domains, env vars, logs via Vercel's official MCP
Mailchimp
by @aerostack
Manage audiences, campaigns, and subscriber tags in Mailchimp — automate your email marketing with AI.
Openai
by @aerostack
Run chat completions, generate embeddings, create images, and moderate content via the OpenAI API.
Frequently asked questions
What is the Gmail MCP server and what can it do? +
The Gmail MCP server is hosted on Aerostack and exposes these tools to your AI agent: `_ping`, `list_messages`, `get_message`, `search_messages`, `list_threads`. You get one hosted URL — no self-hosting — that works from Claude, Cursor, ChatGPT, Gemini, VS Code, or any MCP-compatible client, and you can share it with your team or combine it with other MCP servers in a workspace.
Is the Gmail MCP server hosted, or do I have to run it myself? +
It's hosted on Aerostack's edge infrastructure — you don't deploy or maintain anything. Add it to a workspace and you get one authenticated URL, with secrets encrypted, that any AI agent or editor can connect to. Use it solo or share the same URL across your whole team.
Which AI agents and editors can use the Gmail MCP server? +
Any MCP client: Claude and Claude Code, Cursor, ChatGPT, Gemini, Windsurf, Cline, VS Code, and custom agents. Because it's one hosted URL, the same Gmail MCP server works everywhere — and you can compose it with other MCP servers, skills, and functions behind a single workspace URL.
How do I install the Gmail MCP server in Claude Desktop? +
Add the following to your Claude Desktop config (`claude_desktop_config.json`): ```json { "mcpServers": { "@aerostack/mcp-gmail": { "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-gmail"] } } } ``` Then restart Claude Desktop and the tools will appear automatically.
How do I use the Gmail MCP server in Cursor? +
In Cursor, open **Settings → MCP** and add: ```json { "name": "@aerostack/mcp-gmail", "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-gmail"] } ``` Save and reload Cursor. The MCP tools will be available in Agent mode.
Does Gmail MCP require authentication? +
Yes. Gmail requires authentication. Check the MCP's documentation for the required credentials.