Add to Claude Code
168 addsAdd this MCP server to Claude Code.
Name: Gmail MCP
Merge into: ~/.claude/mcp.json under mcpServers
---
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["-y", "gmail-mcp"],
"env": {
"GOOGLE_CLIENT_ID": "<YOUR_CLIENT_ID>",
"GOOGLE_CLIENT_SECRET": "<YOUR_CLIENT_SECRET>"
}
}
}
}
// ── Setup ────────────────────────────────────────────────────────────────────
// 1. Create a project in Google Cloud Console
// 2. Enable the Gmail API
// 3. Create OAuth 2.0 credentials (Desktop app type)
// 4. On first use, authorize via browser to grant email access
//
// Required OAuth scopes:
// gmail.readonly, gmail.send, gmail.compose, gmail.modify, gmail.labels
//
// ── Available tools ──────────────────────────────────────────────────────────
// list_messages list recent emails (inbox, sent, etc.)
// search_messages search emails using Gmail query syntax
// get_message read a full email by ID
// send_email send a new email
// create_draft create a draft email
// reply_to_email reply to an existing thread
// add_label add a label to a message
// remove_label remove a label from a message
// list_labels list all labels in the account
//
// ── Gmail search syntax ──────────────────────────────────────────────────────
// from:user@example.com emails from a specific sender
// subject:"weekly update" emails with subject match
// has:attachment emails with attachments
// newer_than:2d emails from the last 2 days
// is:unread unread emails only
Paste into Claude Code to connect this MCP server.
How to add
Full guide →Click Add, then paste into Claude Code. Claude will connect the MCP server in your settings.
Target: .claude/mcp.json → mcpServers