by mailtrap
Provides a set of MCP tools for sending, testing, and managing emails through Mailtrap, including transactional sends, sandbox previews, template handling, statistics, and domain management.
Mailtrap MCP Server offers a collection of command‑line and API‑driven tools that let developers interact with the Mailtrap service directly from their IDE or automation workflow. It covers sending real or sandbox emails, retrieving logs and statistics, managing templates, sandboxes, sending domains, suppressions, webhooks, contacts, and contact lists.
npx -y mcp-mailtrap
MAILTRAP_API_TOKEN (mandatory for all actions)MAILTRAP_ACCOUNT_ID (required for most management tools)DEFAULT_FROM_EMAIL, MAILTRAP_TEST_INBOX_ID, MAILTRAP_SANDBOX_IDsend-email, list-email-logs, create-template).send-email for production messages and send-sandbox-email for safe testing.list-email-logs and get-email-log-message for full delivery diagnostics.get-sending-stats with optional breakdowns by domain, category, provider, or date.send-email from CI pipelines to notify stakeholders or alert on build status.Q: Which environment variables are mandatory?
A: MAILTRAP_API_TOKEN is always required. MAILTRAP_ACCOUNT_ID is needed for most management tools (templates, stats, sandbox access, sending domains). The others are optional defaults.
Q: Can I send real production emails with this server?
A: Yes, use send-email. Ensure you provide a valid from address and have the appropriate sending domain verified in Mailtrap.
Q: What is the difference between send-email and send-sandbox-email?
A: send-email delivers to real recipients via your verified sending domain. send-sandbox-email routes the message to a Mailtrap test inbox, preventing delivery to external users.
Q: How do I retrieve the raw MIME content of a sandbox message?
A: Use the get-sandbox-message-raw tool (or get-sandbox-message-eml for an EML file).
Q: Do I need to reinstall the server after changing environment variables? A: Restart the MCP server (or reload the client configuration) after any env‑variable changes.
Q: Is there a limit on how many sandbox messages I can store? A: Mailtrap enforces a quota based on your plan; excess messages are purged automatically.
Q: How are errors reported?
A: Errors follow MCP conventions: VALIDATION_ERROR, CONFIGURATION_ERROR, EXECUTION_ERROR, or TIMEOUT, each with a clear message.
An MCP server that provides tools for sending and testing in sandbox via Mailtrap.
Before using this MCP server, you need to:
Required Environment Variables:
MAILTRAP_API_TOKEN - Required for all functionalityMAILTRAP_ACCOUNT_ID - Required for templates, stats, email logs, sandbox list/show, and sending domains. Optional only for send-email and send-sandbox-email.Optional (can be passed as tool parameters instead):
DEFAULT_FROM_EMAIL - Default sender email when from is not provided to send-email or send-sandbox-email. Enables switching sender per call via the from parameter.MAILTRAP_TEST_INBOX_ID - Default test inbox ID for sandbox tools when test_inbox_id is not provided. Enables switching between inboxes per call via the test_inbox_id parameter.MAILTRAP_SANDBOX_ID - Default sandbox ID for sandbox tools when sandbox_id is not provided. Enables switching between sandboxes per call via the sandbox_id parameter.Smithery is a registry installer and manager for MCP servers that works with all AI clients.
npx @smithery/cli install mailtrap
Smithery automatically handles client configuration and provides an interactive setup process. It's the easiest way to get started with MCP servers locally.
Use MCPB to install the Mailtrap server. You can find those files in Releases. Download .MCPB file and open it. If you have Claude Desktop - it will open it and suggest to configure.
Add the following configuration:
{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
If you are using asdf for managing Node.js you must use absolute path to executable (example for Mac)
{
"mcpServers": {
"mailtrap": {
"command": "/Users/<username>/.asdf/shims/npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"PATH": "/Users/<username>/.asdf/shims:/usr/bin:/bin",
"ASDF_DIR": "/opt/homebrew/opt/asdf/libexec",
"ASDF_DATA_DIR": "/Users/<username>/.asdf",
"ASDF_NODEJS_VERSION": "20.6.1",
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Mac: ~/.cursor/mcp.json
Windows: %USERPROFILE%\.cursor\mcp.json
Run in Command Palette: Preferences: Open User Settings (JSON)
Then, in the settings file, add the following configuration:
{
"mcp": {
"servers": {
"mailtrap": {
"command": "npx",
"args": ["-y", "mcp-mailtrap"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
}
[!TIP] Don't forget to restart your MCP server after changing the "env" section.
For easy installation in hosts that support MCP Bundles, you can distribute an .mcpb bundle file.
# Build TypeScript and pack the MCPB bundle
npm run mcpb:pack
# Inspect bundle metadata
npm run mcpb:info
# Sign the bundle for distribution (optional)
npm run mcpb:sign
This creates mailtrap-mcp.mcpb using the repository manifest.json and built artifacts in dist/.
Once configured, you can ask agent to send emails and manage templates, for example:
Email Sending Operations:
b81aabcd-1a1e-41cf-91b6-eca0254b3d96) to new@example.com with variables { name: 'Alex' }"Email Logs (debug delivery):
Sending Statistics:
Sandbox Operations:
Template Operations:
Sending Domains:
Sends a transactional email through Mailtrap. Supports two mutually exclusive modes — inline content (subject + text/html) or template-based (template_uuid).
Parameters:
from (optional): Sender as an email string or { email, name? }. If not provided, DEFAULT_FROM_EMAIL is used.to (optional): Recipient(s) — a single email/{ email, name? } or an array. Optional if cc or bcc is provided; at least one of to / cc / bcc must contain a recipient.cc (optional): Array of CC recipients (email strings or { email, name? } each).bcc (optional): Array of BCC recipients (email strings or { email, name? } each).subject (conditional): Email subject line. Required for inline sends; must be omitted when template_uuid is set.text (conditional): Email body text. Required (alongside or instead of html) for inline sends; must be omitted when template_uuid is set.html (conditional): HTML version of the email body. Required (alongside or instead of text) for inline sends; must be omitted when template_uuid is set.category (optional): Email category for tracking and analytics. Must be omitted when template_uuid is set.template_uuid (optional): Use a Mailtrap email template instead of inline content. When set, subject / text / html / category must be omitted (per Mailtrap API).template_variables (optional): Object of variables substituted into the template referenced by template_uuid. Only allowed together with template_uuid.Lists sent email logs (delivery history) with optional pagination and filters. Use to debug delivery issues from the IDE.
Parameters:
search_after (optional): Pagination cursor from the previous response's next_page_cursorsent_after (optional): ISO 8601 date/time; only logs sent after this timesent_before (optional): ISO 8601 date/time; only logs sent before this timefrom_email (optional): Filter by sender email; use with from_operator (default: ci_equal)to_email (optional): Filter by recipient email; use with to_operator (default: ci_equal)status (optional): Filter by delivery status: delivered, not_delivered, enqueued, opted_out; use with status_operator (default: equal)subject (optional): Filter by email subject; use with subject_operator (default: ci_contain). Use subject_operator: empty/not_empty to filter by presence of subject.sending_domain_id (optional): Filter by sending domain ID (number); use with sending_domain_id_operator (default: equal)sending_stream (optional): Filter by stream: transactional or bulk; use with sending_stream_operator (default: equal)events (optional): Filter by event type(s): delivery, open, click, bounce, spam, unsubscribe, soft_bounce, reject, suspension; use with events_operator (include_event / not_include_event)clicks_count / opens_count (optional): Filter by click/open count; use with *_operator: equal, greater_than, less_thanclient_ip / sending_ip (optional): Filter by IP; use with *_operator: equal, not_equal, contain, not_containemail_service_provider_response (optional): Filter by provider response text; use with *_operator (ci_contain, etc.)email_service_provider (optional): Filter by provider (exact); use with *_operator: equal, not_equalrecipient_mx (optional): Filter by recipient MX; use with recipient_mx_operator (ci_contain, etc.)category (optional): Filter by email category; use with category_operator: equal, not_equalAll parameters are optional.
Gets a single email log message by ID (UUID): a readable summary (from, to, subject, sent time, status, category, stream, engagement, delivery context), then detailed event history. Optionally, with include_content: true, you can also load and show the message body (HTML and plain text) when Mailtrap exposes a raw message URL.
Parameters:
message_id (required): UUID of the email log message (from send response or list-email-logs). Use list-email-logs to find message IDs.include_content (optional): When true, fetches the raw EML (if raw_message_url is available) and appends parsed HTML and plain-text body sections, similar to show-sandbox-email-message.Get email sending statistics (delivery, bounce, open, click, spam rates) for a date range. Optionally break down by domain, category, email service provider, or date. Check delivery rates without leaving the editor.
Parameters:
start_date (required): Start date for the stats range (YYYY-MM-DD)end_date (required): End date for the stats range (YYYY-MM-DD)breakdown (optional): How to break down the stats: aggregated (default), by_domain, by_category, by_email_service_provider, or by_datesending_domain_ids (optional): Limit results to these sending domain IDs (array of integers)sending_streams (optional): Limit to transactional and/or bulk (array of strings)categories (optional): Limit to these email categories (array of strings)email_service_providers (optional): Limit to these providers, e.g. Google, Yahoo, Outlook (array of strings)Creates a new email template in your Mailtrap account.
Parameters:
name (required): Name of the templatesubject (required): Email subject linehtml (or text is required): HTML content of the templatetext (or html is required): Plain text version of the templatecategory (optional): Template category (defaults to "General")Lists all email templates in your Mailtrap account.
Parameters:
Get a single email template by ID, including subject, category, and HTML/text body.
Parameters:
template_id (required): ID of the template to fetchUpdates an existing email template.
Parameters:
template_id (required): ID of the template to updatename (optional): New name for the templatesubject (optional): New email subject linehtml (optional): New HTML content of the templatetext (optional): New plain text version of the templatecategory (optional): New category for the template[!NOTE] At least one updatable field (name, subject, html, text, or category) must be provided when calling update-template to perform an update.
Deletes an existing email template.
Parameters:
template_id (required): ID of the template to deleteSends an email to your Mailtrap test inbox for development and testing purposes. This is perfect for testing email templates without sending emails to real recipients. Supports the same two modes as send-email — inline content or template-based (template_uuid).
Parameters:
test_inbox_id (optional): Mailtrap test inbox ID. Required unless MAILTRAP_TEST_INBOX_ID is set; pass per call to target a specific inbox.from (optional): Sender as an email string or { email, name? }. If not provided, DEFAULT_FROM_EMAIL is used.to (optional): Recipients as a comma-separated string, or an array of email strings / { email, name? } objects. Optional if cc or bcc is provided; at least one of to / cc / bcc must contain a recipient.cc (optional): Array of CC recipients (email strings or { email, name? } each).bcc (optional): Array of BCC recipients (email strings or { email, name? } each).subject (conditional): Email subject line. Required for inline sends; must be omitted when template_uuid is set.text (conditional): Email body text. Required (alongside or instead of html) for inline sends; must be omitted when template_uuid is set.html (conditional): HTML version of the email body. Required (alongside or instead of text) for inline sends; must be omitted when template_uuid is set.category (optional): Email category for tracking. Must be omitted when template_uuid is set.template_uuid (optional): Use a Mailtrap email template instead of inline content. When set, subject / text / html / category must be omitted.template_variables (optional): Object of variables substituted into the template referenced by template_uuid. Only allowed together with template_uuid.[!NOTE] For sandbox tools, provide
test_inbox_idin the tool call or set theMAILTRAP_TEST_INBOX_IDenvironment variable. You can switch between inboxes per call by passingtest_inbox_id.
Retrieves a list of messages from your Mailtrap test inbox. Useful for checking what emails have been received in your sandbox during testing.
Parameters:
page (optional): Page number for pagination (minimum: 1)last_id (optional): Pagination using last message ID. Returns messages after the specified message ID (minimum: 1)search (optional): Search query to filter messages[!NOTE] All parameters are optional. If none are provided, the first page of messages from the inbox will be returned. Use page for traditional pagination, last_id for cursor-based pagination, or search to filter messages by content.
Shows detailed information and content of a specific email message from your Mailtrap test inbox, including HTML and text body content.
Parameters:
message_id (required): ID of the sandbox email message to retrieve[!NOTE] Use
get-sandbox-messagesfirst to get the list of messages and their IDs, then use this tool to view the full content of a specific message.
Get a sandbox project by ID, including its inboxes and email counts.
Parameters:
project_id (required): ID of the project to fetchRename an existing sandbox project.
Parameters:
project_id (required): ID of the project to updatename (required): New name for the project (2–100 characters)List every sandbox accessible to the API token across all projects.
Parameters:
Mark all messages in a sandbox as read.
Parameters:
sandbox_id (required): ID of the sandbox to act onReset the SMTP credentials for a sandbox. Returns the new username/password.
Parameters:
sandbox_id (required): ID of the sandbox to act onEnable the receive-by-email address for a sandbox (turns on the Mailtrap address that delivers messages to the sandbox via SMTP).
Parameters:
sandbox_id (required): ID of the sandbox to act onGenerate a new receive-by-email address for a sandbox.
Parameters:
sandbox_id (required): ID of the sandbox to act onForward a sandbox message to an external email address. Counts against your monthly forwarding quota.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox message to forwardemail (required): Email address to forward the message toMark a sandbox message as read or unread.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox message to updateis_read (required): true marks as read, false marks as unreadDelete a single sandbox message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox message to deleteGet the SpamAssassin spam report for a sandbox message (score, rules, full report). Standalone alternative to include_spam_report: true on show-sandbox-email-message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the HTML analysis report for a sandbox message (client compatibility scores, problematic elements). Standalone alternative to include_html_analysis: true on show-sandbox-email-message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the parsed mail headers for a sandbox message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the rendered HTML body of a sandbox message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the plain-text body of a sandbox message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the raw, MIME-formatted message (headers + body) for a sandbox message.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the message rendered as an EML file payload (suitable for attaching to a ticket or importing into another mail client).
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet the unrendered HTML source of a sandbox message (HTML before any Mailtrap-side transformations like CID-link rewrites).
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageList all attachments on a sandbox message (filename, content type, size, download path).
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox messageGet metadata and download URL for a single attachment.
Parameters:
sandbox_id (optional): Sandbox ID. Falls back to MAILTRAP_SANDBOX_ID.message_id (required): ID of the sandbox message that contains the attachmentattachment_id (required): ID of the attachment to fetchList sending domains and their DNS verification status.
Parameters:
Get a sending domain by ID and its verification status (including DNS records). Optionally include DNS setup instructions by setting include_setup_instructions to true.
Parameters:
sending_domain_id (required): Sending domain IDinclude_setup_instructions (optional): If true, append DNS setup instructions to the response. Default: falseCreate a new sending domain. After creation, add DNS records to verify the domain (use get-sending-domain with include_setup_instructions: true to see the records).
Parameters:
domain_name (required): Domain name (e.g. example.com)Delete a sending domain.
Parameters:
sending_domain_id (required): Sending domain ID to deleteEmail DNS setup instructions for a sending domain to a given address. Useful for forwarding DNS records to a DevOps teammate.
Parameters:
sending_domain_id (required): Sending domain IDemail (required): Email address to send DNS setup instructions toList or search suppressions (hard bounces, spam complaints, unsubscriptions, manual imports). Returns up to 1000 results per call.
Parameters:
email (optional): Email filter. Returns only suppressions matching this address.Delete a suppression by ID. Mailtrap will resume delivery to this email unless it gets suppressed again.
Parameters:
suppression_id (required): ID of the suppression to deleteList all webhooks configured for the account. Returns the full webhook records as JSON.
Parameters:
Get a single webhook by ID. Returns the full webhook record as JSON. Note: signing_secret is not returned here — it is only available in the response from create-webhook.
Parameters:
webhook_id (required): ID of the webhook to fetchCreate a webhook. The response includes a signing_secret for verifying webhook payload signatures — this secret is returned only on creation, so store it now. If you lose it, recreate the webhook.
Parameters:
url (required): URL Mailtrap will POST webhook events towebhook_type (required): "email_sending" or "audit_log"active (optional, boolean): defaults to truepayload_format (optional): "json" or "jsonlines". Defaults to "json"sending_stream (optional, email_sending only): "transactional" or "bulk"event_types (optional, email_sending only): array of delivery, soft_bounce, bounce, suspension, unsubscribe, open, spam_complaint, click, rejectdomain_id (optional, email_sending only): sending domain ID to scope this webhook toUpdate a webhook's mutable fields. webhook_type, sending_stream, and domain_id cannot be changed after creation — recreate the webhook if you need to change those.
Parameters:
webhook_id (required): ID of the webhook to updateurl (optional): New webhook URLactive (optional, boolean): Enable or disable the webhookpayload_format (optional): "json" or "jsonlines"event_types (optional, email_sending only): array of delivery, soft_bounce, bounce, suspension, unsubscribe, open, spam_complaint, click, rejectPermanently delete a webhook by ID. Returns the deleted webhook record.
Parameters:
webhook_id (required): ID of the webhook to deleteGet a contact by ID or email. Returns the full contact record (list memberships, status, custom fields).
Parameters:
contact_identifier (required): Contact ID or email addressCreate a new contact.
Parameters:
email (required): Email addressfields (optional): Custom field values keyed by merge tag (e.g. first_name). String, number, or boolean valueslist_ids (optional): IDs of contact lists to subscribe this contact tounsubscribed (optional, boolean): Create the contact in unsubscribed statusUpdate an existing contact identified by ID or email. list_ids replaces the contact's full membership set; list_ids_included/list_ids_excluded add/remove without disturbing the rest.
Parameters:
contact_identifier (required): Contact ID or emailemail (optional): New email addressfields (optional): Custom field values keyed by merge taglist_ids (optional): Replace membership set with this exact listlist_ids_included (optional): List IDs to add (additive)list_ids_excluded (optional): List IDs to removeunsubscribed (optional, boolean): Set to unsubscribed (true) or subscribed (false)Permanently delete a contact by ID or email. Returns the deleted contact record when the API responds with one; otherwise returns a confirmation payload.
Parameters:
contact_identifier (required): Contact ID or emailRecord a contact event against a contact (by ID or email). Used to trigger contact-list automations.
Parameters:
contact_identifier (required): Contact ID or emailname (required): Event name (matches automation triggers)params (required): Object of arbitrary key/value pairs. Values may be string, number, boolean, or nullList all contact lists for the account.
Parameters:
Get a contact list by ID.
Parameters:
list_id (required): ID of the contact list to fetchCreate a new contact list.
Parameters:
name (required): Name for the new listRename an existing contact list.
Parameters:
list_id (required): ID of the contact listname (required): New name for the listPermanently delete a contact list by ID.
Parameters:
list_id (required): ID of the contact list to deletegit clone https://github.com/mailtrap/mailtrap-mcp.git
cd mailtrap-mcp
npm install
[!TIP] See the location of the config file in the Setup section.
Add the following configuration:
{
"mcpServers": {
"mailtrap": {
"command": "node",
"args": ["/path/to/mailtrap-mcp/dist/index.js"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
If you are using asdf for managing Node.js you should use absolute path to executable:
(example for Mac)
{
"mcpServers": {
"mailtrap": {
"command": "/Users/<username>/.asdf/shims/node",
"args": ["/path/to/mailtrap-mcp/dist/index.js"],
"env": {
"PATH": "/Users/<username>/.asdf/shims:/usr/bin:/bin",
"ASDF_DIR": "/opt/homebrew/opt/asdf/libexec",
"ASDF_DATA_DIR": "/Users/<username>/.asdf",
"ASDF_NODEJS_VERSION": "20.6.1",
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
[!TIP] See the location of the config file in the Setup section.
{
"mcp": {
"servers": {
"mailtrap": {
"command": "node",
"args": ["/path/to/mailtrap-mcp/dist/index.js"],
"env": {
"MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
"DEFAULT_FROM_EMAIL": "your_sender@example.com",
"MAILTRAP_ACCOUNT_ID": "your_account_id",
"MAILTRAP_TEST_INBOX_ID": "your_test_inbox_id"
}
}
}
}
}
There are two ways to exercise a tool end-to-end against a real Mailtrap account: the MCP Inspector browser UI for interactive exploration, or its CLI mode for one-shot calls from the shell.
Both require the bundle to be built first:
npm run build
and MAILTRAP_API_TOKEN + MAILTRAP_ACCOUNT_ID exported in your shell (the mcp:cli script forwards both to the spawned server).
npm run dev
The Inspector prints a URL like http://localhost:6274. Open it, switch to the Tools tab, pick a tool (e.g. get-template), fill the parameters as JSON, and hit Run. The Mailtrap response appears in the panel below.
For one-shot calls without the UI, use npm run mcp:cli. Pass the Inspector's CLI flags after -- so npm forwards them verbatim:
# List all tools
npm run mcp:cli -- --method tools/list
# Call a tool — flags after the `--`
npm run mcp:cli -- \
--method tools/call \
--tool-name get-template \
--tool-arg template_id=12345
# Multiple --tool-arg flags for tools with several params
npm run mcp:cli -- \
--method tools/call \
--tool-name send-sending-domain-setup-instructions \
--tool-arg sending_domain_id=3938 \
--tool-arg email=devops@example.com
# Run the MCPB server directly
node dist/mcpb-server.js
# Or use the provided binary
mailtrap-mcpb-server
[!TIP] For development with the MCP Inspector:
npm run dev:mcpb
This server uses structured error handling aligned with MCP conventions:
VALIDATION_ERROR: Input validation failuresCONFIGURATION_ERROR: Missing or invalid configurationEXECUTION_ERROR: Runtime execution errorsTIMEOUT: Operation timeout (30 seconds default)Errors include actionable messages and are logged in structured form.
Structured JSON logs with levels: INFO, WARN, ERROR, DEBUG.
Enable debug logging by setting DEBUG=true.
# Example: enable debug logging
DEBUG=true node dist/mcpb-server.js
Important: The server writes logs to stderr so stdout remains reserved for JSON-RPC frames. This prevents hosts from encountering JSON parsing errors due to interleaved logs.
Log analysis example using jq:
# Filter error logs
node dist/mcpb-server.js 2>&1 | jq 'select(.level == "error")'
# Filter debug logs
node dist/mcpb-server.js 2>&1 | jq 'select(.level == "debug")'
Common issues:
MAILTRAP_API_TOKEN is settest_inbox_id in the tool call or set MAILTRAP_TEST_INBOX_ID envBug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The package is available as open source under the terms of the MIT License.
Everyone interacting in the Mailtrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
{
"mcpServers": {
"mailtrap": {
"command": "npx",
"args": [
"-y",
"mcp-mailtrap"
],
"env": {
"MAILTRAP_API_TOKEN": "<YOUR_API_TOKEN>",
"MAILTRAP_ACCOUNT_ID": "<YOUR_ACCOUNT_ID>",
"DEFAULT_FROM_EMAIL": "<DEFAULT_SENDER_EMAIL>",
"MAILTRAP_TEST_INBOX_ID": "<TEST_INBOX_ID>",
"MAILTRAP_SANDBOX_ID": "<SANDBOX_ID>"
}
}
}
}claude mcp add mailtrap npx -y mcp-mailtrap