gmail-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GMAIL_MCP_CLIENT_ID | No | Google OAuth client ID. Can also be provided via ~/.config/gmail-mcp/client.json. | |
| GMAIL_MCP_HTTP_HOST | No | Interface to bind for HTTP mode (default 127.0.0.1). | 127.0.0.1 |
| GMAIL_MCP_HTTP_PORT | No | Port for HTTP mode (default 3333). | 3333 |
| GMAIL_MCP_HTTP_TOKEN | No | Bearer token for HTTP mode (required when running with --http). Must be at least 32 characters. | |
| GMAIL_MCP_CLIENT_SECRET | No | Google OAuth client secret. Can also be provided via ~/.config/gmail-mcp/client.json. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gmail_add_accountA | Add (or re-authenticate) a Gmail account via a browser OAuth consent flow on this machine. Args:
Returns: the authenticated email address and granted scopes. A browser window opens for consent; if it does not, the consent URL is included in the response for manual opening. Re-adding an existing email overwrites its stored credentials (this is the re-auth path). Examples:
Error Handling: returns an actionable error if OAuth client credentials are missing (see README setup), if the user denies consent, or if the flow times out (5 minutes). |
| gmail_list_accountsA | List every stored Gmail account: email, alias, access level (read-only, read+modify, or read+modify+send), whether it is the default, and when it was added. Tokens are never exposed. Args: none. Returns: one line per account, or a note that no accounts are configured. Examples:
Error Handling: returns an error only if the local accounts file is unreadable or corrupt. |
| gmail_remove_accountA | Remove a stored Gmail account by email or alias. Best-effort revokes the refresh token with Google, then deletes the local entry. If the removed account was the default, another stored account becomes the default (or the default is cleared). Args:
Returns: confirmation, including whether remote revocation succeeded and the new default account, if any. Examples:
Error Handling: removing an unknown account returns an error listing available accounts. Revocation failures are ignored (the local entry is still deleted), making this safe to repeat. |
| gmail_search_threadsA | Search threads with full Gmail search syntax, in one account or across all stored accounts. Args:
Returns: thread-level summaries only (thread_id, account, participants, date, subject, snippet, message_count) — never full bodies. Use gmail_get_thread with the thread_id AND the same account to read a thread. Examples:
Error Handling: in 'all' mode, per-account failures are reported inline without failing the whole call. Expired credentials return a re-auth instruction naming the affected account. |
| gmail_get_threadA | Fetch a full thread — every message with normalized headers and body text. Args:
Returns: all messages in the thread (from/to/cc, date, subject, labels, body text, attachment metadata). Long threads are truncated to fit the response limit, with a note saying how many messages were shown; use gmail_get_message for a specific message's full content. Examples:
Error Handling: a 404 usually means the id belongs to a DIFFERENT account — check the 'account' field on the search result that produced the id. |
| gmail_get_messageA | Fetch a single message with full body text and attachment metadata. Args:
Returns: normalized message (from/to/cc, date, subject, labels, body text) plus attachment metadata (filename, mimeType, size, attachment_id). Attachment CONTENT download is not supported in v1. Examples:
Error Handling: a 404 usually means the id belongs to a different account. |
| gmail_list_labelsA | List every label in an account — system labels (INBOX, UNREAD, STARRED, SPAM, TRASH, ...) and user labels — with their ids. gmail_modify_labels operates on label IDS, so call this first to translate names to ids. Args:
Returns: label name, id, and type (system/user) for every label. Examples:
Error Handling: expired credentials return a re-auth instruction naming the account. |
| gmail_send_messageA | Send a new plain-text email from one of the stored accounts. REQUIRES the account to have been added with access: "send". Args:
Returns: confirmation echoing the sending account, recipients, and the new message and thread ids. Examples:
Error Handling: if the account was added read-only, this returns an instruction to re-add it with access: "send" (use gmail_create_draft instead if the account should not send). |
| gmail_reply_to_threadA | Reply to an existing thread from the account that owns it, with correct In-Reply-To/References threading headers. REQUIRES the account to have been added with access: "send". Args:
Returns: confirmation echoing the sending account, recipients, and the new message id + thread id. Examples:
Error Handling: accounts without send access get a re-add instruction. A 404 usually means the thread id belongs to a different account. |
| gmail_create_draftA | Create a plain-text draft (saved to the account's Drafts folder; nothing is sent). Works without the send scope; needs access "modify" or "send" (gmail.modify). Args:
Returns: the draft id, its message id, and the account it was created in. Examples:
Error Handling: expired credentials return a re-auth instruction naming the account. |
| gmail_modify_labelsA | Add and/or remove labels on one message or one whole thread. This is also how you archive and mark read/unread:
Args:
Returns: confirmation with the resulting label set (message) or affected thread id. Examples:
Error Handling: unknown label ids return a Gmail error — list labels first. A 404 usually means the id belongs to a different account. |
| gmail_trash_messageA | Move one message or one whole thread to Trash. RECOVERABLE — Gmail keeps trashed mail for ~30 days and it can be restored from the Trash folder; nothing is permanently deleted by this tool. Args:
Returns: confirmation of what was trashed and in which account. Examples:
Error Handling: a 404 usually means the id belongs to a different account — check the 'account' field on the search result that produced the id. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 12 tools
Every tool targets a distinct action-resource pair: account management, search/read, send/reply/draft, labels, and trash are cleanly separated. Even similar tools like get_message and get_thread are clearly scoped by resource type, and list_labels explicitly feeds modify_labels without overlap.
All tools use the consistent gmail_verb_noun pattern with snake_case, making the action and target predictable. Minor variation like reply_to_thread instead of reply_thread does not break the overall convention.
Twelve tools is well-scoped for a Gmail server: account lifecycle, search/read, send/reply/draft, labels, and trash each get focused coverage without redundancy. The count is solidly within the ideal range.
Core Gmail workflows are well covered: search, read, send, reply, draft, label modification, trash, and multi-account management. Minor gaps exist—no attachment content download, no draft editing/deletion, and no label create/delete—but these are workable and do not leave the main workflows dead-ended.