Gmail MCP server for AI agents
Search, read, draft and send email, and organise labels in a Gmail mailbox.
- Auth
- OAuth 2.0 (sign in with the app)
- Tools
- 9
- Triggers
- 0
- Category
- Email, Communication
Tools and triggers
List messages
GMAIL_LIST_MESSAGES
Searches the mailbox with Gmail search syntax (from:, subject:, is:unread, newer_than:7d). Returns message ids; use Get a message to read them.read-only
Get a message
GMAIL_GET_MESSAGE
Reads one message: sender, recipients, subject, date, decoded plain-text body (HTML stripped if there is no text part) and attachment list.read-only
Send an email
GMAIL_SEND_EMAIL
Sends an email from the connected mailbox. Set thread_id and in_reply_to to answer inside an existing conversation.
Create a draft
GMAIL_CREATE_DRAFT
Saves an email as a draft in the mailbox without sending it, so the user can review it.
List labels
GMAIL_LIST_LABELS
Lists system and user labels with their ids, needed to add or remove labels on messages.read-only
Add or remove labels on a message
GMAIL_MODIFY_MESSAGE_LABELS
Adds and/or removes labels. Remove UNREAD to mark as read, remove INBOX to archive, add STARRED to star.
Move a message to trash
GMAIL_TRASH_MESSAGE
Moves a message to the trash. It is deleted for good after 30 days unless restored.destructive
List threads
GMAIL_LIST_THREADS
Searches conversations with Gmail search syntax. Returns thread ids and snippets.read-only
Get a thread
GMAIL_GET_THREAD
Returns all messages of a conversation. Default format is metadata (headers and snippets); read single messages for their full text.read-only
Connect via MCP
Create an MCP server for Gmail in the dashboard, then add its URL to your client. This is the Claude Code command; the client guide has the others.
claude mcp add --transport http gmail \
"https://www.prompt-tm.com/mcp/<server id>?user_id=<your user>" \
--header "x-api-key: ptm_…"Connect via REST
Run a tool with one request. The response is { data, error, successful, log_id } for every tool.
curl -X POST https://www.prompt-tm.com/api/v3/tools/execute/GMAIL_LIST_MESSAGES \
-H "x-api-key: $PROMPT_TM_KEY" -H "content-type: application/json" \
-d '{ "user_id": "alice", "arguments": {} }'