Gmail MCP Server
Enables sending emails, creating and managing drafts, and accessing user information through the Gmail API with OAuth2 authentication and multi-user support
Uses Google Cloud Console for OAuth2 credential management and Gmail API access configuration
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 Serversend an email to alex@company.com about our meeting tomorrow"
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
A remote FastMCP server for sending Gmail messages through a single owner Gmail identity. The server is designed for Prefect Horizon and relies on Horizon's gateway authentication for MCP access.
Features
Horizon-managed MCP authentication
Server-owned Gmail refresh token for the owner Gmail identity
Gmail send, draft creation, draft listing, and draft sending tools
Professional email composition prompts, resources, and helper tools
Remote-only Horizon entry point at
main.py:mcp
Deployment
Deploy this repository to Prefect Horizon from the default branch.
Configure Horizon with:
Entrypoint:
main.py:mcpHorizon authentication: enabled
Set these deployment environment variables:
GOOGLE_OAUTH_CLIENT_ID: Google OAuth client ID for the owner Gmail tokenGOOGLE_OAUTH_CLIENT_SECRET: Google OAuth client secret for the owner Gmail tokenGOOGLE_OAUTH_REFRESH_TOKEN: refresh token for the owner Gmail identityALLOWED_GMAIL_EMAIL: the Gmail address the refresh token must belong to
The Google OAuth refresh token must include these scopes:
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/gmail.modifyHorizon controls who may connect to the MCP server. The backend uses the configured owner Gmail refresh token for Gmail API calls.
Local Verification
Install dependencies:
uv syncInspect the Horizon entry point with dummy local configuration:
GOOGLE_OAUTH_CLIENT_ID=test.apps.googleusercontent.com \
GOOGLE_OAUTH_CLIENT_SECRET=test \
GOOGLE_OAUTH_REFRESH_TOKEN=test-refresh-token \
ALLOWED_GMAIL_EMAIL=owner@example.com \
uv run fastmcp inspect main.py:mcpFor a real local OAuth test, copy the example environment file and fill in your Google OAuth web client values:
cp .env.example .envThen load it before running the local HTTP server:
set -a
source .env
set +a
uv run fastmcp run main.py:mcp --transport http --host 127.0.0.1 --port 8000Run quality checks:
uv run ruff check .
uv run pytestAvailable MCP Tools
Core Gmail Tools
send_email: send an email immediatelycreate_draft: create an email draftsend_draft: send an existing Gmail draftlist_drafts: list Gmail draftsget_user_info: return the authenticated Gmail profile
Email Assistance Tools
get_subject_line_helpvalidate_subject_line_toolget_email_templates
MCP Prompts
professional_email_composerfollow_up_email_generatormeeting_request_composerdraft_strategy_advisoremail_review_checklist
MCP Resources
Template resources are exposed for professional HTML emails, signatures, and email guidelines.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/PeeeBrain/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server