4,500+ servers built on MCP Fusion
Vinkius
Mailosaur logo
Vinkius
LangChain logo

How to Use the Mailosaur MCP in LangChain

Verify transactional emails and SMS flows programmatically inside your LangChain chains without manual inbox checks.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

Mailosaur MCP on Cursor AI Code Editor MCP Client Mailosaur MCP on Claude Desktop App MCP Integration Mailosaur MCP on OpenAI Agents SDK MCP Compatible Mailosaur MCP on Visual Studio Code MCP Extension Client Mailosaur MCP on GitHub Copilot AI Agent MCP Integration Mailosaur MCP on Google Gemini AI MCP Integration Mailosaur MCP on Lovable AI Development MCP Client Mailosaur MCP on Mistral AI Agents MCP Compatible Mailosaur MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
LangChain

Connect Mailosaur MCP to LangChain

Create your Vinkius account to connect Mailosaur to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Chain-linked verification with the Mailosaur MCP Server

The `list_virtual_servers` tool is the starting point for identifying the test environments your agent needs to inspect. By feeding the active server IDs straight into the next link of your LangChain pipeline, your agent can dynamically target the correct environment without hardcoded values. You get a direct, observable flow where the output of your server check dictates where the agent looks next. This setup shines when you use `list_server_messages` to pull the latest incoming traffic right after a signup action. LangSmith tracks every step of this execution, showing you the exact latency of the API call and the raw payload returned. No guesswork, just clear tracing of how your chain handles external email data.

Automated message parsing and extraction

The `get_message_content` tool retrieves the full payload of any email or SMS message to let your agent extract verification codes or reset links. Instead of writing complex regex wrappers, you let your ReAct agent analyze the raw HTML or text body directly. It extracts the token, passes it to the next step in your chain, and completes the sign-up flow. If you need to narrow down the noise, `search_server_messages` filters the inbox using your MCP client. This prevents your agent from processing irrelevant messages. It keeps token usage low and avoids wasting API calls on stale test runs.

Ephemeral test environment management

The `create_virtual_server` tool builds isolated, on-demand inboxes for parallel test runs in your CI/CD pipeline. Your agent can spin up a fresh inbox for a specific test suite, run the checks, and then tear it down. This prevents parallel tests from stepping on each other's toes or reading dirty data. Once your tests finish, `clear_server_inbox` wipes the server clean, while `delete_specific_message` targets individual test runs for cleanup. Keeping your test servers clean ensures subsequent runs don't fail due to stale verification emails from previous builds.

Setup guide

Set up Mailosaur MCP in LangChain

Prerequisites

  • Python 3.10+ installed
  • langchain-mcp-adapters + langgraph packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChain BaseTool objects.

  2. 2

    Connect via HTTP transport

    Use MultiServerMCPClient with "transport": "http" pointing to your Vinkius endpoint. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Create a ReAct agent

    Pass the discovered tools to create_react_agent() from LangGraph. The agent automatically routes Mailosaur tool calls through the MCP protocol.

  4. 4

    Run with any LLM

    Swap ChatOpenAI for ChatAnthropic, ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.

agent.py
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

async with MultiServerMCPClient({
    "mailosaur-mcp": {
        "transport": "http",
        "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
    }
}) as client:
    tools = client.get_tools()

    agent = create_react_agent(
        ChatOpenAI(model="gpt-4o"),
        tools,
    )
    result = await agent.ainvoke({
        "messages": "List recent Mailosaur transactions"
    })
    print(result["messages"][-1].content)

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Mailosaur. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about Mailosaur MCP in LangChain

You handle this by combining a retry loop in your chain with `search_server_messages` via the MCP connection. The agent can poll the Mailosaur API until the target message arrives, using specific criteria like recipient or subject line to avoid grabbing old data.
Yes, you can do this. You use `list_server_messages` to fetch the SMS payload sent to your virtual number. Your agent then parses the SMS body, extracts the numeric code, and feeds it directly into the next step of your chain.
LangSmith logs every single tool execution, including input parameters for tools like `get_message_content` and the exact JSON returned. If a test fails because an email didn't arrive, you can inspect the trace to see if the query timed out or if the server ID was incorrect.
Run `clear_server_inbox` at the end of your test suite execution. This wipes all messages from the virtual server instantly, ensuring the next test run starts with a completely empty inbox.
This MCP server runs locally within a secure sandbox and only communicates with the Mailosaur API using your API key. Your actual email and SMS message content, along with virtual server metadata, are never stored or exposed to external third parties.

Start using the Mailosaur MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 8 tools

We've already built the connector for Mailosaur. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 8 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.