gmail-mcp
Provides read-only access to Gmail, allowing search of threads, reading messages, and listing labels across multiple authorized accounts.
Click on "Install 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-mcpsearch for recent emails about project update"
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-mcp
A read-only, multi-account Gmail MCP server for Claude Code. Lets Claude search threads, read messages, and list labels across one or more Gmail accounts you've authorized, over stdio.
Tools
Tool | Description |
| Search Gmail threads using standard Gmail query syntax (e.g. |
| Fetch the full body and headers of a message by ID. |
| List Gmail labels for one or all connected accounts. |
| List all Gmail accounts that currently have an authorized token saved. |
All access is read-only (gmail.readonly scope) — this server cannot send, delete, or modify anything in Gmail.
Related MCP server: mcp-gmail
Setup
1. Install dependencies
npm install2. Get OAuth credentials
Create (or reuse) a project in the Google Cloud Console.
Enable the Gmail API.
Create an OAuth client ID of type Desktop app.
Download the credentials and save them as
credentials.jsonin the project root.
credentials.json and everything under tokens/ are gitignored — never commit them.
3. Authorize one or more Gmail accounts
npm run build
npm run auth -- youraccount@gmail.comThis opens a Google consent screen in your browser and, on approval, saves the resulting token to tokens/youraccount@gmail.com.json. Repeat for each account you want Claude to have access to.
4. Register the server with Claude Code
Point Claude Code at the built server, e.g. in your MCP config:
{
"mcpServers": {
"gmail": {
"command": "node",
"args": ["<path-to-repo>/dist/index.js"]
}
}
}Development
npm run build # compile TypeScript to dist/
npm start # run the compiled serverProject structure
src/
auth.ts # one-off OAuth flow: authorizes an account and saves its token
index.ts # MCP server: exposes search_threads, get_message, list_labels, list_accountsTokens are stored per account in tokens/<email>.json and are loaded on demand from TOKENS_DIR at request time, so accounts can be added or removed without restarting the server.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/VarunDasharadhi/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server