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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
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.
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.72GPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.113MIT
- AlicenseNot gradedqualityDmaintenanceEnables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.1MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents and Telegram bots to read and send Gmail messages via MCP with OAuth authentication.19MIT
Appeared in Searches
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