Appearance
MCP Configuration
Mailisk supports the Model Context Protocol (MCP), allowing coding agents and automation tools to create test email addresses and wait for inbound messages through Mailisk.
The hosted MCP endpoint is:
txt
https://api.mailisk.com/mcpRequirements
To configure MCP you need:
- A Mailisk organisation on a paid plan
- Organisation owner or admin access
- An MCP API key created in the Mailisk dashboard
MCP API keys are separate from regular Mailisk REST API keys. They start with sk_mcp_ and can be scoped to specific MCP capabilities.
Create an MCP API key
- Open MCP in the dashboard.
- Choose the organisation you want the agent to access.
- Click Create MCP key.
- Choose the scopes the key should have.
- Copy the generated secret immediately. It is only shown once.
The available scopes are:
namespace:read: list namespaces and read namespace metadataemail:read: search and wait for inbound emails
Most agents need both scopes so they can generate recipient addresses and wait for the matching email.
Configure Codex
For Codex, add Mailisk to ~/.codex/config.toml:
toml
[mcp_servers.mailisk]
enabled = true
url = "https://api.mailisk.com/mcp"
[mcp_servers.mailisk.http_headers]
Authorization = "Bearer sk_mcp_YOUR_API_KEY"Replace sk_mcp_YOUR_API_KEY with the MCP API key secret from the dashboard.
Generic MCP client config
Some MCP clients use JSON configuration. For those clients, use:
json
{
"mcpServers": {
"mailisk": {
"url": "https://api.mailisk.com/mcp",
"headers": {
"Authorization": "Bearer sk_mcp_YOUR_API_KEY"
}
}
}
}Available tools
Once configured, Mailisk exposes these MCP tools:
create_email_address: generates a unique recipient address in an existing Mailisk namespace. Use the returnedemail_addressin the app or test flow that sends email.wait_for_email: waits for an inbound email sent to the generated address. Pass theto_addr_prefix,namespace, andfrom_timestampreturned bycreate_email_address.get_email: fetches a known email bynamespace,email_id, andreceived_timestamp. Use thenamespace,email.id, andreceived_timestampreturned bywait_for_email. The response shape matcheswait_for_email.
By default, wait_for_email and get_email return compact email metadata, code candidates in extracted.codes, and URL candidates in extracted.urls parsed from the plain-text body. Treat these as candidates in source order, not guaranteed answers. They do not return the full text or html body unless requested.
Typical flow:
- Ask the agent to call
create_email_address. - Use the returned
email_addressin the app or test flow that sends email. - Ask the agent to call
wait_for_emailwith the returnednamespace,to_addr_prefix, andfrom_timestamp.
Most agents should be able to automatically do these steps as needed.
The returned from_timestamp includes a small lookback from when the address was generated. This helps avoid missing emails that arrive immediately after the app action starts.
If you need the email body, pass include_text: true for the truncated plain-text body or include_html: true for the truncated HTML body. Prefer the default response for clear OTP and verification-code flows so agents avoid loading large email templates into context.
Mailisk does not send the email for you. Your app, test, or CI workflow must send the email to the generated address.
Troubleshooting
- If authentication fails, confirm the key starts with
sk_mcp_and is sent asAuthorization: Bearer .... - If the client connects but tools fail, confirm the key has both
namespace:readandemail:readscopes. - If access is forbidden, confirm the selected organisation has MCP access enabled on its plan.
- If no email is found, make sure the message was sent after the
from_timestampreturned bycreate_email_address.
