MCP Gmail Server
Enables users to read unread emails and create email drafts directly within their Gmail account via the Gmail API.
Provides access to Google services for managing email workflows, including fetching message content and composing responses.
Integrates with the Google Cloud Platform to manage OAuth 2.0 credentials and enable the Gmail API for secure server authentication.
Click on "Deploy 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., "@MCP Gmail Server Show me my last 5 unread 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.
MCP Gmail Server
A server that uses model context protocol[https://modelcontextprotocol.io/] to read and create drafts of emails from Gmail.
Project setup
Create Oauth client and add secrets:
Create a Google Cloud Project
In the top-left, open the project dropdown and click New Project
Give your project a name (e.g., Gmail API Demo)
Click Create Your project is now created; make sure it’s selected in the project dropdown.
Enable the Gmail API
Go to the API Library: https://console.cloud.google.com/apis/library
Search for Gmail API
Click it → Enable
Configure OAuth 2.0 Credentials
Navigate to: APIs & Services → Credentials
You’ll be prompted to configure the OAuth Consent Screen (if first time creating OAuth credentials)
Choose External if users outside your Google Workspace will use it
Fill in details
Add test users (email addresses allowed to authorize during development)
Save the configuration
Click Create Credentials → OAuth client ID
Choose the application type: Desktop app (for testing/dev)
Name it
Click Create
You will now receive:
Client ID
Client Secret Download them as JSON for use in your code.
Save the JSON as "client_secret_oauth_gcp.json" in the root of this project. (note this should be stored securely and not commited to github.)
Install and run app
Install uv: https://docs.astral.sh/uv/getting-started/installation/
Install dependencies with uv:
uv sync
Start server:
uv run -m src.mcp_server_gmail
Claude desktop
Install Claude Desktop
Set claude_desktop_config.json file to:
{
"mcpServers": {
"gmail": {
"command": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/.venv/bin/python",
"args": [
"-m",
"mcp_server_gmail"
],
"env": {
"PYTHONPATH": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/src"
},
"cwd": "/Users/myname/Documents/Coding/fac-mcp-gmail-server"
}
}
}Ensuring the directory paths are replaced appropriately with your local directory paths.
Test (manual)
Go to claude desktop
Try the following: "Get last 3 unread emails" "Create draft emails for these"
See /docs/working_examples, for examples screenshots of the mcp server
Related MCP server: gmail-mcp-server
Features
Gmail Oauth set up
MCP server for read and drafting emails on gmail
Available Tools
2 toolscreate_draft_replyC
Create a draft reply to an email
Inputs: message_content (required), message_id (required). Returns: result
get_unread_emailsA
Get a list of unread emails
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one retrieves unread emails, the other creates draft replies. No overlap or ambiguity.
Both tools follow the verb_noun pattern with snake_case, consistent and predictable naming.
With only 2 tools for a Gmail server, the surface is too thin. A typical Gmail integration would require many more operations.
The tool set is severely incomplete for email management: missing send, search, archive, delete, label management, and other essential operations.
Maintenance
Related MCP Connectors
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceIntegrates Gmail with Claude to fetch unread emails and generate draft replies based on user context and writing style guidelines stored in Google Docs. It enables automated email management and drafting through natural language interactions within the Model Context Protocol framework.-
- FlicenseNot gradedqualityDmaintenanceEnables reading unread emails and creating draft replies in Gmail via Claude Desktop.-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables Claude Desktop to interact with Gmail through secure OAuth 2.0 authentication. Send emails, search messages, read emails, and manage multiple Gmail accounts directly from Claude Desktop.298 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and manage Gmail emails, drafts, and labels via the Model Context Protocol.5MIT