Production Gmail MCP server for AI agents. Token-efficient, write-safe, thread-intelligent.
| Category | Tools | Description |
|---|---|---|
| Read | gmail_search, gmail_read, gmail_snippets, gmail_thread, gmail_mailboxes |
Search, read messages and threads, list labels |
| Meta | gmail_info, gmail_state, gmail_changes, gmail_identities, gmail_filters |
Account info, incremental sync, send-as aliases, filter rules |
| Write | gmail_send, gmail_reply, gmail_draft, gmail_flag, gmail_move, gmail_bulk, gmail_delete |
Send, reply, draft, label, move, batch ops, delete |
| Filter | gmail_filter_create, gmail_filter_delete |
Create and delete Gmail filters |
| AI | gmail_classify, gmail_summarise |
Gemini-powered classification and summarisation (requires GOOGLE_API_KEY) |
- Token-efficient by default — HTML→plaintext stripping, body truncation, quoted-reply deduplication, concise list format
- Write-safe —
GMAIL_WRITE_ENABLED=trueenv gate +confirm=trueon destructive operations - Thread-intelligent —
thread_mode=dedupedstrips quoted replies;latestshows only newest message - Incremental sync —
gmail_state+gmail_changesvia Gmailhistory.listAPI - Rate-limit aware — automatic exponential backoff on 429 errors
- Gemini AI — classify and summarise emails using Google Gemini (optional, requires
GOOGLE_API_KEY) - Credential-safe — OAuth tokens scrubbed from error messages
uv sync- Go to Google Cloud Console
- Create a project (or select existing)
- Enable the Gmail API
- Create OAuth 2.0 credentials (Desktop application)
- Download the JSON file
- Save as
~/.gmail-blade/credentials.json
uv run gmail-blade-mcpA browser window opens for OAuth consent. After authorising, the refresh token is saved to ~/.gmail-blade/token.json.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"gmail-blade": {
"command": "uv",
"args": ["--directory", "/path/to/gmail-blade-mcp", "run", "gmail-blade-mcp"],
"env": {
"GMAIL_WRITE_ENABLED": "false"
}
}
}
}| Variable | Default | Description |
|---|---|---|
GMAIL_WRITE_ENABLED |
false |
Enable write operations (send, reply, delete, etc.) |
GMAIL_MCP_TRANSPORT |
stdio |
Transport: stdio or http |
GMAIL_MCP_HOST |
127.0.0.1 |
HTTP host (when transport=http) |
GMAIL_MCP_PORT |
8768 |
HTTP port (when transport=http) |
GMAIL_MCP_API_TOKEN |
(none) | Bearer token for HTTP transport auth |
GOOGLE_API_KEY |
(none) | Google AI Studio API key for Gemini classify/summarise tools |
- Write operations disabled by default — set
GMAIL_WRITE_ENABLED=trueto enable - Permanent delete requires
confirm=true— usegmail_moveto TRASH for soft delete - OAuth tokens never appear in error messages — regex scrubbing on all error paths
- Bearer auth uses constant-time comparison —
secrets.compare_digest() - Credentials stored locally —
~/.gmail-blade/, never transmitted
make install-dev # Install with dev + test deps
make test # Unit tests (no Gmail needed)
make check # Lint + format + type check
make test-cov # Tests with coverageThis server implements the Sidereal email-v1 domain contract — the same tool semantics as fastmail-blade-mcp. Skills targeting email-v1 work with either provider.
MIT