Gmail MCP Server
Allows AI assistants to interact with Gmail securely, providing capabilities such as fetching unread messages with metadata, drafting thread-aware replies, and managing email tasks via the Gmail API.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Gmail MCP Server π§
A high-performance Model Context Protocol (MCP) server that enables AI assistants to interact with Gmail securely.
β¨ Features
Smart Email Retrieval: Fetch unread messages with rich metadata.
Thread-Aware Drafting: Create replies that maintain conversation context.
Secure Authentication: Robust OAuth 2.0 implementation with token management.
Enterprise Ready: Structured for scalability and maintainability.
Related MCP server: Gmail AutoAuth MCP Server
ποΈ Architecture
System Data Flow
graph TD
User(["π€ User"]) <-->|"Natural Language"| Claude(["π€ Claude Desktop"])
subgraph "MCP Server (Local Machine)"
Claude <-->|"JSON-RPC (stdio)"| Main["src/main.py"]
Main -->|Dispatch| Handler["src/handlers.py"]
Handler -->|Call| Client["src/client.py"]
end
Client <-->|"HTTPS / OAuth 2.0"| Gmail(["βοΈ Google Gmail API"])
style User fill:#f9f,stroke:#333
style Claude fill:#e1f5fe,stroke:#01579b
style Gmail fill:#fce4ec,stroke:#880e4fThe project follows standard engineering practices:
MLI/
βββ src/
β βββ main.py # Application Entry Point
β βββ client.py # Gmail API Client
β βββ handlers.py # Request Handlers
βββ config/ # Configuration & Credentials
βββ tests/ # Unit Tests
βββ requirements.txt # Dependenciesπ Quick Start
1. Prerequisite
Python 3.8+
Google Cloud Project with Gmail API enabled
2. Installation
# Clone and setup environment
python -m venv .venv
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt3. Configuration
Place your Google Cloud
credentials.jsoninconfig/.Copy the environment config:
copy .env.example .env
4. Claude Integration
Add to your Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"gmail": {
"command": "C:\\Path\\To\\MLI\\.venv\\Scripts\\python.exe",
"args": ["-m", "src.main"],
"cwd": "C:\\Path\\To\\MLI",
"env": {
"CREDENTIALS_PATH": "config/credentials.json",
"TOKEN_PATH": "config/token.json"
}
}
}
}π οΈ Usage
Check Emails:
"Check my unread emails"
Draft Reply:
"Draft a reply to the email from [Name]"
π‘οΈ Security
Credentials are never committed to version control.
Tokens are stored locally in
config/.Communication happens directly between your machine and Google API.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Email infrastructure for AI agents β send, receive, search, and reply to email over MCP.
Hosted MCP server for your Gmail, Outlook and IMAP mail, with mailboxes and scopes set per agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides AI applications with a toolset for an Artificial Virtual Assistant (AVA) integrated with the Gmail API. It enables users to automate email management and personal tasks through secure Google OAuth authentication.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server enabling AI assistants to manage Gmail through natural language, including sending, reading, searching, labeling, and handling attachments with auto authentication.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for Gmail that allows AI assistants to read, search, compose drafts, send emails, and manage labels with attachment support.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that lets AI assistants send, read, and manage Gmail through natural language, including email sending, inbox management, and template-based outreach.131 npmMIT