Gmail MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gmail MCP Serverread my last 3 emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§ 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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP 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.Last updated74GPL 3.0
- Alicense-qualityFmaintenanceEnables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.Last updated63MIT
- Alicense-qualityDmaintenanceEnables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.Last updated1MIT
- Alicense-qualityCmaintenanceEnables AI agents and Telegram bots to read and send Gmail messages via MCP with OAuth authentication.Last updated103MIT
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organizβ¦
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflowβ¦
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sejalpatole/Gmail-MCP-Server-using-FastMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server