email-mcp

email-mcp

MCP server that sends outbound emails with automatic single-thread mapping in Gmail, enabling reply-style conversations within a single thread.

Category
Visit Server

README

email-mcp

MCP server that turns the existing email_bridge.py workflow into one outbound email tool with automatic single-thread mapping.

Tool

  • send
    • Sends an email in the mapped Gmail thread.
    • First call creates the thread.
    • Later calls keep replying in that same thread.

Automatic Thread Mapping

Mapping key selection order:

  1. explicit context_id argument
  2. CODEX_THREAD_ID env var
  3. CODEX_SESSION_ID env var
  4. fallback: process-scoped key (proc-<pid>-<random>)

Behavior:

  • One mapping key -> one Gmail thread.
  • Mapping is stored in ~/.codex/email-bridge/mcp-state/thread-map.json.
  • For non-Codex clients, pass context_id in tool calls if you want separate Gmail threads per chat/session.
  • Optional override: set EMAIL_MCP_PROCESS_SESSION_KEY to force a fixed fallback key.

Prerequisites

This server includes a local bridge script at bridge/email_bridge.py (used as fallback when direct SMTP mode is unavailable).

Configure the same mailbox env vars used by that script:

  • CODEX_EMAIL_ADDRESS
  • CODEX_EMAIL_PASSWORD
  • CODEX_EMAIL_TO (or pass to in tool calls)
  • optional SMTP/IMAP host/port vars from the email-bridge docs

Install

cd email-mcp
npm install

Add To Your App (MCP)

This is a local stdio MCP server.

  • command: node
  • args: ["/absolute/path/to/email-mcp/index.js"]
  • env: mailbox credentials + optional tuning flags

Recommended env vars:

  • CODEX_EMAIL_ADDRESS
  • CODEX_EMAIL_PASSWORD
  • CODEX_EMAIL_TO
  • EMAIL_MCP_PREWARM=true
  • EMAIL_MCP_BRIDGE_SCRIPT=/absolute/path/to/email-mcp/bridge/email_bridge.py
  • EMAIL_MCP_PYTHON=python3

Codex (~/.codex/config.toml)

Add this in ~/.codex/config.toml:

[mcp_servers.email]
command = "node"
args = ["/absolute/path/to/email-mcp/index.js"]
tool_timeout_sec = 3600

[mcp_servers.email.env]
CODEX_EMAIL_ADDRESS = "your_email@gmail.com"
CODEX_EMAIL_PASSWORD = "your_app_password"
CODEX_EMAIL_TO = "recipient@example.com"
EMAIL_MCP_PREWARM = "true"
EMAIL_MCP_BRIDGE_SCRIPT = "/absolute/path/to/email-mcp/bridge/email_bridge.py"
EMAIL_MCP_PYTHON = "python3"

tool_timeout_sec can stay high if you want one shared default, but this send-only server does not need long blocking timeouts.

Cursor (~/.cursor/mcp.json or project .cursor/mcp.json)

Add:

{
  "mcpServers": {
    "email-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/email-mcp/index.js"],
      "env": {
        "CODEX_EMAIL_ADDRESS": "your_email@gmail.com",
        "CODEX_EMAIL_PASSWORD": "your_app_password",
        "CODEX_EMAIL_TO": "recipient@example.com",
        "EMAIL_MCP_PREWARM": "true"
      }
    }
  }
}

Then restart Cursor.

Claude Code

Use MCP add with stdio:

claude mcp add --transport stdio \
  --env CODEX_EMAIL_ADDRESS=your_email@gmail.com \
  --env CODEX_EMAIL_PASSWORD=your_app_password \
  --env CODEX_EMAIL_TO=recipient@example.com \
  --env EMAIL_MCP_PREWARM=true \
  email-mcp -- node /absolute/path/to/email-mcp/index.js

If your Claude client uses JSON mcpServers config instead, use the same block shown in the Cursor example.

Notes

  • This MCP server only sends email.
  • Incoming replies should be handled outside MCP by a watcher or intake flow, for example bridge/email_bridge.py watch --once, bridge/email_bridge.py wait, or your higher-level helper scripts.
  • For stable Gmail threading, each mapped session uses one canonical subject base; later subject inputs are ignored for that session.
  • send uses a pooled SMTP transport when SMTP env vars are present, which reduces repeated send overhead.
  • Startup prewarm is enabled by default (EMAIL_MCP_PREWARM=true) and warms the SMTP path in the background.

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
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
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
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