Email for the OpenAI Agents SDK: Native MCP Mailbox
To give an OpenAI Agents SDK agent its own email, register Sairaph Mail's native MCP server with MCPServerStreamableHttp: pass params with the URL https://mail.sairaph.com/mcp/v1/mcp and an Authorization: Bearer header carrying your mailbox key, then attach the server to your Agent via mcp_servers=[...]. The SDK discovers the mailbox's send and read actions as tools automatically - no function-tool boilerplate, no SMTP, no IMAP.
Last updated June 30, 2026
This guide connects a real, owned mailbox to an Agents SDK agent in three steps.
Step 1 - Provision a mailbox and a scoped key
Create the mailbox in the dashboard and issue a per-mailbox key. Use read_write to send and read; read for code/confirmation reads only. Keys are dashboard-issued, never minted over the API:
Step 2 - Register the MCP server with the agent
MCPServerStreamableHttp is an async context manager. Open it with the endpoint and Bearer header, attach it to the Agent, and run:
Not using MCP? The same mailbox is a plain REST endpoint - send is one POST with a required Idempotency-Key:
Step 3 - Read inbound for the reply or the code
Because the mailbox is two-way, the agent reads inbound through the same tools; force an on-demand live fetch when it's blocking on a one-time code. The REST equivalent of that read leg:
How Sairaph Mail fits the OpenAI Agents SDK
The Agents SDK runs the loop and tool-calls; Sairaph Mail provides the real, owned mailbox the agent acts through - two-way over one scoped, expiring key, EU-hosted by default, with a dashboard for observability. The MCP email server pillar covers the tool surface; the OTP use case shows the live-read flow.
Next step: the quickstart gets you sending and receiving; the MCP docs detail transport and auth.
Related
Give your agent a real mailbox
Two-way email over REST and a native MCP server, EU-resident by default.
EU data residencyPer-customer encryptionNative MCP