Gmail MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "OAUTH_TOKEN=${OAUTH_TOKEN}" gmail-mcp-80e0 -- uv run src/main.py
Required:OAUTH_TOKEN
README.md

A Model Context Protocol server that enables full management of Gmail accounts.

gmail-mcp

A Gmail MCP server using OAuth2 bearer token auth via the Dedalus MCP framework.

Tools

Messages

  • gmail_list_messages - List messages with search queries
  • gmail_get_message - Get a specific message by ID
  • gmail_send_message - Send an email
  • gmail_trash_message - Move message to trash
  • gmail_untrash_message - Remove message from trash
  • gmail_modify_message - Add/remove labels on a message

Threads

  • gmail_list_threads - List email threads (conversations)
  • gmail_get_thread - Get a thread with all messages
  • gmail_trash_thread - Move thread to trash

Labels

  • gmail_list_labels - List all labels
  • gmail_get_label - Get label details
  • gmail_create_label - Create a new label
  • gmail_delete_label - Delete a user label

Drafts

  • gmail_list_drafts - List draft emails
  • gmail_get_draft - Get a draft by ID
  • gmail_create_draft - Create a draft
  • gmail_send_draft - Send a draft
  • gmail_delete_draft - Delete a draft

Profile

  • gmail_get_profile - Get user's Gmail profile

Authentication

Gmail API requires OAuth2. The access token is provided at runtime via Dedalus credential exchange.

Required OAuth scopes (depending on operations):

  • https://www.googleapis.com/auth/gmail.readonly - Read-only access
  • https://www.googleapis.com/auth/gmail.send - Send emails
  • https://www.googleapis.com/auth/gmail.modify - Modify messages/labels
  • https://www.googleapis.com/auth/gmail.compose - Create drafts

Local Development

cd gmail-mcp
uv sync
uv run python src/main.py

API Reference

Tools (7)

gmail_list_messagesList messages with search queries
gmail_get_messageGet a specific message by ID
gmail_send_messageSend an email
gmail_list_threadsList email threads (conversations)
gmail_get_threadGet a thread with all messages
gmail_create_draftCreate a draft
gmail_send_draftSend a draft

Environment Variables

OAUTH_TOKENrequiredOAuth2 access token provided via Dedalus credential exchange

Configuration

claude_desktop_config.json
{"mcpServers": {"gmail": {"command": "uv", "args": ["run", "src/main.py"], "cwd": "/path/to/gmail-mcp"}}}

Try it

List my unread messages from the last 24 hours.
Find the email thread regarding the project proposal and summarize the latest message.
Draft a reply to the last email in my inbox thanking them for the update.
Create a new label called 'Urgent' and move the latest message into it.

Frequently Asked Questions

What are the key features of Gmail MCP?

Full management of Gmail messages, threads, labels, and drafts. Search functionality for messages and threads. Secure OAuth2 authentication via Dedalus framework. Ability to send emails and manage draft compositions.

What can I use Gmail MCP for?

Automating email triage by organizing messages into specific labels. Drafting and sending routine email responses directly from the AI interface. Quickly searching and summarizing long email conversation threads. Managing inbox clutter by moving messages to trash via AI commands.

How do I install Gmail MCP?

Install Gmail MCP by running: cd gmail-mcp && uv sync && uv run python src/main.py

What MCP clients work with Gmail MCP?

Gmail MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Gmail MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare