Skip to main content
Glama
Steph-ux

gmail-mcp

by Steph-ux

gmail-mcp v1.0.0

Einheitlicher Multi-Account-Google-OAuth2-MCP-Server für Gmail. Durchsuchen, lesen, verfassen, senden, entwerfen und organisieren Sie E-Mails nahtlos über mehrere Google-Konten hinweg.

Funktionen (4 vereinheitlichte Tools)

  • gmail_search: Durchsuchen Sie E-Mails mit der offiziellen Gmail-Such-Syntax (is:unread, from:boss@corp.com, subject:invoice, newer_than:2d, has:attachment)

  • gmail_read: Lesen Sie den vollständigen E-Mail-Inhalt und die Metadaten (Betreff, Absender, Textkörper, HTML, CC, BCC, Labels, Anhangsliste)

  • gmail_send: Senden Sie E-Mails oder erstellen Sie Entwürfe (unterstützt HTML, CC, BCC, Thread-Antworten und Dateianhänge)

  • gmail_manage: Beschriften, Archivieren, Papierkorb-Verwaltung, Gelesen/Ungelesen-Umschalter, dauerhaftes Löschen und Multi-Account-Übersicht

Related MCP server: Moist

Multi-Account-Architektur

Ein einzelner Google-Cloud-OAuth-Client (credentials.json) kann mehrere Gmail-Konten authentifizieren. Tokens werden pro Konto in ~/.secrets/gmail/tokens/<account_name>.json gespeichert.

1. Google-OAuth-Anmeldedaten einrichten (einmalig)

  1. Erstellen Sie ein Projekt in der Google Cloud Console.

  2. Aktivieren Sie die Gmail API.

  3. Erstellen Sie eine OAuth-2.0-Client-ID (Desktop-Anwendung).

  4. Laden Sie die JSON-Datei mit dem Client-Secret herunter und speichern Sie sie als ~/.secrets/gmail/credentials.json (oder setzen Sie GMAIL_CREDENTIALS_JSON).

2. Konten authentifizieren

Führen Sie die interaktive Autorisierungs-CLI für jedes Konto aus:

gmail-auth default    # Authenticates primary account
gmail-auth work       # Authenticates secondary work account
gmail-auth client_x   # Authenticates any additional account

Alle authentifizierten Konten auflisten:

gmail-auth --list

Installation in MCP-Clients (Claude Desktop, OpenCode, Cursor, Windsurf)

Option 1: Sofort per uvx (empfohlen)

{
  "mcpServers": {
    "gmail": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Steph-ux/gmail-mcp.git", "gmail-mcp"]
    }
  }
}

Option 2: Per pip install

pip install git+https://github.com/Steph-ux/gmail-mcp.git

Dann in Ihrer MCP-Konfiguration:

{
  "mcpServers": {
    "gmail": {
      "command": "gmail-mcp"
    }
  }
}

Option 3: Lokaler Klon (Entwicklung)

{
  "mcpServers": {
    "gmail": {
      "command": "python",
      "args": ["D:\\Steph\\script\\gmail-mcp\\server.py"]
    }
  }
}

Anwendungsbeispiele

1. Nachrichten durchsuchen

# Search in default account:
gmail_search(query='is:unread from:github')

# Search in work account:
gmail_search(account='work', query='subject:invoice newer_than:7d')

2. Nachricht lesen

gmail_read(account='work', message_id='18f2a9b4c10d')

3. E-Mail senden oder Entwurf erstellen

# Send direct email:
gmail_send(
    account='default',
    to='colleague@example.com',
    subject='Project Update',
    body_text='Here is the latest status...',
    body_html='<h1>Project Update</h1><p>Here is the latest status...</p>'
)

# Create a draft:
gmail_send(
    account='work',
    to='client@example.com',
    subject='Proposal draft',
    body_text='Please review the proposal.',
    draft=True
)

4. Organisieren & Verwalten

# Archive email:
gmail_manage(account='work', action='archive', message_id='18f2a9b4c10d')

# Mark as unread:
gmail_manage(account='default', action='mark_unread', message_id='18f2a9b4c10d')

# Move to trash:
gmail_manage(account='default', action='trash', message_id='18f2a9b4c10d')

# List active accounts:
gmail_manage(action='list_accounts')

Testen

pytest tests

Lizenz

MIT

A
license - permissive license
Not graded
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
    Not graded
    quality
    D
    maintenance
    Enables interaction with Gmail through the MCP protocol, supporting sending, reading, searching, replying, forwarding, managing drafts and labels, and saving attachments.
    12
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Gmail operations such as reading, sending, searching, and managing emails, threads, labels, and drafts via MCP tools.
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables reading, searching, sending, and drafting Gmail emails via MCP tools, with support for multiple accounts and background notifications.

View all related MCP servers

Related MCP Connectors

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

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…

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

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