.M/MMultiMail

Framework integrations

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.

MCP-native frameworks

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 Desktop & Claude Code

MCP native

Claude has first-class MCP support. Add the MultiMail server to your config and Claude can send, read, and reply to email immediately.

Remote server (recommended — no install, works with Claude.ai too)
{
  "mcpServers": {
    "multimail": {
      "type": "url",
      "url": "https://mcp.multimail.dev/mcp"
    }
  }
}
Local server (stdio)
{
  "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.

OpenAI Agents SDK

MCP native

The OpenAI Agents SDK ships with built-in MCP support. MCP tools work the same way as native function tools.

Install: pip install openai-agents @multimail/mcp-server
Python
from 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")

LangChain / LangGraph

MCP native

The langchain-mcp-adapters package converts MCP tools into LangChain-compatible tools that work in any LangGraph agent.

Install: pip install langchain-mcp-adapters langgraph
Python
from 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 user@example.com"]
    })

LlamaIndex

MCP native

LlamaIndex supports MCP via the llama-index-tools-mcp package, which converts MCP server tools into LlamaIndex FunctionTool objects.

Install: pip install llama-index-tools-mcp
Python
from 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

MCP native

CrewAI supports MCP tools natively via the mcps field on agents. Install the MCP extra and point agents at the MultiMail server.

Install: pip install 'crewai-tools[mcp]'
Python
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 / Microsoft Agent Framework

MCP native

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.

Install: pip install autogen-ext-mcp
Python
from 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,
)

REST API

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.

Any language / HTTP client

REST API
Send an email
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": ["recipient@example.com"],
    "subject": "Hello from my agent",
    "body_text": "Sent via MultiMail REST API."
  }'
Check inbox
curl https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails?folder=inbox \
  -H "Authorization: Bearer YOUR_API_KEY"
Python (requests)
import requests

resp = requests.post(
    "https://api.multimail.dev/v1/mailboxes/MAILBOX_ID/emails",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "to": ["recipient@example.com"],
        "subject": "Hello from my agent",
        "body_text": "Sent via MultiMail REST API.",
    },
)
print(resp.json())
JavaScript (fetch)
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: ["recipient@example.com"],
      subject: "Hello from my agent",
      body_text: "Sent via MultiMail REST API.",
    }),
  }
);
const data = await resp.json();