MCP.so
Sign In

Gmail Attachment MCP Server

@gnmahanth

About Gmail Attachment MCP Server

mcp server for downloading attachments from gmail using imap

Basic information

Category

Communication

License

MIT license

Runtime

python

Transports

stdio

Publisher

gnmahanth

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "gmail-attachment-mcp-server": {
      "command": "uv",
      "args": [
        "sync"
      ]
    }
  }
}

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is Gmail Attachment MCP Server?

Gmail Attachment MCP Server is a FastMCP server that downloads attachments from Gmail messages using the Message Control Protocol (MCP). It connects to Gmail via IMAP over SSL and requires a Gmail account with IMAP enabled and an App Password if 2‑Step Verification is active. It is intended for developers or automation workflows that need to programmatically retrieve email attachments.

How to use Gmail Attachment MCP Server?

Set environment variables GMAIL_USERNAME, GMAIL_PASSWORD, and optionally GMAIL_IMAP_SERVER (defaults to imap.gmail.com). Install dependencies with uv sync, then start the server with python server.py or mcp run server.py. Invoke the download_attachments_tool() with a hexadecimal message ID and an optional download folder (defaults to ./attachments).

Key features of Gmail Attachment MCP Server

  • Download Gmail attachments using a message ID
  • Secure connection via IMAP over SSL
  • Configuration through environment variables
  • Simple API exposed as an MCP tool
  • Works with MCP Inspector and Goose

Use cases of Gmail Attachment MCP Server

  • Automatically save attachments from specific emails in a workflow
  • Retrieve invoices or documents from Gmail programmatically
  • Integrate email attachment downloading into an MCP‑based toolchain

FAQ from Gmail Attachment MCP Server

What are the prerequisites?

Python 3.7 or higher, uv installed, a Gmail account with IMAP enabled, and an App Password if 2‑Step Verification is enabled.

How do I configure Gmail credentials?

Set GMAIL_USERNAME (your full Gmail address) and GMAIL_PASSWORD (your App Password). The IMAP server defaults to imap.gmail.com and can be overridden with GMAIL_IMAP_SERVER.

What transport does the server use?

The server communicates over stdio, as shown in the MCP Inspector and Goose configuration examples.

What is the default download folder?

Attachments are saved to ./attachments unless the download_folder parameter is specified.

Can I use my regular Gmail password?

No. For Gmail accounts with 2‑Step Verification, you must generate and use an App Password. See Google’s documentation for instructions.

Comments

More Communication MCP servers