mcp-email-client

mcp-email-client

MCP server for email management that enables reading, searching, drafting, replying to, and sending emails with thread-aware replies and draft-first safety, supporting Gmail API and IMAP/SMTP backends.

Category
Visit Server

README

mcp-email-client

MCP server yang menjembatani LLM (Claude) dengan inbox email kamu — bisa baca thread, bikin draft, reply, dan kirim email langsung dari chat. Fokus ke thread-aware write, bukan cuma baca inbox.


Fitur

  • Baca & cari emailsearch_messages, get_message, get_thread
  • Draft-first safety — semua write jadi draft dulu, kirim butuh confirm: true eksplisit. LLM bisa salah, ini safety net.
  • Thread-aware reply — reply nempel di thread aslinya (In-Reply-To + References header), rapi di Gmail/Outlook.
  • Multi-backend — Gmail API (OAuth) atau IMAP/SMTP (App Password), satu interface.
  • Token local-first — refresh token disimpan di direktori user (~/.mcp-email/), bukan server pihak ketiga.

Cara kerja

Claude ──► search_messages("invoice") ──► thread: "194abc"
  ──► get_thread("194abc")        ──► isi thread kronologis
  ──► draft_reply("194abc", ...)  ──► DRAFT (belum terkirim)
  ──► send_reply(...)             ──► VERIFIKASI (confirm) → SENT

Detail arsitektur & alur: docs/FLOW.md.

Instalasi

# install via npm
npm install -g mcp-email-client
# lalu daftarkan ke MCP host:
#   command: mcp-email,  args: []

Setup

Mode A — App Password (recommended, tanpa OAuth)

  1. Aktifkan 2-Step Verification: https://myaccount.google.com/security
  2. Buat App Password: https://myaccount.google.com/apppasswords
  3. Salin .env.example jadi .env, isi:
GMAIL_EMAIL=emailanda@gmail.com
GMAIL_APP_PASSWORD=abcd efgh ijkl mnop

Mode B — OAuth Gmail API

  1. Buat Google Cloud Project + OAuth client (tipe "Desktop app"): https://console.cloud.google.com/apis/credentials
  2. Set GMAIL_CLIENT_ID + GMAIL_CLIENT_SECRET (hapus GMAIL_EMAIL/GMAIL_APP_PASSWORD)
  3. Login sekali:
npm install
npm run auth        # buka browser, izinkan gmail.modify
npm run auth:status # cek status

Connect ke Claude (MCP host)

Tambah ke config MCP host (.mcp.json / claude_desktop_config.json):

{
  "mcpServers": {
    "email": {
      "command": "node",
      "args": ["C:/code/mcp-email-client/dist/index.js"]
    }
  }
}

Tools (12)

Kategori Tools
Read search_messages, get_message, get_thread, list_drafts
Draft (aman) draft_new, draft_reply
Send (butuh confirm) send_email, send_draft, schedule_send*
Manipulasi set_thread_state, download_attachment
Health status

* schedule_send masih stub.

Status

Semua milestone (M0–M4) selesai — 12 tool MCP, mode OAuth + App Password.

Struktur:

  • src/gmailAuth.ts — OAuth2 + PKCE, callback loopback, token exchange & refresh
  • src/imapClient.ts / src/smtpTransport.ts — backend App Password (IMAP read, SMTP send)
  • src/tokenStore.ts — refresh token simpan local-first (~/.mcp-email/)
  • src/cli.tslogin / status / logout
  • src/index.ts — entry point MCP server

Test: npm test

Docs

File Isi
docs/FLOW.md Arsitektur, data flow, auth flow
docs/SCHEMA.md Semua tool + param + tipe return
docs/PROGRESS.md Status implementasi per milestone

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured