Gmail MCP Server
Provides tools to manage Gmail: list, read, search, send, reply, draft, archive, trash, labels, and attachments.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gmail MCP Serverlist my unread emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gmail MCP Server
An MCP (Model Context Protocol) server that provides Claude with access to your Gmail, featuring a full OAuth 2.1 authorization server with dynamic client registration.
Features
Full OAuth 2.1 Authorization Server (RFC 8414, RFC 7591, RFC 9728)
Dynamic Client Registration - Claude Code auto-registers
PKCE Support (RFC 7636)
First-class "Authenticate" button in Claude Code's
/mcpmenuGmail tools: list, read, search, send, reply, draft, archive, trash, labels, attachments
Related MCP server: mcp-gmail
Prerequisites
Node.js 18+ is required. Install via nodejs.org or:
brew install nodeSetup
Clone and install dependencies:
git clone <repo-url> gmail-mcp cd gmail-mcp npm installBuild:
npm run buildStart the server:
npm startThe server runs on
http://localhost:3100by default. Override withPORT=3200 npm start.Configure Claude Code (
~/.mcp.json):{ "mcpServers": { "gmail": { "type": "sse", "url": "http://localhost:3100/sse" } } }Authenticate via Claude Code:
Run
/mcpin Claude CodeClick "Authenticate" on the gmail server
Complete Google OAuth in your browser
Note: Google will show an "This app isn't verified" warning screen. This is normal for apps that haven't gone through Google's verification process. To proceed:
Click Advanced
Click Go to gmail-mcp (unsafe)
Review the requested permissions (read and modify Gmail) and click Allow
Your credentials are stored locally on your machine and are never sent to any third-party server.
Configuration
Google OAuth credentials are built in — no setup required. On first use, you'll be prompted to authorize your Gmail through Google's consent screen.
User-specific config files are stored in ~/.config/gmail-mcp/:
File | Description |
| Optional — Override the built-in Google OAuth credentials with your own |
| Your Google OAuth tokens (auto-generated after authorization) |
| Registered MCP clients (auto-generated) |
| Issued access tokens (auto-generated) |
Auto-Start on Login (macOS)
Run the install script to set up the LaunchAgent:
./scripts/install.shThis will:
Detect your node installation
Generate a plist with correct paths
Install to
~/Library/LaunchAgents/Start the server immediately
To uninstall:
./scripts/uninstall.shLogs are written to ~/.config/gmail-mcp/stdout.log and stderr.log.
Available Tools
Tool | Description |
| List emails from inbox with optional filters |
| Read full email content by ID |
| Search using Gmail query syntax |
| Compose and send a new email |
| Reply to an existing email |
| Create a draft without sending |
| Mark an email as read |
| Mark an email as unread |
| Archive an email (remove from inbox) |
| Move an email to trash |
| Add a label to an email |
| Remove a label from an email |
| List all Gmail labels |
| Get all emails in a conversation |
| Download an email attachment |
Gmail Search Syntax
The search_emails and list_emails tools support Gmail's query syntax:
is:unread- Unread emailsfrom:someone@example.com- From specific sendersubject:invoice- Subject contains "invoice"has:attachment- Has attachmentsafter:2025/01/01- After a datebefore:2025/12/31- Before a datelabel:important- Has specific label
Architecture
┌─────────────────┐ ┌──────────────────────────────────────┐
│ Claude Code │◄────►│ Gmail MCP Server │
│ │ SSE │ │
│ /mcp menu │ │ ┌─────────────────────────────────┐ │
│ shows │ │ │ OAuth 2.1 Authorization Server │ │
│ "Authenticate" │ │ │ - Dynamic client registration │ │
│ │ │ │ - PKCE support │ │
└─────────────────┘ │ │ - Token management │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────▼──────────────────┐ │
│ │ Google OAuth Proxy │ │
│ │ - Redirects to Google │ │
│ │ - Stores Google tokens │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────▼──────────────────┐ │
│ │ Gmail API Tools │ │
│ │ - list, read, search, etc. │ │
│ └─────────────────────────────────┘ │
└──────────────────────────────────────┘Development
npm run build # Compile TypeScript
npm start # Run server
npm run auth # Standalone Google OAuth (alternative to browser flow)Endpoints
Endpoint | Description |
| Health check & status |
| RFC 9728 metadata |
| RFC 8414 metadata |
| Dynamic client registration |
| Authorization endpoint |
| Token endpoint |
| MCP SSE endpoint (protected) |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jsflax/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server