Skip to main content
Glama
SfdcAnnu

Gmail MCP Server

by SfdcAnnu

Gmail MCP Server

Public Gmail MCP server — Streamable HTTP + OAuth 2.1, same architecture as the Salesforce and Outlook MCP Servers. One deployed URL works with:

  • Archon AI portal (Managed MCP via Anthropic / OpenAI)

  • Claude.ai custom connectors

  • ChatGPT custom MCP

  • Any standalone MCP client (n8n, Cursor, custom apps) via the PATH B flow

Tools (11)

Tool

Kind

Description

getProfile

read

Connected Gmail account (email, message counts)

listEmails

read

List messages by label, filters: unread, sender

readEmail

read

Full body (text + HTML) of one message

searchEmails

read

Gmail-syntax search across all mail

listLabels

read

All labels (Gmail's folders)

getAttachments

read

Attachment names/types/sizes

sendEmail

write

Send a new email

replyEmail

write

In-thread reply / reply-all (proper threading headers)

createDraft

write

Draft without sending

moveEmail

write

Archive / trash / apply label

markEmail

write

Read/unread + star

Related MCP server: Gmail MCP Server

Setup

1. Google Cloud OAuth client (one-time)

  1. https://console.cloud.google.com → create/select a project

  2. APIs & Services → Library → enable Gmail API

  3. OAuth consent screen → External → add scope https://www.googleapis.com/auth/gmail.modify (+ openid, email, profile). While the app is in Testing status, add your Gmail address under Test users — otherwise login fails with access_denied.

  4. Credentials → Create credentials → OAuth client ID → Web application Authorized redirect URIs:

    • https://claude.ai/api/mcp/auth_callback (Claude connector)

    • <BASE_URL>/auth/callback (PATH B standalone)

2. Run

cp .env.example .env      # fill in GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET / BASE_URL
npm install
npm run dev               # http://localhost:3200

3. Deploy (Render)

  • Build command: npm install

  • Start command: npm start

  • Env vars: BASE_URL (the Render URL), GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI=<BASE_URL>/auth/callback

  • After deploy, add <BASE_URL>/auth/callback to the Google OAuth client's redirect URIs.

Auth paths

PATH A — Bearer header (portals, Claude connector). The client sends Authorization: Bearer <google access token> on /mcp. Tokens acquired through this server's /token proxy get vaulted, enabling server-side refresh when Google returns 401 (Google access tokens live ~1 hour).

PATH B — session flow (standalone clients). Visit <BASE_URL>/auth?session=<id> → Google login → tokens stored server-side keyed by the stable Google account id.

The /authorize proxy forces access_type=offline&prompt=consent so Google actually issues a refresh token, and both proxies force the real Google client credentials so Dynamic Client Registration (Claude invents a random client id) still works — the only requirement is the client's redirect URI being whitelisted on the Google OAuth client.

Gmail-specific notes

  • Gmail message ids are opaque hex strings; always source them from listEmails/searchEmails in the same session.

  • Gmail has labels, not folders. moveEmail maps the familiar folder actions: archive = remove INBOX, trash = the dedicated trash endpoint.

  • replyEmail fetches the original's Message-ID/References headers and sends with threadId, so replies thread correctly in both Gmail and the recipient's client.

Related MCP Connectors

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…

  • Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.

  • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

Related MCP Servers

Appeared in Searches