AgentMail Toolkit integrates OpenAI Agents SDK, Vercel AI SDK and Model Context Protocol (MCP) with the AgentMail API.
https://github.com/agentmail-to/agentmail-toolkitStop wrestling with email integrations every time you build an AI agent. The AgentMail Toolkit connects your OpenAI Agents, Vercel AI SDK applications, and MCP servers directly to email functionality through a single, unified interface.
You're building sophisticated AI agents, but when they need to send emails, reply to messages, or manage conversations, you're back to writing custom SMTP handlers, managing authentication, and debugging email delivery issues. Each framework has its own patterns, and email feels like an afterthought.
AgentMail Toolkit eliminates this friction by providing native MCP integration that works seamlessly with the agent frameworks you're already using.
Universal Agent Framework Support: Works with OpenAI Agents SDK, Vercel AI SDK, and any MCP-compatible system. Your agents can send emails, manage threads, and handle attachments without framework-specific workarounds.
MCP-Native Architecture: Built on Model Context Protocol from the ground up. Your agents get standardized email capabilities that integrate naturally with their existing context and tool calling mechanisms.
Dual Language Support: Complete implementations in both Python and Node.js, so you can use it regardless of your stack preference.
Customer Support Agents: Build agents that can read support emails, understand context, and send personalized responses while maintaining conversation history.
const client = new AgentMailClient({ apiKey: process.env.AGENTMAIL_API_KEY });
// Agent reads incoming support ticket and responds
const response = await client.messages.send({
to: '[email protected]',
subject: 'Re: Login Issues',
body: await generateResponse(supportTicket),
threadId: supportTicket.threadId
});
Marketing Automation: Create agents that analyze customer behavior and send targeted email campaigns based on real-time data analysis.
Internal Workflow Agents: Build agents that monitor system events and automatically notify team members via email when specific conditions are met.
Instead of bolting email functionality onto your existing agents, AgentMail Toolkit integrates at the protocol level. Your agents discover email capabilities through MCP's standard tool discovery mechanism. No custom API clients to maintain, no framework-specific email libraries to learn.
The toolkit handles authentication, delivery reliability, and conversation threading automatically. Your agents focus on intelligence; AgentMail handles the email infrastructure.
Clone the repository and choose your language:
git clone https://github.com/agentmail-to/agentmail-toolkit.git
cd agentmail-toolkit
# For Node.js projects
cd node && npm install
# For Python projects
cd python && pip install -r requirements.txt
Set your AgentMail API key and start building:
export AGENTMAIL_API_KEY="your_key_here"
Your existing MCP-compatible agents will automatically discover the email tools once you add the AgentMail server to your configuration.
Email remains the primary communication channel for business applications, but most AI agent frameworks treat it as a secondary concern. AgentMail Toolkit makes email a first-class capability in your agent architecture.
You get enterprise-grade email functionality without the complexity of managing SMTP servers, handling bounces, or tracking delivery status. Your agents can communicate as naturally via email as they do through chat interfaces.
Ready to give your agents proper email capabilities? The toolkit supports both rapid prototyping and production deployments, with the same API surface across Python and Node.js environments.