Provides tools for managing Gmail emails including listing/searching messages, reading full email content, creating drafts, and sending emails. Includes prompts for summarizing unread emails, drafting replies, composing new messages, and generating daily email digests.
Gmail MCP Server
MCP server for Gmail integration with Claude, Cursor, Kiro, and other MCP clients.
Tools
Tool | Description |
| List/search emails (returns id, snippet, subject, from, date) |
| Read full email content by ID |
| Create a draft email (requires
to actually send) |
| Send a drafted email |
Prompts
Prompt | Description |
| Summarize unread emails with priority |
| Draft reply to an email |
| Compose new email |
| Natural language email search |
| Daily email digest by category |
Setup Details for running it locally
1. Install Dependencies
2. Get Google OAuth Credentials
Go to Google Cloud Console
Create project → Enable Gmail API
APIs & Services → Credentials → Create OAuth Client ID → Desktop App
Download JSON → rename to
credentials.json→ place in this folder (gmail-mcp-server)
3. Authenticate
The server supports Login-on-Demand. You don't need to authenticate before running the server.
Start the Server: Run it locally or in the cloud.
Ask a Question: e.g., "Check my unread emails".
Follow Instructions: If you aren't logged in, the server will reply with a URL.
Authorize: Click the URL, authorize Google, and copy the code.
Submit Code: Paste the code into the chat using the
submit_auth_codetool (or just tell the model "Here is the code: ...").
Running the Server
Add this to your config file:
Note: Replace Now paste the config in your mcp.json file. to use the server in IDE
Next refresh your IDE and you should be able to use the server.
Test with MCP Inspector
Configuration
You can configure the server using environment variables to avoid hardcoding files or to support different environments. You can either set these in your system, in the mcp.json env block, or by creating a .env file in the project directory (copy .env.example).
Variable | Description | Default |
| Path to
|
(in repo) |
| Path to
|
(in repo) |
Option 1: Using .env file (Recommended for local)
Copy
.env.exampleto.envUpdate the values in
.envThe server will automatically load them.
Option 2: mcp.json with Env Vars
File Structure
Security - IMPORTANT
credentials.json: This file identifies the Application (the code), NOT you.Risk Level: Low.
If shared: Someone can run the app pretending to be your project, but they cannot access your emails without logging in.
token.json: This file contains the Access Keys to your specific Gmail account.Risk Level: CRITICAL.
If shared: Someone CAN read and send emails as you.
NEVER SHARE Ensure it is in your
.gitignore(it is by default in this repo).
send_draftsends real emails - use carefully