send_emailLABSCO SUMMARY
Inbox work that would take an afternoon, done in one instruction.
The batch and filter tools are what separate it from a send-and-read integration: fifty messages relabelled in one call, or a rule created once so the same class of mail never reaches the inbox again.
What it is
A Gmail integration with an OAuth flow that launches your browser and stores the result globally, so authentication is done once and works from any directory afterwards.
What you get
- Sending:
send_emailanddraft_email, both taking plain text, HTML or multipart bodies and anattachmentsarray of local file paths, with full support for international characters in subject and body - Reading:
read_emailwith MIME structure handling, showing each attachment's filename, type, size and download ID;download_attachmentthen writes it to a path you choose search_emailsusing Gmail's own operators —from:,to:,subject:,has:attachment,after:,before:,is:andlabel:, combinable- Organising:
modify_emailto add and remove labels,delete_email, and the label suitelist_email_labels,create_label,update_label,delete_labelandget_or_create_label - Batches:
batch_modify_emailsandbatch_delete_emailsprocess up to 50 messages at a time with automatic chunking, per-item success reporting and individual retries when a batch item fails - Filters:
create_filter,list_filters,get_filter,delete_filter, andcreate_filter_from_templatewith prebuilt templates forfromSender,withSubject,withAttachments,largeEmails,containingTextandmailingList
Requirements
A Google Cloud project with the Gmail API enabled and OAuth 2.0 credentials — Desktop app or Web application both work; for Web, add http://localhost:3000/oauth2callback to the authorized redirect URIs. Rename the downloaded key file to gcp-oauth.keys.json, put it in ~/.gmail-mcp/, and run npx @gongrzhe/server-gmail-autoauth-mcp auth, which opens your browser and saves credentials.json next to it. Then point the client at npx @gongrzhe/server-gmail-autoauth-mcp. Port 3000 must be free during authentication. A Docker image is available, and a custom callback URL can be passed to auth for cloud environments where localhost is not reachable. Gmail's own limit of 25MB per email applies to attachments.
Setup effort
Follow the published steps — In the Google Cloud Console, create a project (or select an existing one) and enable the Gmail API for it.
USE CASES
Sending something with files attached
Pass local file paths in the attachments array; MIME types and sizes are detected, and the message is assembled as a proper RFC822 multipart.
Getting an attachment out of an email
Read the message to see each attachment's filename, type, size and download ID, then download the one you want to a chosen directory.
Clearing a backlog
Search with Gmail operators, then relabel or delete the results in batches of up to 50, with per-item reporting so a partial failure is visible.
Making sure it does not pile up again
Create a filter from a template — sender, subject text, attachments, size, content or mailing list — so the same mail is handled before you see it.
Reorganising your labels
List what exists, create or rename labels with their visibility settings, and use get-or-create so a workflow does not fail because the label was not there yet.
19 tools
Listed in project docs. Your client may show a different list.
draft_emailread_emaildownload_attachmentsearch_emailsmodify_emaildelete_emaillist_email_labelscreate_labelupdate_labeldelete_labelget_or_create_labelbatch_modify_emailsbatch_delete_emailscreate_filterlist_filtersget_filterdelete_filtercreate_filter_from_templateBEFORE YOU INSTALL
What to know first
Tools you get
19 tools named in the project's documentation.
Requires
- npx on PATH
- gcp-oauth.keys.json — an OAuth client key file from your own Google Cloud project with the Gmail API enabled
- Port 3000 free during authentication
INSTALLATION
Connect your client
Server setup
In the Google Cloud Console, create a project (or select an existing one) and enable the Gmail API for it.
Under APIs & Services > Credentials, create an OAuth client ID of type Desktop app or Web application. For a Web application, add http://localhost:3000/oauth2callback to the authorized redirect URIs.
Download the JSON file of the client's OAuth keys and rename it to gcp-oauth.keys.json.
MCP Clients
Claude Desktop
mkdir -p ~/.gmail-mcp
mv gcp-oauth.keys.json ~/.gmail-mcp/
npx @gongrzhe/server-gmail-autoauth-mcp authThe auth command opens your browser for Google sign-in (port 3000 must be free) and saves ~/.gmail-mcp/credentials.json. Then add this to Claude Desktop:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": [
"@gongrzhe/server-gmail-autoauth-mcp"
]
}
}
}Claude Desktop — Docker
Authenticate once with the image (<YOUR_PATH_TO_GCP_OAUTH_KEYS> is where your key file is):
docker run -i --rm --mount type=bind,source=<YOUR_PATH_TO_GCP_OAUTH_KEYS>,target=/gcp-oauth.keys.json -v mcp-gmail:/gmail-server -e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json -e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" -p 3000:3000 mcp/gmail authThen add this to Claude Desktop:
{
"mcpServers": {
"gmail": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"mcp-gmail:/gmail-server",
"-e",
"GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json",
"mcp/gmail"
]
}
}
}