How It Works

Haystack (deepset's framework, 3.0 as of July 2026) ships an official MCP integration: the mcp-haystack package provides MCPToolset, which connects to any MCP server and exposes its tools to Haystack's Agent component. Dead Simple Email runs a hosted MCP server at https://api.deadsimple.email/mcp, authenticated with your API key in an Authorization header — connect the two and your agent gets full email capabilities.

Straight answer on packaging: we do not ship a dedicated Haystack integration as of August 2026. The two supported paths are the official mcp-haystack route below, or a custom tool wrapping our Python SDK — also below.

Quick Start: MCPToolset

terminal
pip install haystack-ai mcp-haystack
email_agent.py
import os
from haystack.components.agents import Agent
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.dataclasses import ChatMessage
from haystack_integrations.tools.mcp import MCPToolset, StreamableHttpServerInfo

server_info = StreamableHttpServerInfo(
    url="https://api.deadsimple.email/mcp",
    headers={"Authorization": f"Bearer {os.environ['DSE_API_KEY']}"},
)
email_toolset = MCPToolset(server_info=server_info)

agent = Agent(
    chat_generator=OpenAIChatGenerator(model="gpt-4o"),
    tools=email_toolset,
    system_prompt="You manage email with Dead Simple Email.",
)

result = agent.run(
    messages=[ChatMessage.from_user("Create an inbox and send a hello email to team@example.com")]
)
print(result["last_message"].text)

MCPToolset discovers all 14 tools at construction time: create_inbox, list_inboxes, delete_inbox, send_email, read_messages, read_message, reply_to_message, forward_message, wait_for_email, get_verification_code, get_verification_link, list_threads, read_thread, and get_usage.

Want a narrower surface? Pass tool_names=["send_email", "read_messages"] to load only what the agent needs. And since a toolset is just tools, the same object plugs into a ToolInvoker inside a classic Haystack pipeline too.

Alternative: A Custom Tool Around the SDK

For a single, tightly-controlled capability, wrap the Python SDK with Haystack's @tool decorator — the schema is generated from the signature and docstring:

custom_tool.py
# pip install haystack-ai deadsimple-email
from haystack.components.agents import Agent
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.tools import tool
from deadsimple import DeadSimple

client = DeadSimple(api_key="dse_your_api_key")

@tool
def send_email(inbox_id: str, to: str, subject: str, body: str) -> str:
    """Send an email from a Dead Simple Email inbox.

    :param inbox_id: ID of the inbox to send from.
    :param to: Recipient email address.
    :param subject: Subject line.
    :param body: Plain-text body of the email.
    """
    result = client.messages.send(inbox_id, to, subject, text_body=body)
    return f"Sent: {result.message_id}"

agent = Agent(
    chat_generator=OpenAIChatGenerator(model="gpt-4o"),
    tools=[send_email],
)

The same pattern wraps client.inboxes.create(), client.messages.wait_for() (ideal for verification flows), or client.threads reads for RAG over conversations. Mix custom tools and the MCP toolset in the same agent if you want both control and coverage.

Frequently Asked Questions

Yes. Haystack's official MCP integration (pip install mcp-haystack) provides MCPToolset, which connects to our hosted MCP server over streamable HTTP and loads 14 email tools into any Haystack Agent.

No dedicated Haystack integration package exists as of August 2026. The supported paths are MCPToolset via the official mcp-haystack package, or a custom tool wrapping our Python SDK — both shown on this page.

Yes. Haystack 3.0 (released July 2026) keeps the Agent and Tool abstractions these examples use, and mcp-haystack continues to provide MCPToolset. The examples target Haystack 2.x/3.x — not Haystack 1.x.

Yes. MCPToolset accepts a tool_names argument, so a support agent can get just send_email and read_messages instead of all 14 tools.

Yes. The free tier includes 5 inboxes and 5,000 emails per month, requires no credit card, and does not expire.

Ready to build?

Free tier: 5 inboxes and 5,000 emails a month. No credit card required.

API Reference Get Started Free