Gmail MCP Server
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 using FastMCP
A Model Context Protocol (MCP) server built with FastMCP that integrates with the Gmail API. This project demonstrates how to create AI-accessible tools for reading and sending emails using Google OAuth authentication.
π Features
π Google OAuth 2.0 authentication
π© Send emails through Gmail
π₯ Read Gmail messages
π οΈ MCP tools using FastMCP
β‘ Lightweight Python implementation
π Secure credential management using environment variables
Related MCP server: Gmail MCP Server
π οΈ Tech Stack
Python 3.13
FastMCP
Gmail API
Google OAuth 2.0
Uvicorn
python-dotenv
π Project Structure
.
βββ main.py
βββ oauth.py
βββ tools/
β βββ gmail.py
β βββ __init__.py
βββ .env
βββ requirements.txt
βββ README.mdβοΈ Installation
Clone the repository
git clone https://github.com/your-username/mcp-practice.git
cd mcp-practiceCreate a virtual environment
python -m venv .venvActivate the environment
Windows
.venv\Scripts\activateLinux/macOS
source .venv/bin/activateInstall dependencies
pip install -r requirements.txtπ Configure Environment Variables
Create a .env file and add:
GOOGLE_CLIENT_SECRET_PATH=client_secret.json
GOOGLE_TOKEN_PATH=token.jsonβΆοΈ Authenticate Gmail
python oauth.pyThis will open a browser for Google authentication and generate token.json.
βΆοΈ Run the MCP Server
python main.pyor
uv run fastmcp dev main.py:mcpπ Learning Objectives
This project was created to practice:
Model Context Protocol (MCP)
FastMCP framework
Tool decorators
Prompt decorators
Google OAuth
Gmail API integration
AI tool development
π Future Improvements
Email search
Delete emails
Mark emails as read/unread
Attachment support
Async MCP tools
Better error handling
π€ Contributing
Contributions and suggestions are welcome.
π License
This project is for educational and learning purposes.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Email infrastructure for AI agents β send, receive, search, and reply to email over MCP.
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Gmail for agents: create inboxes, read and reply to mail, send email, manage domains. OAuth sign-in.
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organizβ¦
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that integrates with Gmail to enable sending, reading, and managing emails through tools like send-email, trash-email, get-unread-emails, and read-email.73GPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.7 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents and Telegram bots to read and send Gmail messages via MCP with OAuth authentication.27 npmMIT