claude-gmail-mcp
Allows sending, searching, and reading Gmail messages through the Gmail API or SMTP/IMAP.
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., "@claude-gmail-mcpSend an email to mom@example.com saying I'll be late"
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.
claude-gmail-mcp
A super tiny Gmail MCP server for Claude Code. Lets Claude send, search, and read Gmail on your behalf.
Two backends are supported and auto-selected at startup:
Gmail API (OAuth) — recommended. No app password. Batch search. Direct Gmail web URLs on every result.
SMTP/IMAP (app password) — simpler setup. Fallback when the OAuth token isn't present.
I needed something for my projects — there were a bunch around which seemed super complicated. So why not have Claude CLI build one for me :-p
Prerequisites
uv installed
One of:
A Google Cloud OAuth client (Desktop app) — for the API backend, OR
A Gmail App Password — for the SMTP/IMAP backend
Related MCP server: gmail-mcp
Install (Gmail API backend — recommended)
In Google Cloud Console, create a project, enable the Gmail API, and configure the OAuth consent screen (External, add your Gmail as a test user). Create an OAuth client of type Desktop app and download the credentials JSON.
Run the auth helper, pointing at the downloaded file:
uvx --from claude-gmail-mcp claude-gmail-mcp-auth /path/to/credentials.jsonBrowser opens → sign in → approve (scope:
gmail.modify). Refresh token is saved to~/.config/claude-gmail-mcp/token.json(perms600).Register the MCP server with Claude Code (no env vars needed):
claude mcp add gmail --scope user -- uvx claude-gmail-mcp
Install (SMTP/IMAP backend — fallback)
claude mcp add gmail --scope user \
-e GMAIL_ADDRESS=you@gmail.com \
-e GMAIL_APP_PASSWORD=your-app-password \
-- uvx claude-gmail-mcpReplace you@gmail.com and your-app-password with your actual credentials. Drop --scope user to install only for the current project directory.
Verify
claude mcp listYou should see gmail listed as a configured server. To see which backend is active, run:
uvx claude-gmail-mcp 2>&1 | head -1Expected: [gmail-mcp] backend=api or [gmail-mcp] backend=imap. Ctrl-C to exit.
Backend selection
At startup the server picks exactly one backend:
Token file at
GMAIL_TOKEN_PATH(default~/.config/claude-gmail-mcp/token.json) exists → API backend.Else
GMAIL_ADDRESS+GMAIL_APP_PASSWORDenv vars set → IMAP backend.Else tools return a "no backend configured" error.
To force a switch to the IMAP backend when a token file exists, set GMAIL_TOKEN_PATH to a non-existent path (or delete the token file).
Usage
Ask Claude to send an email:
Send an email to alice@example.com with subject "Hello" and body "Hi from Claude!"
Tools exposed:
send_email—to,subject,body, optionalcc/bcc,html,attachments(local file paths; unreadable files are skipped with a warning).search_emails—queries(single string or list of strings),max_results(per query when a list is passed). Results include the Gmail message ID in hex and a direct Gmail web URL per hit.read_email—uid(the hex ID fromsearch_emails). Output includes the Gmail web URL at the top.
Batch search example:
Search Gmail for "is:unread from:alice" and "is:unread from:bob" — show me both side by side.
Claude passes both queries in a single tool call. The response is sectioned per query. API backend executes the list step in one HTTP roundtrip; IMAP backend iterates.
Attachment example:
Send an email to alice@example.com with subject "Report" and attach ~/Documents/report.pdf
Publishing to PyPI
python -m build && twine upload dist/*For Development
git clone https://github.com/pliablepixels/claude-gmail-mcp.git
cd claude-gmail-mcp
uv sync
uv run pytestRun the server locally:
uv run claude-gmail-mcpTest with Claude Code using your local copy instead of the published package:
claude mcp add gmail --scope user \
-- uv run --directory /path/to/claude-gmail-mcp claude-gmail-mcp(For the IMAP backend add -e GMAIL_ADDRESS=... -e GMAIL_APP_PASSWORD=....)
Available Tools
3 toolsread_emailA
Fetch the full content of an email by its UID (from search_emails results).
Args: uid: Email UID shown in search_emails output
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and description does not mention any behavioral traits such as side effects (e.g., marking as read), auth requirements, rate limits, or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two sentences), front-loaded with purpose, and uses a clear docstring-style format for the parameter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool is simple (single required param) and an output schema exists (assumed), the description covers the essential logic, though it lacks details on error states or behavior for invalid UIDs.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description adds meaning by explaining that the uid comes from search_emails output, which goes beyond the schema's name and type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Fetch' and the resource 'full content of an email', and distinguishes from siblings by specifying the UID comes from search_emails results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (after search_emails) but does not explicitly exclude other scenarios or mention alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_emailsA
Search Gmail using full Gmail search syntax (from:, subject:, is:unread, etc).
Pass a single query string for a flat list of results, or a list of queries to run several searches in one call (output is sectioned by query, and max_results applies per query).
Returns UID, sender, subject, date, and a Gmail web URL for each match.
Args: queries: Single query string or list of query strings. max_results: Max emails to return per query (default 10).
| Name | Required | Description | Default |
|---|---|---|---|
| queries | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries full burden. It discloses that the tool returns UID, sender, subject, date, and a Gmail web URL. It explains how multiple queries behave (sectioned output, per-query limits). It does not mention rate limits or potential side effects, but for a search tool this is acceptable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is clear and well-structured, with a first sentence summarizing the tool's purpose, followed by usage modes and output details. The Args section is somewhat redundant with the schema but still helpful. Could be slightly more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (not shown but indicated), the description covers return fields adequately. It explains query syntax and output format. It lacks details on sorting or pagination beyond max_results, but for a search tool with two parameters it is adequately complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully explain parameters. It does so clearly: queries can be a string or array, max_results is an integer default 10 applied per query. This adds significant meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it searches Gmail using full Gmail search syntax, with a specific verb ('Search') and resource ('Gmail'). It distinguishes from sibling tools (read_email, send_email) as a search tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use a single query versus a list of queries, and mentions that max_results applies per query. It does not explicitly state when not to use it (e.g., for reading a specific email), but the sibling context implies alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_emailA
Send an email via Gmail.
Args: to: Recipient email address(es). subject: Email subject line. body: Email body content (plain text or HTML). cc: CC recipient(s), optional. bcc: BCC recipient(s), optional. html: If True, send body as HTML instead of plain text. attachments: List of local file paths to attach, optional. Files that cannot be read are skipped with a warning.
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| subject | Yes | ||
| body | Yes | ||
| cc | No | ||
| bcc | No | ||
| html | No | ||
| attachments | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions that unreadable attachment files are skipped with a warning, adding some behavior context, but lacks details on authentication, rate limits, or other side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with bullet points, no fluff, and front-loaded with the main action. Slightly more conciseness could be achieved, but overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 7 parameters and an output schema, the description covers all parameters and adds attachment usage details. It does not explain output, but the output schema exists.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% (only titles and types), so the description compensates by explaining each parameter's purpose, including the behavior for attachments.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Send' and the resource 'email via Gmail', which distinguishes it from siblings 'read_email' and 'search_emails'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for sending emails, but does not explicitly state when to use versus alternatives or provide exclusions. The context is clear given siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.2.0- First observed
read_email - First observed
search_emails - First observed
send_email
TDQS
Each tool has a clearly distinct purpose: reading, searching, and sending emails. There is no overlap in functionality, making it easy for an agent to select the correct tool.
All tools follow a consistent verb_noun pattern (read_email, search_emails, send_email), ensuring predictability and ease of use.
With only 3 tools, the set is minimal but covers the core email operations. While slightly under-scoped, it is still reasonable for a focused MCP server.
The tools cover essential read, search, and send operations, but lack common Gmail features like deleting, labeling, or managing drafts, which are notable gaps for a full email client.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseBqualityFmaintenanceMCP server that connects Claude with Gmail to read, send, delete, and manage messages and labels via the Google Gmail API.3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets Claude read, search, send, label, and manage your Gmail through OAuth2.MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that provides tool-level access to Gmail, allowing Claude to search, read, send, and manage emails using the Gmail API.1MIT
- AlicenseNot gradedqualityCmaintenanceA secure MCP server that enables Claude to read, search, send, reply, forward, and manage Gmail messages and labels through natural language commands.2151MIT
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/pliablepixels/claude-gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server