| name | email-mcp-server |
| description | MCP server enabling Claude Code to draft, send, and search emails via Gmail with HITL (Human-in-the-Loop) enforcement. Use when Claude needs to interact with Gmail for email operations while maintaining human oversight and approval for sensitive actions. |
Email MCP Server
Overview
The Email MCP Server is a Model Context Protocol (MCP) server that enables Claude Code to interact with Gmail for email operations. It provides secure, human-monitored access to email functionality with Human-in-the-Loop (HITL) enforcement for sensitive operations.
Core Capabilities
The email MCP server provides:
- Email Drafting: Compose emails with rich formatting and attachments
- Email Sending: Send emails with appropriate HITL approvals
- Email Search: Search and retrieve emails based on various criteria
- HITL Enforcement: Human oversight for sensitive email operations
- Security Controls: Authentication and access management
- Audit Trail: Logging of all email operations
Usage Scenarios
Use the email MCP server when:
- Claude needs to draft professional emails
- Automated email sending with human approval is required
- Email searching and retrieval is needed
- Human oversight is mandatory for email operations
- Compliance with email policies is required
- Integration with Gmail is necessary
Architecture
The server follows MCP standards and provides secure access to Gmail with appropriate safeguards:
- Authentication Layer: OAuth2 with Google
- Authorization Layer: Role-based access control
- HITL Gateway: Approval workflow for sensitive operations
- API Layer: MCP-compliant endpoints for email operations
- Audit Layer: Comprehensive logging and tracking
MCP Endpoints
Available Operations
The server exposes these MCP-compatible operations:
draft_email: Create a new email draft
send_email: Send an email (requires HITL approval)
search_emails: Search emails by criteria
get_email: Retrieve specific email content
list_labels: Get available Gmail labels
create_label: Create new labels
get_thread: Retrieve email thread
get_profile: Get user profile information
HITL Enforcement
Certain operations require human approval:
- Sending emails to external domains
- Sending emails with attachments over size limits
- Sending emails with sensitive keywords
- Bulk email operations
Security Considerations
Authentication
- OAuth2 with Google Workspace/Gmail
- Secure token storage and refresh
- Session management
- Device verification
Authorization
- Scope-based permissions (read/write/send)
- Role-based access control
- Domain restrictions
- Rate limiting
HITL Controls
- Approval workflows for sensitive operations
- Human verification for critical actions
- Audit trail for all operations
- Escalation procedures
Configuration
Required Setup
- Google Cloud Project with Gmail API enabled
- OAuth2 credentials (client ID and secret)
- Authorized redirect URIs
- HITL approval endpoints (optional)
Example Configuration
{
"gmail": {
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"scopes": ["https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.send"],
"redirect_uris": ["http://localhost:8080/oauth/callback"]
},
"hitl": {
"enabled": true,
"approval_required": {
"external_recipients": true,
"attachment_size_mb": 10,
"sensitive_keywords": ["confidential", "private", "urgent"]
}
},
"server": {
"port": 8080,
"host": "localhost"
}
}
HITL Workflow
Standard Workflow
- Claude requests email operation
- Server evaluates HITL requirements
- If approval required, notify human reviewer
- Human approves/rejects operation
- Server executes approved operation
- Result returned to Claude
Emergency Override
For urgent operations, emergency override procedures are available with additional authentication.
Resources
This skill includes example resource directories that demonstrate how to implement email operations with MCP compliance:
scripts/
Python scripts for MCP server implementation, Gmail API integration, and HITL workflows.
references/
Documentation for Gmail API integration, OAuth2 setup, and HITL procedures.
assets/
Configuration templates and example implementations for various email scenarios.
The email MCP server enables secure and compliant email operations with appropriate human oversight.
When NOT to Use This Skill
- Bulk email marketing — use dedicated ESPs (SendGrid, Mailchimp) for mass email; this skill handles transactional and individual emails only
- Regulated industries requiring email archiving — ensure your setup complies with retention requirements before routing regulated communications through this server
- High-frequency automated email sending — Gmail and OAuth providers enforce daily sending limits; exceeding them causes account suspension
Common Mistakes
- Using personal Gmail credentials instead of a service account — personal OAuth tokens expire and require re-authentication; service accounts with domain-wide delegation are more reliable
- Not implementing HITL approval for outbound emails — sending emails without human review is risky; always add an approval step before the
send action
- Storing OAuth tokens in plaintext config files — tokens are credentials; store them in an encrypted secret manager or environment variables
Related Skills