gmail-mcp-local
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GMAIL_MCP_SCOPES | No | Scopes to request (default: readonly+compose+modify) | |
| GMAIL_MCP_CLIENT_ID | Yes | Google Desktop client ID | |
| GMAIL_MCP_CLIENT_SECRET | Yes | Google Desktop client secret (non-confidential, required for token exchange) |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_accountsA | List the Google accounts connected on THIS device (metadata only — never tokens). Each entry has ref, email, tag, has_refresh_token. Optionally filter by tag. |
| connect_accountA | Connect a Google account on THIS device via your browser (PKCE + loopback). The refresh token is stored in your OS keychain and never leaves the machine. Returns {ref, email, tag}. |
| remove_accountA | Disconnect a Google account: deletes its refresh token from the keychain and its metadata. Does NOT revoke at Google — do that at https://myaccount.google.com/permissions. |
| set_tagA | Change your tag for a connected account (e.g. switch "personal" to "work"). Metadata only — never touches the token. |
| search_threadsA | Search Gmail threads in a connected account using Gmail search syntax (e.g. "from:bob newer_than:7d has:attachment"). Returns thread ids + snippets in one API call. Use get_thread for full content. |
| get_threadC | Fetch a Gmail thread by id, with each message parsed into readable headers + body text/html. |
| list_labelsA | List Gmail labels (system + user) for a connected account. |
| list_thread_attachmentsA | List metadata for all attachments in a thread — filename, mime_type, size_bytes, message_id, attachment_id. No bytes (cheap). Use get_attachment to fetch one. |
| get_attachmentA | Fetch one Gmail attachment by message_id + attachment_id (discover both via list_thread_attachments). Returns base64 bytes + filename/mime_type/size_bytes; for text-like MIMEs also data_text. Default cap 5MB. |
| check_account_scopesA | Report the OAuth scopes currently granted on a connected account. Returns {granted_scopes[], has_write_scope, has_modify_scope, needs_reauth}. If needs_reauth, reconnect to grant compose/modify. |
| create_draftA | Create a Gmail draft. Returns {draft_id, message_id, thread_id}. For replies pass reply_to_message_id. Requires gmail.compose scope. |
| send_draftA | Send a previously-created draft (review it in Gmail first). Returns {message_id, thread_id, label_ids}. Requires gmail.compose scope. |
| send_messageA | Compose AND send in one step (no draft review). Same payload as create_draft. Returns {message_id, thread_id, label_ids}. Requires gmail.compose scope. |
| label_threadA | Add/remove labels on every message in a thread. INBOX/STARRED/UNREAD/IMPORTANT/SPAM/TRASH or user label ids. Mark read: remove ["UNREAD"]. Archive: remove ["INBOX"]. Requires gmail.modify scope. |
| label_messageC | Same as label_thread but for a single message id. Requires gmail.modify scope. |
| create_labelA | Create a user label. Use "/" for nesting (e.g. "Clients/Acme"). Returns {id, name}. Requires gmail.modify scope. |
| update_labelB | Rename or change visibility of a user label. Requires gmail.modify scope. |
| delete_labelA | Permanently delete a user label (messages keep other labels). Requires gmail.modify scope. |
| trash_threadA | Move a thread to TRASH (reversible via untrash_thread). Requires gmail.modify scope. |
| untrash_threadA | Restore a trashed thread to its previous labels. Requires gmail.modify scope. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexpekach/gmail-mcp-local'
If you have feedback or need assistance with the MCP directory API, please join our Discord server