# MailSlurp MCP for AI Agents AI Agent Connect

> MailSlurp lets you automate email testing and manage temporary inboxes through an AI agent. It handles creating virtual addresses, sending messages, and polling for incoming emails, making it a core tool for verifying registration flows and transactional alerts without cluttering your real inbox.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_vRBUT7cwmQBHCE8gG9ntobAaiC1YlLQ1uk7HJChy/ai-agent-connect
- **Tags:** email-testing, virtual-inbox, disposable-email, automated-testing, email-automation, message-parsing

## Description

Testing how your app sends emails usually involves a mess of temporary accounts and manual checking. You have to sign up for a new service, wait for a confirmation code, and then copy-paste it into a form. It's slow and breaks your flow. MailSlurp changes that by letting your agent handle the whole cycle. You can tell your agent to grab a fresh email address, send a sign-up request, and then just wait until that confirmation hits the inbox. Once it arrives, the agent reads the content and moves on to the next step. It handles the long-polling for you, so you don't have to keep refreshing a page. Whether you're verifying a new user flow or checking if a password reset actually sent, this Connector makes the process invisible. It's a solid way to keep your testing environment clean and your deployment pipeline moving. You'll find it's a lot easier to manage when you're using the Vinkius catalog to connect all your dev tools in one place.

## Tools

### create_random_inbox
Generate a new random email address. Use this to keep your test data completely isolated.

### delete_specific_inbox
Remove a specific inbox and all its messages. Use this to keep your account organized.

### list_inbox_emails
See a list of all emails in a specific inbox. Use this to check if messages are arriving.

### get_email_details
Get the full content of a single email. This lets you read the actual text or HTML body.

### list_all_inboxes
See every virtual inbox in your account. Use this to manage your existing test addresses.

### send_email_from_inbox
Send a message from a MailSlurp address. This is perfect for testing outbound notifications.

### wait_for_email_count
Pause the agent until a certain number of emails arrive. This prevents the agent from moving too fast.

### wait_for_latest_email
Wait for a new message to land in the inbox. This is the best way to handle asynchronous flows.

## Prompt Examples

**Prompt:** 
```
I need to test the new registration flow. Can you get a random inbox, sign up as 'testuser', and wait for the confirmation email?
```

**Response:** 
```
I've set up the test. Here is the status:

*   **Virtual Inbox:** `test-user-99@mailslurp.com`
*   **Action:** Registration request sent.
*   **Status:** Waiting for confirmation email...

[Connection held] ...

**Success!** I've received the email. The confirmation link is: `https://app.com/verify?token=xyz123`.
```

**Prompt:** 
```
Send a test notification to user@example.com from a virtual address and let me know when it's sent.
```

**Response:** 
```
I've sent that notification for you. 

*   **From:** `outbound-test@mailslurp.com`
*   **To:** `user@example.com`
*   **Status:** Delivered to outbound queue.

I'll keep an eye on the logs if you need further confirmation.
```

**Prompt:** 
```
Check if the latest email in my test inbox contains a 6-digit verification code.
```

**Response:** 
```
Checking the latest message in your test inbox now...

**Message Found:**
*   **Subject:** Your Verification Code
*   **Content:** Your code is **882910**.

I've extracted the code for you. Would you like me to proceed with the login?
```

## Capabilities

### Create random email addresses
Get a fresh virtual inbox instantly for a new test run.

### Wait for incoming messages
Tell your agent to pause until a specific email count is reached.

### Inspect full email bodies
Read both the HTML and plain text versions of received messages.

### Send outbound messages
Trigger emails from your virtual addresses to any recipient.

### Delete old inboxes
Clean up your test environment by removing used addresses.

### Fetch technical headers
Grab metadata to verify delivery paths and server details.

## Use Cases

### Automated 2FA Verification
A QA engineer needs to test a Forgot Password flow. They ask the agent to create a random inbox, trigger the reset, and wait for the email to arrive to grab the link.

### Notification Layout Testing
A developer is building a notification system. They use the agent to send a test email from a virtual address to see how the layout renders on mobile.

### Transactional Alert Auditing
A product team wants to audit their automated alerts. They ask the agent to list all inboxes and check the latest messages for correct branding.

### Multi-Step Flow Validation
An automated test suite needs to verify that a user receives three separate confirmation emails. The agent uses wait_for_email_count to ensure all three arrive before proceeding.

## Benefits

- Automate 2FA flows by using wait_for_latest_email to grab codes instantly.
- Keep your production inbox clean by using create_random_inbox for every new test.
- Verify email formatting with get_email_details to check both HTML and text.
- Speed up QA cycles by using wait_for_email_count to trigger multi-step flows.
- Clean up test data automatically with delete_specific_inbox after a run finishes.
- Audit delivery paths by inspecting headers with get_email_details.

## How It Works

The bottom line is you get a fully automated way to test email flows without manual intervention.

1. Connect your MailSlurp API key to your AI client.
2. Ask your agent to create a random inbox and trigger a test event.
3. The agent monitors the inbox and reports back the content as soon as it arrives.

## Frequently Asked Questions

**Can MailSlurp help me automate 2FA codes?**
Yes, the agent can wait for a new email to arrive and then extract the code for you automatically.

**How do I keep my personal inbox from getting cluttered?**
You can use the random inbox tool to create unique addresses for every single test run, keeping your personal mail completely separate.

**Does this work for testing HTML emails?**
Yes, the agent can retrieve the full HTML content so you can verify the layout and styling of your emails.

**Can I send emails from these virtual addresses?**
You can send outbound messages from any of your MailSlurp inboxes to test your notification logic and delivery.

**Is there a way to wait for multiple emails?**
You can tell the agent to pause until a specific number of messages have arrived in the inbox before moving to the next step.

**How do I clean up my test addresses?**
You can tell the agent to delete specific inboxes once your testing is finished to keep your account organized and tidy.

**How do I find my Inbox ID?**
Use the `list_all_inboxes` tool to see a comprehensive list of all your MailSlurp addresses along with their unique IDs.

**What is the benefit of the 'wait-for' tools?**
They hold the connection until an email arrives, making it easy to test asynchronous processes (like password resets) without writing complex retry loops.

**Where do I find my API Key?**
Log in to your MailSlurp dashboard and copy the API key from the Home or API Settings section.