gmail-mcp
Provides read-only access to a Gmail inbox, allowing search using Gmail search syntax and retrieval of full email messages.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gmail-mcp
A read-only Gmail MCP server, built from scratch on the MCP SDK — no third-party Gmail MCP packages. Lets Claude Code (or any MCP client) search and read a Gmail inbox without ever being able to send, delete, or modify anything.
Tools
Tool | What it does |
| Search the inbox with full Gmail search syntax ( |
| Fetch a single message by id: headers plus the full plain-text body |
Related MCP server: Gmail MCP Server
Design notes
Read-only by construction. The OAuth scope is
gmail.readonly— the token Google issues cannot send or delete mail even if the server were compromised.Google OAuth 2.0 Desktop-app flow. A one-time
npm run authopens a browser for consent, then stores a refresh token locally. The server auto-refreshes access tokens and persists them back to disk, so auth survives restarts.Secrets stay out of the repo.
credentials.json(OAuth client) andtoken.json(tokens) are gitignored; the code loads them from disk at startup.
Setup
In Google Cloud Console, create a project, enable the Gmail API, and create an OAuth client of type Desktop app. Download it as
credentials.jsoninto this folder. While the consent screen is in Testing mode, add your address under Audience → Test users.Install and authenticate:
npm install npm run auth # opens browser, writes token.jsonRegister with Claude Code (user scope makes it available in every session):
claude mcp add gmail -s user -- node /absolute/path/to/gmail-mcp/index.jsVerify with
claude mcp list— the server should show as Connected.
Files
index.js— the MCP server (tool definitions, Gmail API calls, token refresh persistence)auth.js— one-time OAuth consent flow; writestoken.json
This server cannot be deployed
Maintenance
Related MCP Connectors
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Your IMAP mailbox as an MCP server: read, search and (if you allow it) organize mail. Open source.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Your mailbox for MCP clients: search, read, draft, send, rules and notes. Sending is off by default.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server that enables users to interact with the Gmail API to search messages, retrieve threads, and download attachments. It supports standard Gmail query operators and requires OAuth authentication for secure read-only access to mailbox data.1MIT
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for Gmail that enables searching threads, reading messages, and listing labels without any write access.208 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Gmail that enables searching, reading, archiving, and managing email from any MCP client.46 npm1MIT
- AlicenseAqualityBmaintenanceAn MCP server that reads across all your Gmail accounts from one connection, enabling searching, drafting, labeling, and filtering emails without sending.1772 PyPI6MIT