yt-gmail-mcp
Search, read, send, and manage Gmail emails and threads, including creating drafts, labeling, archiving, and trashing messages.
List, create, update, and delete Google Calendar events, and list accessible calendars.
Search Google Drive files, retrieve metadata, and download or export file content as text.
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., "@yt-gmail-mcpsearch my Gmail for unread messages from John"
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.
yt-gmail-mcp
MCP server for Gmail, Google Drive, and Google Calendar — search, read, send, and manage threads, files, and events.
Tools
Gmail
Tool | Description |
| Search inbox with Gmail query syntax |
| Fetch a thread by ID with full message bodies |
| Remove UNREAD label |
| Add UNREAD label |
| Remove INBOX label |
| Move to Trash (recoverable 30 days) |
| Add or remove labels |
| List all labels (system + user) |
| Create a draft email or reply |
| Send an email immediately |
| Re-run OAuth flow to refresh credentials |
Google Drive
Tool | Description |
| Search files with Drive query syntax |
| Get file metadata by ID |
| Download/export file content as text |
Google Calendar
Tool | Description |
| List events in a time range |
| Create an event (all-day or timed) |
| Update an existing event |
| Delete an event |
| List all accessible calendars |
Related MCP server: Google-Workspace-MCP-Server
Setup
1. Google Cloud Console
Go to Google Cloud Console
Create a project (or use an existing one)
Enable the APIs you need:
Gmail API
Google Drive API (if using Drive tools)
Google Calendar API (if using Calendar tools)
Create an OAuth 2.0 Client ID of type Desktop application
Add
http://localhost:3000/oauth2callbackas an authorized redirect URIDownload the client configuration JSON
2. Place the credentials
Save the downloaded JSON as ~/.gmail-mcp/gcp-oauth.keys.json:
mkdir -p ~/.gmail-mcp
mv ~/Downloads/client_secret_*.json ~/.gmail-mcp/gcp-oauth.keys.json3. Authenticate
npx yt-gmail-mcp authThis opens a browser where you sign in with your Google account. On success, tokens are saved to ~/.gmail-mcp/credentials.json.
Configuration
Env var | Default | Description |
|
| Directory for OAuth keys and tokens |
|
| Path to OAuth client JSON |
|
| Path to saved tokens |
|
| Port for the OAuth callback server |
Custom port
If port 3000 is occupied:
GMAIL_MCP_OAUTH_PORT=3001 npx yt-gmail-mcp authMake sure your GCP OAuth client's redirect URI matches.
MCP host config
opencode
{
"mcp": {
"gmail": {
"type": "local",
"command": ["npx", "yt-gmail-mcp"]
}
}
}Claude Desktop
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["yt-gmail-mcp"]
}
}
}Troubleshooting
Tools disappear mid-session
If the MCP host starts while OAuth tokens are expired, the server fails to initialize and doesn't register tools. Fix:
Run
npx yt-gmail-mcp authto refresh credentialsRestart the MCP host
EADDRINUSE :::3000 during re-auth
The OAuth callback listener needs port 3000 (or your GMAIL_MCP_OAUTH_PORT). Kill whatever is on that port, or set GMAIL_MCP_OAUTH_PORT to a free port.
invalid_grant / expired tokens
OAuth refresh tokens for unverified Testing-mode apps expire after 7 days. Run npx yt-gmail-mcp auth to re-authenticate. For production, publish your OAuth app through Google's verification process.
License
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
- AlicenseAqualityFmaintenanceProvides tools for interacting with Gmail and Calendar APIs. This server enables you to manage your emails and calendar events programmatically through the MCP interface.831MIT
- Alicense-qualityDmaintenanceMCP server that seamlessly interacts with your Google Calendar, Gmail, Drive and so on.30MIT
- AlicenseAqualityDmaintenanceMCP server for Google Workspace APIs - Docs, Sheets, Drive, Gmail, and Calendar. Enables reading, creating, and editing Google Docs and Sheets, managing comments, reading emails, and viewing calendar events.345216MIT
- Alicense-qualityDmaintenanceMCP server to interact with Google Gmail and Calendar APIs. Supports multiple accounts, email search and drafting, and calendar event management.MIT
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
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/yentsun/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server