Updated March 2026
Install Gmail MCP Server
Pick your client, copy the command, done.
1
Add it to Claude Code
Run this in a terminal.
claude mcp add -e "GMAIL_MCP_CREDENTIALS_PATH=${GMAIL_MCP_CREDENTIALS_PATH}" gmail-mcp -- uvx --from git+https://github.com/fred-drake/gmail-mcp gmail-mcpRequired:
GMAIL_MCP_CREDENTIALS_PATH+ 1 optionalEnvironment Variables
Set these before running Gmail MCP Server.
VariableDescriptionRequired
GMAIL_MCP_CREDENTIALS_PATHPath to OAuth credentials JSONYesGMAIL_MCP_TOKEN_PATHPath to token cache fileNoAvailable Tools (5)
Once configured, Gmail MCP Server gives your AI agent access to:
list_unreadList unread emails from inbox.max_resultssearchSearch emails using Gmail query syntax.querymax_resultsarchiveArchive emails by removing INBOX and UNREAD labels.message_idsmark_as_readMark emails as read without archiving.message_idsget_labelsGet all Gmail labels for the authenticated user.Try It Out
After setup, try these prompts with your AI agent:
→List my unread emails from the last 24 hours.
→Search for emails from GitHub with the subject 'invoice' and mark them as read.
→Find all emails containing attachments larger than 5MB and archive them.
→Show me all my current Gmail labels.
Prerequisites & system requirements
- An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
- Python 3.8+ with pip installed
GMAIL_MCP_CREDENTIALS_PATH— Path to OAuth credentials JSON
Keep this setup from going cold
Save the docs, env vars, and workflow around Gmail MCP Server in Conare so Claude Code, Codex, and Cursor remember it next time.
Need the legacy visual installer? Open Conare IDE.