gmail-fast-mcp
# gmail-fast-mcp
Gmail MCP server built with [FastMCP](https://github.com/jlowin/fastmcp). Provides 19 tools for email operations, label management, filter management, and attachment handling via the Gmail API.
## Setup
### 1. Google OAuth Credentials
Place your Google Cloud OAuth client credentials at `~/.gmail-mcp/gcp-oauth.keys.json` (or in the project directory — they'll be copied automatically).
### 2. Authenticate
```bash
uv run python -m gmail_fast_mcp auth
```
This opens a browser for the OAuth flow and saves tokens to `~/.gmail-mcp/credentials.json`.
For cloud environments with a custom callback URL:
```bash
uv run python -m gmail_fast_mcp auth https://your-domain.com/oauth2callback
```
### 3. Run the Server
```bash
uv run python -m gmail_fast_mcp
```
### MCP Client Configuration
```json
{
"mcpServers": {
"gmail": {
"command": "uv",
"args": ["run", "--directory", "/path/to/gmail-fast-mcp", "python", "-m", "gmail_fast_mcp"]
}
}
}
```
## Tools
| Tool | Description |
|------|-------------|
| `send_email` | Send an email (text/html/multipart, attachments, threading) |
| `draft_email` | Create an email draft |
| `read_email` | Retrieve email content and attachment metadata |
| `search_emails` | Search using Gmail query syntax |
| `modify_email` | Add/remove labels on a message |
| `trash_email` | Move a message to trash |
| `batch_modify_emails` | Modify labels on multiple messages |
| `batch_trash_emails` | Trash multiple messages |
| `list_email_labels` | List all Gmail labels |
| `create_label` | Create a new label |
| `update_label` | Update label name/visibility |
| `delete_label` | Delete a user label |
| `get_or_create_label` | Find existing label or create it |
| `create_filter` | Create a filter with custom criteria/actions |
| `list_filters` | List all filters |
| `get_filter` | Get filter details |
| `delete_filter` | Delete a filter |
| `create_filter_from_template` | Create a filter from a preset template |
| `download_attachment` | Download an attachment to disk |
## Gmail API Scopes
- `gmail.modify` — Read, send, modify emails and labels
- `gmail.settings.basic` — Manage filters and settings
TDQS
Scored across 19 tools
Most tools target a distinct resource and action: labels, filters, emails, attachments, and drafts. The only real ambiguity is between modify_email and trash_email (both affect email placement) and between create_filter and create_filter_from_template, but the descriptions clarify the difference.
All tool names are lowercase snake_case and follow a verb_noun pattern, from list_email_labels to batch_trash_emails. Even compound operations like get_or_create_label and create_filter_from_template fit the pattern without mixing styles.
At 19 tools, the set sits in the 16-25 range that reads as heavy for an MCP server. That said, each tool has a role in Gmail's email/label/filter domain, so it is not extreme.
Labels and filters have full CRUD plus conveniences, and emails can be sent, read, searched, labeled, trashed, and have attachments downloaded. Missing draft lifecycle operations (send/update/list/delete) and restore/permanent-delete are the main gaps, but core workflows are still achievable.