Gmail SMTP MCP Server
Enables sending emails through Gmail accounts via SMTP, using app passwords instead of OAuth.
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 SMTP MCP ServerSend an email to mike@company.com saying 'Project update: check latest commit.'"
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 SMTP MCP Server (Python)
Sends email as a teammate's Gmail account via SMTP + an App Password,
instead of Google OAuth. No Google Cloud project, no client secret, no
redirect_uri allowlist, no consent screen. This is a Python port of the
Node.js version — same architecture, same endpoints.
How auth works
claude.ai's connector setup still expects a normal OAuth 2.1 + PKCE dance — that part of the MCP spec doesn't change. What changes is who the "identity provider" is:
User adds your connector in claude.ai → claude.ai opens
/authorize.Instead of "Sign in with Google", they see a form asking for their Gmail address + an App Password (requires 2-Step Verification on their Google account).
The server test-sends an email to confirm the credentials work, encrypts and stores the app password, then redirects back to claude.ai with an auth code — same as a normal OAuth flow.
claude.ai exchanges that code at
/tokenfor a bearer token.Every
send_email_toolcall carries that bearer token; the server looks up which Gmail account it maps to (via the token'ssubject) and sends via SMTP using only Python's standard library (smtplib).
Nothing here talks to Google's OAuth API. There's no client secret to leak or rotate.
Related MCP server: Gmail MCP Server
Setup
pip install -r requirements.txt
# Generate a 32-byte encryption key for storing app passwords at rest
export MASTER_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))")
export BASE_URL=http://localhost:3000
uvicorn server:app --port 3000Add both MASTER_KEY and BASE_URL to a .env file if you'd rather not
export them each time — just make sure something loads it before uvicorn
starts (e.g. python-dotenv, or your platform's env var settings).
Deploying to Render
Push this repo, create a new Web Service pointing at it.
Build command:
pip install -r requirements.txtStart command:
uvicorn server:app --host 0.0.0.0 --port $PORT
Set env vars:
MASTER_KEY(generate as above),BASE_URL(your Render URL, e.g.https://your-app.onrender.com).Important:
data.json(where users/tokens live) is written to local disk. Render's free web services have ephemeral disks — a redeploy wipes it and every teammate has to reconnect. For anything beyond testing, either add a Render persistent disk mount, or swapstore.pyfor Postgres/SQLite (the function signatures instore.pyare the only thing you'd need to keep the same).In claude.ai, add a custom connector pointing at
https://your-app.onrender.com/mcp.
Files
server.py— FastAPI app: OAuth-shaped/authorize+/tokenendpoints, the MCP server (built withmcp'sFastMCP) mounted at/mcpwith bearer-token auth enforced automatically by the SDK.store.py— encrypted (AES-256-GCM) storage for app passwords, auth codes, and access tokens.mailer.py— sends viasmtp.gmail.com:465using Python's built-insmtplib, no extra package needed.
A gotcha worth knowing about if you modify this
FastMCP's streamable_http_app() normally manages its own startup/shutdown
(a "session manager") when run standalone. When you mount it inside another
FastAPI app with app.mount("/mcp", ...), FastAPI does not automatically
run the sub-app's lifespan — so streaming requests fail with
RuntimeError: Task group is not initialized. The fix already in
server.py is wiring mcp.session_manager.run() into the outer FastAPI
app's own lifespan. If you restructure this file, keep that wiring intact.
Security notes
App passwords are encrypted at rest with
MASTER_KEY, but they're still bearer credentials with full mail-send access — treatdata.json(or your DB) like you would a password table.Access tokens are long-lived (90 days) bearer tokens with no rotation. Fine for an internal team tool; add refresh tokens or shorter expiry if this ever leaves that trust boundary.
Anyone who can reach
/authorizecan register any Gmail address they control an app password for — there's no allowlist. Add one (e.g. only@caratlane.comaddresses) if you want to restrict this before sharing the connector link.
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
- Flicense-qualityDmaintenanceEnables AI applications to send emails, manage drafts, and compose professional emails through Gmail API with secure multi-user OAuth2 authentication and encrypted token storage.
- AlicenseCqualityDmaintenanceProvides complete Gmail API integration for email management, including sending/receiving messages, managing labels and threads, creating drafts, and configuring settings through OAuth2 authentication.641,849MIT
- Alicense-qualityBmaintenanceEnables reading, sending, archiving, and managing Gmail emails and labels through Google OAuth authentication, acting as an OAuth proxy to the Gmail API.26811MIT
- Flicense-qualityDmaintenanceEnables sending emails through Gmail using Google's Gmail API. Requires OAuth authentication setup through Google Cloud Console.
Related MCP Connectors
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…
Email for AI agents: send mail, manage contacts, automations & webhooks. Zero-DNS first send.
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/chandhinii1510-coder/mcp-multiuser'
If you have feedback or need assistance with the MCP directory API, please join our Discord server