MultiMail works with any AI agent framework via MCP or REST API.
The @multimail/mcp-server npm package is the primary integration layer. Frameworks that support MCP tools get full MultiMail access with zero custom code.
These frameworks can use MultiMail MCP tools directly. Install the MCP server, point your framework at it,
and your agent gets send_email, check_inbox, read_email,
reply_email, and more.
Claude has first-class MCP support. Add the MultiMail server to your config and Claude can send, read, and reply to email immediately.
{
"mcpServers": {
"multimail": {
"type": "url",
"url": "https://mcp.multimail.dev/mcp"
}
}
}{
"mcpServers": {
"multimail": {
"command": "npx",
"args": ["@multimail/mcp-server"],
"env": {
"MULTIMAIL_API_KEY": "your-api-key",
"MULTIMAIL_MAILBOX_ID": "your-mailbox-id"
}
}
}
}
For Claude Code, add the same config to .mcp.json in your project root or ~/.claude/mcp.json globally.
The OpenAI Agents SDK ships with built-in MCP support. MCP tools work the same way as native function tools.
pip install openai-agents @multimail/mcp-serverfrom agents import Agent from agents.mcp import MCPServerStdio # Connect to MultiMail MCP server multimail = MCPServerStdio( command="npx", args=["@multimail/mcp-server"], env={ "MULTIMAIL_API_KEY": "your-api-key", "MULTIMAIL_MAILBOX_ID": "your-mailbox-id", }, ) agent = Agent( name="Email Assistant", instructions="You help the user manage email.", mcp_servers=[multimail], ) async with multimail: result = await agent.run("Check my inbox and summarize new emails")
The langchain-mcp-adapters package converts MCP tools into LangChain-compatible tools
that work in any LangGraph agent.
pip install langchain-mcp-adapters langgraphfrom langchain_mcp_adapters.client import MultiServerMCPClient from langgraph.prebuilt import create_react_agent from langchain_openai import ChatOpenAI llm = ChatOpenAI(model="gpt-4o") async with MultiServerMCPClient({ "multimail": { "command": "npx", "args": ["@multimail/mcp-server"], "env": { "MULTIMAIL_API_KEY": "your-api-key", "MULTIMAIL_MAILBOX_ID": "your-mailbox-id", }, } }) as client: tools = client.get_tools() agent = create_react_agent(llm, tools) result = await agent.ainvoke({ "messages": ["Send a welcome email to [email protected]"] })
LlamaIndex supports MCP via the llama-index-tools-mcp package,
which converts MCP server tools into LlamaIndex FunctionTool objects.
pip install llama-index-tools-mcpfrom llama_index.tools.mcp import BasicMCPClient, McpToolSpec # Connect to MultiMail MCP server via stdio mcp_client = BasicMCPClient( command="npx", args=["@multimail/mcp-server"], env={ "MULTIMAIL_API_KEY": "your-api-key", "MULTIMAIL_MAILBOX_ID": "your-mailbox-id", }, ) tool_spec = McpToolSpec(client=mcp_client) tools = tool_spec.to_tool_list() # Use in any LlamaIndex agent from llama_index.agent.openai import OpenAIAgent agent = OpenAIAgent.from_tools(tools) response = agent.chat("Check my inbox")
CrewAI supports MCP tools natively via the mcps field on agents.
Install the MCP extra and point agents at the MultiMail server.
pip install 'crewai-tools[mcp]'from crewai import Agent, Task, Crew email_agent = Agent( role="Email Manager", goal="Send and manage emails for the team", backstory="You manage all outbound email communication.", mcps=[{ "command": "npx", "args": ["@multimail/mcp-server"], "env": { "MULTIMAIL_API_KEY": "your-api-key", "MULTIMAIL_MAILBOX_ID": "your-mailbox-id", }, }], ) task = Task( description="Send a project update email to the team", agent=email_agent, ) crew = Crew(agents=[email_agent], tasks=[task]) result = crew.kickoff()
AutoGen supports MCP tools via the autogen-ext-mcp package, which wraps MCP servers
running over stdio or SSE and makes them available as AutoGen tools.
pip install autogen-ext-mcpfrom autogen_ext.tools.mcp import StdioMCPToolAdapter, StdioServerParams # Wrap MultiMail MCP server as AutoGen tools server_params = StdioServerParams( command="npx", args=["@multimail/mcp-server"], env={ "MULTIMAIL_API_KEY": "your-api-key", "MULTIMAIL_MAILBOX_ID": "your-mailbox-id", }, ) # Get tools and use in any AutoGen agent adapter = StdioMCPToolAdapter(server_params) tools = await adapter.get_tools() from autogen_agentchat.agents import AssistantAgent agent = AssistantAgent( name="email_agent", tools=tools, )
Any framework or language can use MultiMail via the REST API at api.multimail.dev.
If your framework does not support MCP, or if you prefer direct HTTP calls, the REST API
provides the same capabilities.
See the full API docs for all endpoints.
curl -X POST https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": ["[email protected]"], "subject": "Hello from my agent", "body_text": "Sent via MultiMail REST API." }'
curl https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails?folder=inbox \ -H "Authorization: Bearer YOUR_API_KEY"
import requests resp = requests.post( "https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "to": ["[email protected]"], "subject": "Hello from my agent", "body_text": "Sent via MultiMail REST API.", }, ) print(resp.json())
const resp = await fetch( "https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ to: ["[email protected]"], subject: "Hello from my agent", body_text: "Sent via MultiMail REST API.", }), } ); const data = await resp.json();