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 "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., "@MCP Gmail ServerShow 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:
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