Gmail · domdomegg — Claude Code MCP server: what it does, how to install
Connects an AI agent to Gmail for searching, reading, sending, and managing mail. Useful for email-driven workflows and automation.
claude mcp add --env GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> --transport stdio domdomegg-gmail -- npx -y gmail-mcpWhat Gmail does
This MCP server exposes Gmail actions to an AI client. It can search messages and threads, read and send mail, forward messages, create and send drafts, download attachments, update labels, archive mail, and move messages between trash states. It also includes filters, vacation replies, and bulk message operations.
The server sits between the MCP client and Google as an OAuth proxy. It forwards authorization and uses the bearer token for Gmail API calls, without keeping tokens or session state. You need Gmail API access, Google OAuth credentials, Node.js, and npx; setup cannot complete without GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.
What it helps with
- search a mailbox or thread
- read and forward an email
- create or send a draft
- archive messages and update labels
- download an email attachment
Example prompts for the agent
- Find the Acme delivery email and tell me the tracking number.
- Draft a reply to the latest message in this thread.
- Locate last week's receipts and download their attachments.
How to install Gmail
Platform CLI
claude mcp add --env GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> --transport stdio domdomegg-gmail -- npx -y gmail-mcpReplace <…> with your own values
Platform CLI
codex mcp add domdomegg-gmail --env GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> --env GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> -- npx -y gmail-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"domdomegg-gmail": {
"command": "npx",
"args": [
"-y",
"gmail-mcp"
],
"env": {
"GOOGLE_ACCESS_TOKEN": "<GOOGLE_ACCESS_TOKEN>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>",
"GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
"GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"domdomegg-gmail": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"gmail-mcp"
],
"env": {
"GOOGLE_ACCESS_TOKEN": "<GOOGLE_ACCESS_TOKEN>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>",
"GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
"GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> -e MCP_TRANSPORT=<MCP_TRANSPORT> -e GOOGLE_CLIENT_ID=<GOOGLE_CLIENT_ID> -e GOOGLE_CLIENT_SECRET=<GOOGLE_CLIENT_SECRET> domdomegg-gmail npx -y gmail-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Gmail
How do I install Gmail in Claude Code?
Run claude mcp add gmail-mcp -e GOOGLE_ACCESS_TOKEN=<GOOGLE_ACCESS_TOKEN> -- npx -y gmail-mcp. Then authorize Gmail access through Google OAuth.
What does the Gmail MCP server do?
It gives an AI client Gmail tools for searching, reading, sending, and organizing mail, including drafts, attachments, labels, and vacation replies.
What does Gmail MCP require?
Enable the Gmail API, create Google OAuth credentials, and provide GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. The server runs through Node.js and npx.
Similar MCP servers
All MCP servers for Backend and APIs →Gmail by other authors comes first.