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.

Run in 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-mcp
Required:GMAIL_MCP_CREDENTIALS_PATH+ 1 optional

Environment Variables

Set these before running Gmail MCP Server.

VariableDescriptionRequired
GMAIL_MCP_CREDENTIALS_PATHPath to OAuth credentials JSONYes
GMAIL_MCP_TOKEN_PATHPath to token cache fileNo

Available Tools (5)

Once configured, Gmail MCP Server gives your AI agent access to:

list_unreadList unread emails from inbox.
max_results
searchSearch emails using Gmail query syntax.
querymax_results
archiveArchive emails by removing INBOX and UNREAD labels.
message_ids
mark_as_readMark emails as read without archiving.
message_ids
get_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.
Remember this setup