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.
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 email —
search_messages,get_message,get_thread - Draft-first safety — semua write jadi draft dulu, kirim butuh
confirm: trueeksplisit. LLM bisa salah, ini safety net. - Thread-aware reply — reply nempel di thread aslinya (
In-Reply-To+Referencesheader), 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)
- Aktifkan 2-Step Verification: https://myaccount.google.com/security
- Buat App Password: https://myaccount.google.com/apppasswords
- Salin
.env.examplejadi.env, isi:
GMAIL_EMAIL=emailanda@gmail.com
GMAIL_APP_PASSWORD=abcd efgh ijkl mnop
Mode B — OAuth Gmail API
- Buat Google Cloud Project + OAuth client (tipe "Desktop app"): https://console.cloud.google.com/apis/credentials
- Set
GMAIL_CLIENT_ID+GMAIL_CLIENT_SECRET(hapusGMAIL_EMAIL/GMAIL_APP_PASSWORD) - 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 & refreshsrc/imapClient.ts/src/smtpTransport.ts— backend App Password (IMAP read, SMTP send)src/tokenStore.ts— refresh token simpan local-first (~/.mcp-email/)src/cli.ts—login/status/logoutsrc/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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.