Provides tools for managing Gmail messages and labels, including reading, sending, archiving, trashing messages, creating drafts, retrieving email threads, and modifying message labels.
gmail-mcp
MCP server for Gmail - read, send, archive, and manage emails.
Setup
1. Create Google OAuth credentials
Go to Google Cloud Console
Create a new project (or use existing)
Enable the Gmail API
Go to APIs & Services → OAuth consent screen, set up consent screen
Go to APIs & Services → Credentials → Create Credentials → OAuth client ID
Choose Web application
Add
http://localhost:3000/callbackto Authorized redirect URIsNote your Client ID and Client Secret
2. Run the server
The server runs on http://localhost:3000 by default. Change with PORT=3001.
3. Add to your MCP client
Architecture
This server acts as an OAuth proxy to Google:
Server advertises itself as an OAuth authorization server via
/.well-known/oauth-authorization-server/registerreturns the Google OAuth client credentials/authorizeredirects to Google, encoding the client's callback URL in state/callbackreceives the code from Google and forwards to the client's callback/tokenproxies token requests to Google, injecting client credentials/mcphandles MCP requests, using the bearer token to call Gmail API
The server holds no tokens or state - it just proxies OAuth to Google.
Tools
Tool | Description |
| Search/list messages in mailbox |
| Get full message content |
| Send an email |
| Archive a message (remove from inbox) |
| Move message to trash |
| Add/remove labels |
| List all labels |
| Create a draft email |
| Get full email thread |
Gmail API Scopes
gmail.readonly- Read messages and labelsgmail.send- Send messagesgmail.modify- Modify messages (archive, labels, trash)