gmail-mcp-server-rust
by abhinav20sep
Overview
Integrate AI models (e.g., Claude) with Gmail for email management and automation via the Model Context Protocol.
Installation
./target/release/gmail-mcp-serverEnvironment Variables
- GMAIL_OAUTH_PATH
- GMAIL_CREDENTIALS_PATH
- GMAIL_OAUTH_PORT
- RUST_LOG
Security Notes
The `download_attachment` tool allows the AI (and thus potentially an attacker through a crafted prompt) to specify an arbitrary `save_path` and `filename`. While the `Path::join` method correctly handles path segments to prevent simple path traversal within the filename, it does not validate or restrict the base `save_path` argument. This means an attachment could be downloaded to sensitive system directories (e.g., `/etc`, `~/.ssh`) if the AI is prompted to do so, posing a significant risk for arbitrary file writes.
Similar Servers
gmail-mcp
Manages Gmail emails programmatically, enabling AI systems to read, send, archive, and perform other email operations on behalf of a user.
Google-Workspace-MCP
Seamlessly integrates Google Drive, Sheets, and Docs with Claude AI and other AI agents through the Model Context Protocol (MCP) for automation.
stateful-auth-for-mcp-servers
Integrates Google Gmail and Calendar APIs to enable an AI agent to read emails and manage calendar events with stateful authorization for event deletions.
imap-readonly-mcp
Exposes read-only access to email mailboxes (IMAP, POP3, Microsoft Graph) via Model Context Protocol for AI agents.