MCP Gmail Server
Enables users to read unread emails and create drafts in Gmail via the Model Context Protocol. It leverages Google OAuth 2.0 for secure authentication and integrates with tools like Claude Desktop for natural language email management.
README
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
- Go to https://console.cloud.google.com/
- 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
Features
- Gmail Oauth set up
- MCP server for read and drafting emails on gmail
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.