Mailtrap

Live

API KEY

EMAIL TESTING

Developer Tools

Mailtrap gives agents authenticated access to email testing: manage sandbox inboxes, forward captured test emails, and manage contacts, templates, and API tokens.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Mailtrap
agent · Acme Q3
Run
Forward the latest captured signup email from the staging sandbox to me.
S
mailtrap_forward_message
88ms
Mailtrap agent
Forwarded the newest signup-confirmation email from sandbox 'staging' to your inbox.
Sources: 1 sandbox, 1 message
mailtrap
1 message
18:29
Message Claude...

Tools your dev agent reaches for on Mailtrap, scoped per user.

CALL ANY TOOL
Manage email testing end to end: sandbox inboxes, captured messages, contacts, and API tokens.
mailtrap_batch_send_bulk_email
Batch send bulk email
Send up to 500 marketing/bulk emails in a single API call via the Bulk Sending stream, each with its own recipients and content, optionally sharing base properties. Returns HTTP 200 even if individual messages fail -- check the per-message results for status.
Parameters
Name
Type
Required
Description
requests_json
string
Required
JSON array of individual email configurations (max 500), each with the same fields as a single send (from, to, subject, text/html, etc.).
base_json
string
Optional
JSON object of base properties shared by all emails in the batch (from, subject, text, html, category, template_uuid, etc.), used as defaults when not overridden per-request.
mailtrap_clean_sandbox
Clean sandbox
mailtrap_create_api_token
Create api token
mailtrap_create_contact_list
List create contact
mailtrap_create_domain
Create domain
mailtrap_create_project
Create project
mailtrap_create_suppression
Create suppression
mailtrap_delete_api_token
Delete api token
mailtrap_delete_email_campaign
Delete email campaign
mailtrap_delete_sandbox_message
Delete sandbox message
mailtrap_forward_sandbox_message
Forward sandbox message
mailtrap_get_accounts
Get accounts
mailtrap_get_contact
Get contact
mailtrap_get_domain
Get domain
mailtrap_get_email_log
Log get email
mailtrap_get_message_body_html
Get message body html
mailtrap_get_project
Get project
mailtrap_get_sending_stats
Get sending stats
mailtrap_get_stats_by_domain
Get stats by domain
mailtrap_list_account_accesses
List account accesses
mailtrap_list_contact_lists
List contact lists
mailtrap_list_email_logs
List email logs
mailtrap_list_message_attachments
List message attachments
mailtrap_list_sandboxes
List sandboxes
mailtrap_list_templates
List templates
mailtrap_reply_inbound_message
Reply inbound message
mailtrap_sandbox_send_email
Sandbox send email
mailtrap_start_email_campaign
Start email campaign
mailtrap_update_contact
Update contact
mailtrap_update_project
Update project

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Mailtrap tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mailtrap"], toolNames: [
    "mailtrap_get_accounts",
    "mailtrap_clean_sandbox",
    "mailtrap_create_sandbox"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Forward the latest signup email from the staging sandbox" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mailtrap"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Forward the latest signup email from the staging sandbox" }],
  tools,
});

// Execute the tool call with the user's vaulted mailtrap credential
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mailtrap"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Forward the latest signup email from the staging sandbox" }],
  tools,
});

// Tool call runs with the user's vaulted mailtrap credential
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["mailtrap"] }, pageSize: 100,
});

const agent = new Agent({
  name: "mailtrap_agent",
  model: "gemini-2.5-pro",
  instruction: "Mailtrap tools scoped to this user",
  tools,
});

await agent.run("Forward the latest signup email from the staging sandbox");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Mailtrap tool. Click to copy, paste into your agent, done.
Sandbox testing
Copy the prompt
Copied
Clean the staging sandbox before the next test run.
Copy the prompt
Copied
Create a new sandbox inbox named QA in project 12.
Copy the prompt
Copied
Forward the latest captured signup email to me.
Contacts and templates
Copy the prompt
Copied
Create a contact for jane@acme.com and add her to the Beta list.
Copy the prompt
Copied
Create an email template for password-reset emails.
Copy the prompt
Copied
List all contact lists in the account.
Account and tokens
Copy the prompt
Copied
List all Mailtrap accounts this token has access to.
Copy the prompt
Copied
Create a read-only API token named 'reporting'.
Copy the prompt
Copied
Add alice@acme.com to the suppression list.
SEE HOW AUTH WORKS
Your users connect once. Their Mailtrap credentials stay vaulted, every call is checked, and every action is logged.
1
Authorize
Your user connects
Mailtrap
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Mailtrap
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Mailtrap
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Mailtrap
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other dev-tools and email connectors.
GTM and RevOps Teams
Outbound prospecting agent
Searches Apollo for prospects matching your ICP, scores and ranks them, drafts personalized outreach in Gmail, and logs every send to Google Sheets. Mail goes out as the rep, not from a shared inbox.
Support and Ops Teams
Email-to-calendar agent
Reads scheduling intent out of Gmail threads, resolves the times everyone actually has free, and creates the event on the user's own Google Calendar. No shared service account.
GTM and RevOps Teams
CRM AI agent
Reads the Granola transcript after every call, extracts next steps and updates the HubSpot record, drafts the follow-up in Gmail, and confirms in Slack, all on the rep's own delegated OAuth.
Support and Ops Teams
Freshdesk CSAT agent
Watches Freshdesk for resolved tickets, emails each requester a CSAT survey from Gmail, and writes the score and the verbatim back onto the ticket, every call on the support rep's own delegated OAuth.
Test other agents
See the same per-user auth pattern across other dev-tools and email connectors.
SALES
Outbound prospecting agent
Search Apollo for ICP matches, rank them, draft personalised Gmail outreach, and log every send to Google Sheets.
OPS
Email-to-calendar scheduling agent
Read scheduling intent out of Gmail threads, resolve mutual free time, and create the Google Calendar event.
GTM
CRM AI agent
Turn each Granola call transcript into a HubSpot record update, a drafted Gmail follow-up, and a Slack recap.
SUPPORT
Freshdesk CSAT follow-up agent
Spot resolved Freshdesk tickets, email the CSAT survey from Gmail, and write the score back onto the ticket.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Mailtrap token looks fine in a demo. In production every test message looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Mailtrap today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Mailtrap as the user or through a shared key?
As the user. Scalekit resolves the credential of the person who triggered the agent at request time, so every Mailtrap action in your audit trail is attributed to a real user, not a shared service account.
Where is the Mailtrap token stored?
In an AES-256 encrypted vault with per-tenant namespacing. Tokens are resolved at request time, never enter LLM context, refresh automatically, and can be revoked from one dashboard.
Can I limit what the agent does in Mailtrap?
Yes. Filter by tool name in listScopedTools to expose only what you want. Scalekit also enforces scope checks before every API call.
What happens when a user revokes access?
The credential is invalidated at the next tool call. The call fails closed, other users' connections are unaffected, and the revocation is logged in the audit chain.
Can the agent send real production email through Mailtrap?
Mailtrap's sandbox tools capture test email without delivering it; sending tools operate on your configured sending domains. Scope listScopedTools to sandbox-only tools if you want the agent restricted to testing.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""mailtrap"": {
""url"": ""https://mcp.scalekit.com/mailtrap"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.mailtrap]
url = ""https://mcp.scalekit.com/mailtrap""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""mailtrap"": {
""url"": ""https://mcp.scalekit.com/mailtrap"",
""type"": ""http""
}
}
}