u/CodeCoffeeCocktails

I built a self-hosted Gmail MCP for multiple accounts in Claude and Codex
▲ 10 r/mcp

I built a self-hosted Gmail MCP for multiple accounts in Claude and Codex

I'm the maintainer. I built this to use my personal and work Gmail accounts from Claude and Codex while choosing the mailbox explicitly for every operation.

Repo: https://github.com/alexneamtu/gmail-mcp (MIT)

It exposes one Streamable HTTP endpoint with:

  • Account aliases such as personal and work, required on every tool.
  • Gmail search, message reading, label lookup, and plain-text draft creation.
  • Optional sending of existing drafts and applying/removing labels.
  • Owner-only Google login, OAuth with PKCE, and encrypted credential storage.

You host your own instance and use your own Google OAuth project. The documented setup uses Node 24, Linux/systemd, and Cloudflare Tunnel for HTTPS. Mailbox enrollment uses a browser plus SSH forwarding when the server is headless. The README covers Claude and Codex setup, re-authentication, revocation, updates, and rollback.

A couple of limits: Google's compose scope includes sending permission even though drafts mode omits the send tool. In full mode, approval to send is handled by your assistant client; there isn't a separate server-side approval screen for each email.

This is an early release that I'm running for my own accounts. I'd appreciate feedback on the installation process, especially from people connecting accounts across different Workspace domains.

u/CodeCoffeeCocktails — 7 days ago