MailDev MCP

Search, read and clear the test inbox of a local MailDev SMTP server from an MCP client

Official · MailDev TypeScript Local · stdio, Streamable HTTP CommunicationTesting

92 popularity score ★ 6.2k ↓ 8.3k/wk

Connect your client

Local (once it is running)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add --transport http maildev http://localhost:1080/mcp
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "maildev": {
      "url": "http://localhost:1080/mcp"
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "maildev": {
      "type": "http",
      "url": "http://localhost:1080/mcp"
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.maildev]
url = "http://localhost:1080/mcp"
Gemini CLITerminal
gemini mcp add --scope user --transport http maildev http://localhost:1080/mcp
Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add maildev -- maildev-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "maildev": {
      "command": "maildev-mcp",
      "args": []
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "maildev": {
      "command": "maildev-mcp",
      "args": []
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "maildev": {
      "type": "stdio",
      "command": "maildev-mcp",
      "args": []
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.maildev]
command = "maildev-mcp"
args = []
Gemini CLITerminal
gemini mcp add --scope user maildev maildev-mcp

Settings 4

MAILDEV_API_URL Optional: Base URL of the running MailDev REST API (default http://localhost:1080); stdio mode only.
MAILDEV_API_KEY Optional: Key for the MailDev REST API when authentication is enabled; stdio mode only.
MAILDEV_WEB_URL Optional: Base URL of the MailDev web interface used for message links; derived from the API URL when unset.
MAILDEV_MCP Optional: Turns on the MCP endpoint at /mcp when starting MailDev itself (same as --mcp).

What it does

MailDev is a local SMTP server for development: an application under test sends its mail to it, and MailDev keeps the messages in a web inbox instead of delivering them. Its MCP server, published as @maildev/mcp, gives an agent the same inbox, so it can find a message by sender, recipient, subject, date or text, read the whole message with its attachments, fetch the newest mail, and delete messages it no longer needs. Listings carry a link to each message in the MailDev web interface.

The typical use is in testing sign-up, password-reset or order flows: the agent triggers the flow, then pulls the verification link or token out of the mail that arrived. Besides the five tools it exposes the inbox, single messages and inbox statistics as resources, and ships four prompts for checking sign-up mail, password resets, content analysis and delivery.

There are two ways to run it. Starting MailDev with --mcp serves the MCP endpoint over HTTP at /mcp on the web port (1080 by default), reading the mail store directly; the makers recommend this way. The separate maildev-mcp command speaks stdio and talks to an already running MailDev instance through its REST API. The GitHub repository is the whole MailDev monorepo (SMTP server, REST API, React web interface, CLI); the MCP server is one package in it.

What it needs

RuntimeNode.js

Node.js and a running MailDev instance (installed with npm install -g maildev, or the maildev/maildev Docker image). For the HTTP way MailDev must be started with --mcp; for stdio the @maildev/mcp package provides the maildev-mcp command, which needs the MailDev REST API reachable, plus an API key if authentication is on.

Limits

It only sees mail caught by MailDev; it cannot reach a real mailbox and has no tool to send or relay mail. Five tools only: search, get one, get latest, get attachment, delete. Search returns 20 results unless a limit is given. The makers mark it for development only: it has full access to the caught mail and should be bound to localhost and never exposed to the internet.

Who it suits

Developers who already catch their app's outgoing mail with MailDev and want an agent to check that test emails arrived and extract links or tokens during end-to-end work. It is published by the MailDev project itself and runs entirely on your machine with no account. It is not a client for real email: for Gmail, IMAP or other live inboxes pick a server built for that service. Since it can delete caught messages, keep that in mind where a shared MailDev inbox is used by a team.

Tools 5

maildev_search_emails
Finds caught messages using optional filters: free text over subject, sender, recipients and body, sender, recipient, subject, attachments, read state, a time window, and a result limit.
maildev_get_email
Returns one message in full by its ID, with body and attachment details.
maildev_get_latest_email
Returns the newest message, or a given number of the most recent ones.
maildev_delete_email
Removes one message from the MailDev inbox by its ID.
maildev_get_attachment
Fetches a named attachment of a message as base64 text.

Similar servers