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_get_accounts
Get accounts
List all Mailtrap accounts the API token has access to.
Parameters
Name
Type
Required
Description
No parameters required
mailtrap_clean_sandbox
Clean sandbox
mailtrap_create_sandbox
Create sandbox
mailtrap_create_contact
Create contact
mailtrap_create_template
Create template
mailtrap_create_api_token
Create API token
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.
ENGINEERING
DevOps assistant agent
Triage GitHub incidents, open Linear tickets, and notify the on-call channel in Slack with context already attached.
ENGINEERING
Auto-release notes agent
Group merged GitHub PRs by feature, fix, or chore and publish release notes per tag. No manual changelog grooming.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
Other connector libraries treat auth as a demo afterthought. Scalekit starts with identity, scope enforcement, and audit. Connectors follow.
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""
}
}
}