An order receipt and a personal inbox search need different email access: one sends from application code, while the other reads an existing mailbox. This email MCP server example starts with a client configuration, then shows how to test the connection without assuming a particular package’s tool names or authentication flow.
An email MCP server gives an AI client access to the actions that a particular server exposes. Configure the client to launch or connect to that server, authorize the mailbox using a supported method, and inspect the server’s tools before calling one. Use IMAP-oriented access for existing mailbox work and an application sending API or SMTP relay for event-triggered product email.
A minimal email MCP server example
Here is an illustrative mcpServers configuration for a client that launches local servers over stdio:
{
"mcpServers": {
"mailbox": {
"command": "node",
"args": ["/absolute/path/to/your-mail-server.js"],
"env": {
"MAIL_ACCOUNT": "account-name-configured-for-your-server"
}
}
}
}
This is a configuration shape example, not a universal .mcp.json schema or a ready-to-run package recipe. Replace the command, path, and environment variables with values supported by the mailbox server you choose. Do not put a real password or refresh token in a file you commit to source control.
In stdio transport, the MCP client launches the server as a subprocess; the server reads protocol messages from standard input and writes them to standard output. It must keep ordinary logs off stdout so they do not interfere with MCP messages. MCP also defines Streamable HTTP, where the server runs independently and provides an endpoint for HTTP requests. The transport specification describes both patterns. The specification page currently labeled 2026-07-28 shows that value as a protocol-version example, not as a universal client configuration filename or schema (MCP overview).
After adding the configuration in the client’s documented settings, restart or reconnect the client and look for a successful server connection. Then discover tools before trying to read mail. Once a server session is initialized, MCP’s standard tools/list request asks for the tools that implementation offers:
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
A successful response contains a result.tools array with tool names and input schemas. Use one of those exact names and its declared arguments for a call, rather than guessing a name such as search_messages or assuming every server exposes the same actions. The standard call shape is:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "exact-tool-name-from-tools-list",
"arguments": {}
}
}
Replace the name and arguments with values from the server’s tool listing. A successful call returns a result from that tool; an unknown tool name or invalid arguments should produce an error rather than a mailbox result. This gives you a concrete connection test without treating one vendor’s tool list as an MCP standard.
Choose the right kind of email MCP server
Choose by the work to be done: searching and managing an existing mailbox, or sending messages from an application. MCP standardizes client-server communication, not mailbox features. IMAP4rev2 supports operations such as SEARCH and FETCH; SMTP submits outgoing messages. An IMAP/SMTP server can expose both directions, but SMTP alone does not provide inbox search (RFC 9051).
| Pattern | Best fit | What it connects to |
|---|---|---|
| Local IMAP/SMTP MCP server | Read or manage an existing mailbox; send as that mailbox if the server supports it | A mailbox provider such as Gmail, iCloud, Fastmail, or Microsoft 365, through the server’s supported protocols |
| Managed email-action integration | Use a hosted service’s specific email actions | The actions and account connections offered by that integration |
| Application email API or SMTP relay | Send receipts, alerts, and onboarding messages in response to product events | Your application’s sender identity and sending service, not a personal inbox |
A local server is useful when the assistant needs mailbox context. A managed action integration can be simpler when the task is sending through a service, but its available actions still depend on that integration. For a product workflow, keep the event handler responsible for deciding whether a receipt should be sent; an agent’s access to a user’s inbox is not a substitute for that logic.
Connect a mailbox: providers and authentication
The usual setup has three pieces: provider connection settings, an account identity, and credentials or authorization accepted by both the provider and the chosen server. Provider examples include Gmail, iCloud, Fastmail, and Microsoft 365, but their configuration paths are not interchangeable.
For Gmail API access, Google requires OAuth 2.0 authorization. Its server-side flow exchanges a one-time authorization code for an access token and, when offline access is requested, a refresh token (Google’s OAuth flow). Google recommends “Sign in with Google” instead of sharing an account password with a third-party app. For reading, gmail.readonly allows viewing messages and settings; gmail.metadata permits message metadata but not message bodies. Both are restricted scopes, so request only what the chosen task needs (Gmail scopes).
An app password is a provider-issued password for an app or device, not an OAuth token. Whether it works depends on the provider, account policy, and MCP server implementation. Google Workspace accounts must use OAuth for third-party access; Google says username-and-password access for apps and devices ended on May 1, 2025 (Workspace guidance).
Microsoft documents Exchange Online IMAP at outlook.office365.com:993 with SSL/TLS and SMTP at smtp.office365.com:587 with STARTTLS. Its SMTP AUTH supports OAuth Modern authentication and Basic authentication where permitted (Exchange Online connection settings, SMTP AUTH). These are Microsoft’s settings, not a template to reuse for other providers.
What an email MCP server can do
A server may offer read, search, draft, send, and mailbox-management tools, but that list is implementation-specific. IMAP4rev2 itself includes mailbox listing, message search and fetch, flag changes, and operations such as moving or deleting messages (RFC 9051). A server only gives an assistant access to actions that it actually implements and exposes.
Representative tasks might include:
- Search for messages from a sender or matching a subject, then retrieve selected headers or message text.
- Draft a reply or send a message, if the server exposes those actions.
- Set
ToandCCrecipients and attach a file, if its send tool supports those fields. - Move, flag, or delete messages, if it exposes mailbox-management operations.
The tools/list result is the practical contract: it provides names and input schemas for the available tools. For example, a search tool might accept a query, while another server could expose separate sender and subject arguments. A tool name, attachment behavior, and draft workflow cannot be inferred from the phrase “email MCP server.”
Secure the connection before giving an agent access
Treat an email connection as an application credential. Start with the narrowest permissions that complete the task, keep tokens and passwords in a secret store or protected environment, and require human review before sending mail or performing destructive mailbox actions. Gmail’s gmail.send scope permits sending on the user’s behalf; gmail.modify also permits reading, composing, and sending. Google recommends the narrowest authorization scope, and restricted-scope applications may face verification and security-assessment requirements (Google scope guidance).
Local and hosted connections have different trust boundaries. With stdio, the client launches a local subprocess; with Streamable HTTP, an independently running server processes requests. Know where the server runs and where it handles message data. For a server that can send or change mail, keep approval in the workflow rather than relying on the model to decide whether an action is safe.
For SMTP submission, port 587 is reserved for message submission, and RFC 6409 says an MSA generally must reject a MAIL command if the session has not authenticated with SMTP AUTH, unless it independently established authorization (RFC 6409). RFC 8314 recommends TLS 1.2 or later for mail-user-agent connections to submission servers. Port 465 uses implicit TLS: the TLS handshake begins immediately when the TCP connection opens. These protocol details make encrypted, authenticated submission the baseline, not an optional security extra (RFC 8314).
Adapt the example for application and transactional email
A receipt should follow a confirmed purchase in application code, not an assistant’s session with a person’s inbox. SMTP defines a message as an envelope—originator and recipient addresses—and content, which is transferred using DATA and contains headers and a body (RFC 5321). The application event supplies the recipient and receipt details; an MCP connection is useful for development or controlled operations, not as the production trigger for every order.
For example, a Python service can send after it has confirmed order.status == "paid". This SMTP example uses environment variables for relay settings and the project key; populate the host and sender from your sending service’s configuration:
import os
import smtplib
from email.message import EmailMessage
message = EmailMessage()
message["From"] = os.environ["MAIL_FROM"]
message["To"] = "customer@example.com"
message["Subject"] = "Receipt for order 8472"
message.set_content("Your payment was received. Order: 8472. Total: $39.00.")
with smtplib.SMTP(os.environ["SMTP_HOST"], 587) as smtp:
smtp.starttls()
smtp.login("volanea", os.environ["VOLANEA_PROJECT_KEY"])
smtp.send_message(message)
For Volanea’s SMTP relay, the username is volanea and the password is the project’s secret API key. The From value can be a bare address or a display name, such as Orders <orders@example.com>. A sk_test_ key renders and logs messages but does not deliver them, which lets a developer test the application path without sending a real receipt. After testing, verify the sending domain; Volanea allows sending to real recipients after domain verification without requesting Amazon SES production access. We send through Amazon SES, and the sending endpoint processes suppression checks, contact upserts, template rendering, tracking, and delivery in one pipeline. Volanea combines transactional email, campaigns, and automations; it is not a personal Gmail or IMAP inbox replacement.
Cost and limits matter when choosing this route. Volanea Free is $0 with 1,000 emails each month, 500 contacts, all 23 MCP tools, one sending domain, one workspace, and up to three team members; the free tier requires no card. Starter is $4 per month or $48 billed yearly and includes 7,500 monthly emails and 2,500 contacts. Growth is $16 per month or $192 billed yearly, with 50,000 monthly emails and 15,000 contacts. Moving from Starter to Growth costs 192 − 48 = $144/year on annual billing, or 16 − 4 = $12/month at the listed monthly prices. All 23 MCP tools are available on every plan (Volanea pricing).
The Free daily sending limit is 100; Starter is 1,000; Growth is 10,000. Limits ramp up over a new project’s first week. At a plan’s monthly limit, sending pauses rather than generating overage billing. For raw Amazon SES context, AWS lists à la carte outbound email at $0.10 per 1,000 emails, plus $0.12 per GB of attachment data; that is an SES sending charge, not a like-for-like substitute for a managed plan with its included tools and workflow features (Amazon SES pricing). Volanea’s reputation guard slows sending before a bad list harms a domain. Our email deliverability and sending guides cover list and sending practices in more detail.
Troubleshooting common setup problems
If the server does not start, check JSON syntax, the executable path, and whether the command is available to the client process. For a stdio connection, stray diagnostic output on stdout can break protocol communication; MCP permits logging to stderr while stdout carries protocol messages (transport specification).
If it starts but cannot authenticate, compare the server’s expected environment variable names with the client configuration and make sure the account granted the requested permission. If tools/list succeeds but a call fails, compare the tool name and arguments with its input schema. A mismatch between a client expecting stdio and a server configured for Streamable HTTP can also prevent a connection, even when both implementations support MCP.
FAQ
Can an email MCP server both read and send messages?
Yes, when the implementation exposes both mailbox-reading actions and a send action. IMAP supports mailbox access, while SMTP handles message submission; a combined server may connect them, but neither MCP nor the term “email server” guarantees that both capabilities are present. Inspect the advertised tools and their schemas before granting send permission.
Is Gmail’s read-only OAuth permission enough to create a draft?
No. Google’s gmail.readonly scope allows viewing messages and settings, not creating drafts or sending. For Gmail, gmail.compose permits draft management and sending, while gmail.send permits sending on the user’s behalf. Request the narrower permission that matches the task rather than granting broad mailbox access by default.
How can I test a product receipt without emailing a customer?
Use a test-mode key in the application’s sending path and inspect the resulting log or rendered message. Volanea sk_test_ keys render and log but never deliver, so they are not a way to confirm receipt in a real inbox. Switch to a live project key only after validating the recipient, message content, and sending-domain setup.
When should I move from a personal mailbox connection to an application sender?
Move when messages are triggered by product state—such as a paid order, signup, or password reset—rather than by a person deciding what to send from an inbox. Keep user correspondence in a mailbox workflow; route recurring transactional messages through application code so the event, recipient, and message are controlled by the product.
Start free with 1,000 emails a month → https://app.volanea.com/signup