gmail-mcp
Provides tools to search, read, send, draft, and manage Gmail emails across multiple accounts, including labeling, archiving, trashing, and read/unread toggles.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gmail-mcpsearch my inbox for invoices from the last 30 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gmail-mcp v1.0.0
Unified Multi-Account Google OAuth2 MCP Server for Gmail. Search, read, compose, send, draft, and organize emails across multiple Google accounts seamlessly.
Features (4 Unified Tools)
gmail_search: Search emails with official Gmail search syntax (is:unread,from:boss@corp.com,subject:invoice,newer_than:2d,has:attachment)gmail_read: Read full email content and metadata (subject, sender, body text, HTML, CC, BCC, labels, attachment list)gmail_send: Send emails or create drafts (supports HTML, CC, BCC, thread replies, and file attachments)gmail_manage: Labeling, archiving, trash management, read/unread toggles, permanent deletion, and multi-account inventory
Related MCP server: Moist
Multi-Account Architecture
A single Google Cloud OAuth client (credentials.json) can authenticate multiple Gmail accounts.
Tokens are stored per-account in ~/.secrets/gmail/tokens/<account_name>.json.
1. Setup Google OAuth Credentials (One-time)
Create a project in Google Cloud Console.
Enable the Gmail API.
Create an OAuth 2.0 Client ID (Desktop Application).
Download the client secret JSON file and save it as
~/.secrets/gmail/credentials.json(or setGMAIL_CREDENTIALS_JSON).
2. Authenticate Accounts
Run the interactive authorization CLI for each account:
gmail-auth default # Authenticates primary account
gmail-auth work # Authenticates secondary work account
gmail-auth client_x # Authenticates any additional accountList all authenticated accounts:
gmail-auth --listInstallation in MCP Clients (Claude Desktop, OpenCode, Cursor, Windsurf)
Option 1: Instant via uvx (Recommended)
{
"mcpServers": {
"gmail": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Steph-ux/gmail-mcp.git", "gmail-mcp"]
}
}
}Option 2: Via pip install
pip install git+https://github.com/Steph-ux/gmail-mcp.gitThen in your MCP config:
{
"mcpServers": {
"gmail": {
"command": "gmail-mcp"
}
}
}Option 3: Local Clone (Development)
{
"mcpServers": {
"gmail": {
"command": "python",
"args": ["D:\\Steph\\script\\gmail-mcp\\server.py"]
}
}
}Usage Examples
1. Search Messages
# Search in default account:
gmail_search(query='is:unread from:github')
# Search in work account:
gmail_search(account='work', query='subject:invoice newer_than:7d')2. Read Message
gmail_read(account='work', message_id='18f2a9b4c10d')3. Send Email or Create Draft
# Send direct email:
gmail_send(
account='default',
to='colleague@example.com',
subject='Project Update',
body_text='Here is the latest status...',
body_html='<h1>Project Update</h1><p>Here is the latest status...</p>'
)
# Create a draft:
gmail_send(
account='work',
to='client@example.com',
subject='Proposal draft',
body_text='Please review the proposal.',
draft=True
)4. Organize & Manage
# Archive email:
gmail_manage(account='work', action='archive', message_id='18f2a9b4c10d')
# Mark as unread:
gmail_manage(account='default', action='mark_unread', message_id='18f2a9b4c10d')
# Move to trash:
gmail_manage(account='default', action='trash', message_id='18f2a9b4c10d')
# List active accounts:
gmail_manage(action='list_accounts')Testing
pytest testsLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.123MIT
- AlicenseNot gradedqualityDmaintenanceEnables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables searching, reading, and drafting emails across multiple Gmail accounts through a single MCP server.
- FlicenseNot gradedqualityCmaintenanceEnables reading, searching, sending, and drafting Gmail emails via MCP tools, with support for multiple accounts and background notifications.
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/Steph-ux/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server