How to Use the AgentMail MCP in OpenAI Agents SDK
Give your OpenAI Agents their own email inboxes to send, read, and manage messages in production.
Works with every AI agent you already use
…and any MCP-compatible client
Connect AgentMail MCP to OpenAI Agents SDK
Create your Vinkius account to connect AgentMail to OpenAI Agents SDK and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Autonomous Email for Agents
Your agent can spin up its own email inboxes on the fly. Use `create_inbox` to generate a new address, maybe even on a custom domain you own. When it's done, `delete_inbox` cleans it all up. The OpenAI Agents SDK automatically discovers these tools. You just point it to the MCP server endpoint and your agents know how to `list_inboxes` and `get_inbox` details without any manual mapping. It's built for systems where multiple agents might need to coordinate over email.
Process Email with OpenAI Agents
Agents can read their mail. They start with `list_threads` to see what's new in an inbox, then use `get_thread` to pull a full conversation. This lets them follow a discussion before acting. If a message has a file, `get_attachment` pulls it down. The SDK's tracing means you can see every step in your OpenAI dashboard, watching exactly how an agent parsed an invoice or processed a support ticket from an email.
Let Agents Handle Correspondence
Your agents can now handle their own email communication. A `send_message` call fires off a new email. For existing conversations, `reply_to_message` keeps the thread intact, just like a person would. The SDK's guardrails are the real advantage here. You can set rules to prevent an agent from sending emails to the wrong address or forwarding sensitive data. It gives you the safety to let agents `forward_message` with confidence.
Set up AgentMail MCP in OpenAI Agents SDK
Prerequisites
- Python 3.10+ installed
-
openai-agentspackage (pip install openai-agents) - Active Vinkius subscription with a valid endpoint token
- 1
Install the SDK
Run
pip install openai-agentsto install the OpenAI Agents SDK. The MCP integration is built-in — no extra dependencies needed. - 2
Connect via SSE transport
Use
MCPServerSsewith your Vinkius endpoint URL. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. The SDK auto-discovers all AgentMail tools at runtime. - 3
Create your Agent
Pass the MCP to
Agent(mcp_servers=[server]). The agent receives AgentMail tools as native definitions — JSON schemas resolve automatically. - 4
Run the agent
Call
Runner.run(agent, prompt)to execute. The agent invokes the appropriate AgentMail tools and returns structured results. Copy the full example on the right to get started.
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerSse
async def main():
async with MCPServerSse(
url="https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
) as server:
agent = Agent(
name="AgentMail Agent",
instructions="You have access to AgentMail tools.",
mcp_servers=[server],
)
result = await Runner.run(agent, "List recent transactions")
print(result.final_output)
asyncio.run(main()) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by AgentMail. 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 AgentMail MCP in OpenAI Agents SDK
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the AgentMail MCP today
We host it, we monitor it, we maintain it. You just paste one token.