gmail-mcp
gmail-mcp
Exposes the Gmail tab open in your browser as MCP tools — no Gmail API, no OAuth. A browser extension reads the inbox with InboxSDK and acts on it by simulating the Gmail UI; a local bridge relays commands from any MCP client (e.g. Claude Code) to that tab.
MCP client (Claude)
│ stdio
server/mcp.js one per client session, forwards over HTTP
│ POST /<command> (Hono, port 8766)
server/bridge.js single daemon
│ WebSocket (port 8765)
extension MV3, background ws client + content script
│ InboxSDK / DOM
Gmail tabTools
Tool | What it does |
| Lists the thread rows currently rendered (subject, contacts, date, |
| Archives a visible thread (row checkbox + toolbar button) |
| Applies an existing label to a visible thread (row context menu) |
Setup
Extension:
cd extension && npm install && npm run build, then loadextension/dist/viachrome://extensions→ Developer mode → Load unpacked. Open (or reload) Gmail.Bridge:
cd server && npm install && npm run bridge— keep it running.MCP:
claude mcp add gmail-mcp -- node <repo>/server/mcp.js, then start a new session.
Test without an MCP client:
curl -X POST localhost:8766/list_visible_emails
curl -X POST localhost:8766/archive_thread -d '{"thread_id":"..."}'Limitations
The Gmail tab must be open; only currently-rendered rows are visible to the tools.
Actions simulate the UI: stable attributes are preferred (
act="7", roles), butlabel_threadmatches menu text and assumes an English Gmail UI. A Gmail redesign can break actions — the durable alternative is the official Gmail API.The bridge listens on localhost without auth; anything local can drive your Gmail tab. Don't expose the ports.
InboxSDK telemetry is disabled (
eventTracking/globalErrorLoggingoff).
Development
npm run lint / npm run format (Biome, 80 cols) from the repo
root. New extension feature = one file in extension/src/features/ +
one line in extension/src/content.js + a tool in server/mcp.js.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/elvisoliveira/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server