Gmail AutoAuth MCP Server
Features
- Send emails with subject, content, attachments, and recipients
- Full support for international characters in subject lines and email content
- Read email messages by ID with advanced MIME structure handling
- View email attachments information (filenames, types, sizes)
- Search emails with various criteria (subject, sender, date range)
- Comprehensive label management with ability to create, update, delete and list labels
- List all available Gmail labels (system and user-defined)
- List emails in inbox, sent, or custom labels
- Mark emails as read/unread
- Move emails to different labels/folders
- Delete emails
- Batch operations for efficiently processing multiple emails at once
- Full integration with Gmail API
- Simple OAuth2 authentication flow with auto browser launch
- Support for both Desktop and Web application credentials
- Global credential storage for convenience
Installation & Authentication
Installing via Smithery
Installing Manually
- Create a Google Cloud Project and obtain credentials:a. Create a Google Cloud Project:b. Create OAuth 2.0 Credentials:
- Run Authentication:You can authenticate in two ways:a. Global Authentication (Recommended):b. Local Authentication:The authentication process will:
- Configure in Claude Desktop:
Docker Support
- Authentication:
- Usage:
Cloud Server Authentication
Setup Instructions for Cloud Environment
- Configure Reverse Proxy:
- DNS Configuration:
- Google Cloud Platform Setup:
- Run Authentication:
- Configure in your application:
Available Tools
1. Send Email (`send_email`)
2. Draft Email (`draft_email`)
3. Read Email (`read_email`)
4. Search Emails (`search_emails`)
5. Modify Email (`modify_email`)
6. Delete Email (`delete_email`)
7. List Email Labels (`list_email_labels`)
8. Create Label (`create_label`)
9. Update Label (`update_label`)
10. Delete Label (`delete_label`)
11. Get or Create Label (`get_or_create_label`)
12. Batch Modify Emails (`batch_modify_emails`)
13. Batch Delete Emails (`batch_delete_emails`)
Advanced Search Syntax
search_emails
tool supports Gmail's powerful search operators:[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
from:john@example.com after:2024/01/01 has:attachment
Advanced Features
Email Content Extraction
- Prioritizes plain text content when available
- Falls back to HTML content if plain text is not available
- Handles multi-part MIME messages with nested parts
- Processes attachments information (filename, type, size)
- Preserves original email headers (From, To, Subject, Date)
International Character Support
- Turkish, Chinese, Japanese, Korean, and other non-Latin alphabets
- Special characters and symbols
- Proper encoding ensures correct display in email clients
Comprehensive Label Management
- Create Labels: Create new labels with customizable visibility settings
- Update Labels: Rename labels or change their visibility settings
- Delete Labels: Remove user-created labels (system labels are protected)
- Find or Create: Get a label by name or automatically create it if not found
- List All Labels: View all system and user labels with detailed information
- Label Visibility Options: Control how labels appear in message and label lists
messageListVisibility
: Controls whether the label appears in the message list (show
orhide
)
labelListVisibility
: Controls how the label appears in the label list (labelShow
,labelShowIfUnread
, orlabelHide
)
Batch Operations
- Process up to 50 emails at once (configurable batch size)
- Automatic chunking of large email sets to avoid API limits
- Detailed success/failure reporting for each operation
- Graceful error handling with individual retries
- Perfect for bulk inbox management and organization tasks
Security Notes
- OAuth credentials are stored securely in your local environment (
~/.gmail-mcp/
)
- The server uses offline access to maintain persistent authentication
- Never share or commit your credentials to version control
- Regularly review and revoke unused access in your Google Account settings
- Credentials are stored globally but are only accessible by the current user
Troubleshooting
- OAuth Keys Not Found
- Invalid Credentials Format
- Port Already in Use
- Batch Operation Failures
Contributing
License
Support
Gmail AutoAuth MCP Server
Features
- Send emails with subject, content, attachments, and recipients
- Full support for international characters in subject lines and email content
- Read email messages by ID with advanced MIME structure handling
- View email attachments information (filenames, types, sizes)
- Search emails with various criteria (subject, sender, date range)
- Comprehensive label management with ability to create, update, delete and list labels
- List all available Gmail labels (system and user-defined)
- List emails in inbox, sent, or custom labels
- Mark emails as read/unread
- Move emails to different labels/folders
- Delete emails
- Batch operations for efficiently processing multiple emails at once
- Full integration with Gmail API
- Simple OAuth2 authentication flow with auto browser launch
- Support for both Desktop and Web application credentials
- Global credential storage for convenience
Installation & Authentication
Installing via Smithery
Installing Manually
- Create a Google Cloud Project and obtain credentials:a. Create a Google Cloud Project:b. Create OAuth 2.0 Credentials:
- Run Authentication:You can authenticate in two ways:a. Global Authentication (Recommended):b. Local Authentication:The authentication process will:
- Configure in Claude Desktop:
Docker Support
- Authentication:
- Usage:
Cloud Server Authentication
Setup Instructions for Cloud Environment
- Configure Reverse Proxy:
- DNS Configuration:
- Google Cloud Platform Setup:
- Run Authentication:
- Configure in your application:
Available Tools
1. Send Email (`send_email`)
2. Draft Email (`draft_email`)
3. Read Email (`read_email`)
4. Search Emails (`search_emails`)
5. Modify Email (`modify_email`)
6. Delete Email (`delete_email`)
7. List Email Labels (`list_email_labels`)
8. Create Label (`create_label`)
9. Update Label (`update_label`)
10. Delete Label (`delete_label`)
11. Get or Create Label (`get_or_create_label`)
12. Batch Modify Emails (`batch_modify_emails`)
13. Batch Delete Emails (`batch_delete_emails`)
Advanced Search Syntax
search_emails
tool supports Gmail's powerful search operators:[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
[object Object] | [object Object] | [object Object] |
from:john@example.com after:2024/01/01 has:attachment
Advanced Features
Email Content Extraction
- Prioritizes plain text content when available
- Falls back to HTML content if plain text is not available
- Handles multi-part MIME messages with nested parts
- Processes attachments information (filename, type, size)
- Preserves original email headers (From, To, Subject, Date)
International Character Support
- Turkish, Chinese, Japanese, Korean, and other non-Latin alphabets
- Special characters and symbols
- Proper encoding ensures correct display in email clients
Comprehensive Label Management
- Create Labels: Create new labels with customizable visibility settings
- Update Labels: Rename labels or change their visibility settings
- Delete Labels: Remove user-created labels (system labels are protected)
- Find or Create: Get a label by name or automatically create it if not found
- List All Labels: View all system and user labels with detailed information
- Label Visibility Options: Control how labels appear in message and label lists
messageListVisibility
: Controls whether the label appears in the message list (show
orhide
)
labelListVisibility
: Controls how the label appears in the label list (labelShow
,labelShowIfUnread
, orlabelHide
)
Batch Operations
- Process up to 50 emails at once (configurable batch size)
- Automatic chunking of large email sets to avoid API limits
- Detailed success/failure reporting for each operation
- Graceful error handling with individual retries
- Perfect for bulk inbox management and organization tasks
Security Notes
- OAuth credentials are stored securely in your local environment (
~/.gmail-mcp/
)
- The server uses offline access to maintain persistent authentication
- Never share or commit your credentials to version control
- Regularly review and revoke unused access in your Google Account settings
- Credentials are stored globally but are only accessible by the current user
Troubleshooting
- OAuth Keys Not Found
- Invalid Credentials Format
- Port Already in Use
- Batch Operation Failures