gmail-attachments-mcp
Provides tools for searching Gmail messages, listing and downloading attachments, creating drafts with file attachments, and applying labels.
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-attachments-mcpfind my most recent email with an attachment and download it"
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-attachments-mcp
An MCP server that gives Claude the two Gmail capabilities most built-in Gmail connectors lack: downloading attachments and creating drafts with file attachments.
Runs locally. Talks only to your own mailbox. Cannot send email.
Why this exists
Most hosted Gmail integrations are metadata-only. They can tell you an email has a PDF attached; they cannot hand you the PDF, and they cannot attach a file to a draft. That makes a large class of ordinary work impossible: reading an invoice someone emailed you, or replying to a request with a document attached.
This server closes that gap and nothing else.
Related MCP server: Gmail MCP Server
Tools
Tool | What it does |
| Search with Gmail query syntax; returns messages plus attachment metadata |
| List every attachment on one message (filename, mimeType, size, attachmentId) |
| Save one attachment, or all of them, to a local folder |
| Create a draft with file attachments. Saved, never sent. |
| Add or remove labels on a message. Creates missing labels, including nested names. |
One gotcha worth knowing
Gmail does not guarantee that attachmentId values stay stable across separate
API calls. The same attachment can report a different id seconds later. Always
pass filename to gmail_download_attachment rather than attachmentId. The
tool re-resolves the id internally.
Install
Requires Node.js 18 or later.
git clone https://github.com/grtelfer/gmail-attachments-mcp.git
cd gmail-attachments-mcp
./install.shThe installer checks prerequisites, installs dependencies, builds, registers the server with Claude Code, and walks you through authorization.
You need your own Google OAuth client first. See SETUP-GOOGLE-CLOUD.md. It works with a personal @gmail.com account; Google Workspace is not required. Budget ten minutes, once.
The one thing people get wrong: if you leave the OAuth consent screen in Testing status, Google expires your refresh token every seven days and the server silently stops working. Publishing the app removes the expiry and takes one click. Step 5 of the setup guide covers it.
Manual install
If you would rather not run the script:
npm install
npm run build
claude mcp add gmail --scope user -- node "$PWD/dist/index.js"
npm run authThen restart Claude Code. Tools appear as mcp__gmail__*.
Registering the server under the name gmail is what produces the mcp__gmail__
prefix. Pick a different name if you prefer, but any skills referring to these
tools will need updating to match.
Verify it works
Restart Claude Code, then ask:
find my most recent email with an attachment and download it
Configuration
Variable | Effect |
| Supply OAuth credentials via environment instead of |
| Namespace the stored token, so you can authorize multiple Google accounts side by side. Alphanumeric, hyphens, and underscores only. |
| Overrides where the token is stored. Defaults to |
Security
Never commit
credentials.jsonortoken.json. Both are in.gitignore.The token file is written with mode 0600 and holds only a refresh token.
Scopes are
gmail.modifyandgmail.compose. There is no send scope, so the server cannot send mail on your behalf. Drafts wait for you.Everything runs on your machine. No data leaves it except calls to Google's own API.
To revoke access at any time, go to https://myaccount.google.com/permissions and remove the app.
Optional: the Claude skill
SKILL.md is an Agent Skill
that teaches Claude the common workflows: reading an attachment somebody sent
you, and replying with a file attached. Copy it into ~/.claude/skills/gmail-attachments/
to install it, or ignore it and use the tools directly.
License
MIT. See LICENSE.
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.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server for Gmail that allows AI assistants to read, search, compose drafts, send emails, and manage labels with attachment support.Last updatedMIT
- Alicense-qualityDmaintenanceA custom MCP server for sending and managing Gmail emails, supporting both App Password and OAuth2 authentication with features like template emails and label listing.Last updated200MIT
- Alicense-qualityCmaintenanceAn MCP server that provides read, label, and draft access to multiple Gmail accounts from a single server, never sending email.Last updated83MIT
- Flicense-qualityDmaintenanceA Gmail MCP server providing 19 tools for email operations, label and filter management, and attachment handling via the Gmail API.Last updated
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Gmail MCP Pack
MCP server for generating rough-draft project plans from natural-language prompts.
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/grtelfer/gmail-attachments-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server