Skip to main content
Glama
paultrusov

gmail-mcp

by paultrusov

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

list_emails

Search the inbox with full Gmail search syntax (from:, newer_than:, has:attachment, …), with a maxResults cap

get_email

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 auth opens 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) and token.json (tokens) are gitignored; the code loads them from disk at startup.

Setup

  1. In Google Cloud Console, create a project, enable the Gmail API, and create an OAuth client of type Desktop app. Download it as credentials.json into this folder. While the consent screen is in Testing mode, add your address under Audience → Test users.

  2. Install and authenticate:

    npm install
    npm run auth   # opens browser, writes token.json
  3. Register with Claude Code (user scope makes it available in every session):

    claude mcp add gmail -s user -- node /absolute/path/to/gmail-mcp/index.js

    Verify 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; writes token.json

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A 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.
    Last updated
    1
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Read-only MCP server for Gmail that enables searching threads, reading messages, and listing labels without any write access.
    Last updated
    152
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    MCP server for Gmail that enables searching, reading, archiving, and managing email from any MCP client.
    Last updated
    28
    1
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    A local MCP server that provides Gmail tools (search, read, send, draft, label management) while keeping your emails only between your machine and Google, with no third-party access.
    Last updated
    MIT

View all related MCP servers

Related MCP Connectors

  • Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.

  • Read-only MCP server for Robinhood Chain token discovery, research, and due diligence via GMGN.

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

View all MCP Connectors

Latest Blog Posts

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/paultrusov/gmail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server