gmail-invoice-mcp
Allows searching Gmail messages with attachments, listing attachments on a message, downloading individual attachments, and bulk-saving attachments matching a query into a specified folder.
Click on "Deploy 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-invoice-mcpsave every PDF invoice from June into my bookkeeping folder"
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-invoice-mcp
An MCP server that pulls invoice and receipt attachments out of Gmail and drops them straight into an accounting folder.
The problem
Bookkeeping for a small company means opening dozens of emails a month, downloading a PDF from each one, renaming it, and filing it. The standard Gmail integrations for AI assistants can read a message, but none of them can hand you the attachment — so the one step that actually takes time stays manual.
Related MCP server: Gmail AutoAuth MCP Server
What it does
Four tools, exposed over the Model Context Protocol, so an assistant can do the whole fetch-and-file pass in one instruction:
Tool | What it does |
| Finds messages matching a Gmail query that carry attachments |
| Lists the attachments on one message with names, types and sizes |
| Downloads a single attachment, optionally straight to a path |
| Bulk-saves every attachment matching a query into one folder |
A month of supplier invoices is then a single request: "save every PDF from these five senders since 1 June into the bookkeeping folder".
Stack
Python · MCP FastMCP · Gmail API · Google OAuth 2.0 (read-only scope, token cached locally)
Result
Collecting one month of supplier invoices for a Norwegian AS went from an hour of manual downloading to a single instruction. It has been running in production bookkeeping since early 2026.
Setup
Create a Google Cloud project, enable the Gmail API, and configure an OAuth consent screen.
Download the OAuth client credentials as
credentials.json.Install dependencies:
pip install -r requirements.txtPoint the server at your credentials and register it with your MCP client:
{ "mcpServers": { "gmail-invoice": { "command": "python", "args": ["src/server.py"], "env": { "GMAIL_CREDENTIALS_PATH": "/path/to/credentials.json", "GMAIL_TOKEN_PATH": "/path/to/token.json" } } } }
On first run the server opens a browser for authorization and caches the token at
GMAIL_TOKEN_PATH. The scope is gmail.readonly — the server can read and download,
never send or delete.
Security
credentials.json and token.json are secrets. They are excluded in .gitignore
and must never be committed.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Capture receipts, scan Gmail, analyze spending, and create reviewed reports from AI assistants.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Capture and organize receipts from your AI chat: totals, categories, ledgers.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Gmail accounts through IMAP/SMTP, supporting reading, sending, replying to emails, managing threads, downloading attachments, and searching with Gmail syntax using simple app password authentication.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with automatic OAuth2 authentication.117 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Gmail accounts for reading unread emails, creating draft replies with proper threading, and managing messages, with optional professional writing guidelines, templates, and Google Docs/Calendar integration.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail accounts through natural language for tasks like sending, reading, searching, and organizing emails. It supports advanced features including draft management, label operations, and batch actions via secure OAuth 2.0 authentication.MIT