/agentmail:agentmail-toolkitfrom AgentMail
Adds AgentMail email tools to agent frameworks including Vercel AI SDK, LangChain, OpenAI Agents SDK, LiveKit Agents, and MCP adapters. Supports TypeScript and Python.
Ships in AgentMail. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Install the toolkit for the selected language and set AGENTMAIL_API_KEY.
npm install agentmail-toolkit
pip install agentmail-toolkit
The TypeScript and Python packages can expose different tool sets and can release on different schedules. Discover the installed package's tool catalog at runtime instead of trusting a hardcoded list:
new AgentMailToolkit().getTools().map((tool) => tool.name)
[tool.name for tool in AgentMailToolkit().get_tools()]
import { openai } from "@ai-sdk/openai";
import { streamText } from "ai";
import { AgentMailToolkit } from "agentmail-toolkit/ai-sdk";
const toolkit = new AgentMailToolkit();
const result = await streamText({
model: openai(process.env.OPENAI_MODEL!),
messages,
system: "Use email tools only when the user authorizes the external action.",
tools: toolkit.getTools(),
});
import { createAgent } from "langchain";
import { AgentMailToolkit } from "agentmail-toolkit/langchain";
const agent = createAgent({
model: process.env.LANGCHAIN_MODEL!,
tools: new AgentMailToolkit().getTools(),
systemPrompt: "Use email tools only when the user authorizes the external action.",
});
import { AgentMailToolkit } from "agentmail-toolkit/mcp";
const tools = new AgentMailToolkit().getTools();
Each tool provides a name, title, description, input schema, output schema, callback, and complete annotations for registration on your own MCP server. On a successful call the MCP adapter returns structuredContent (validated against the output schema) alongside the JSON text block; on failure it returns an isError result. The Python package does not ship an MCP adapter.
import { AgentMailClient } from "agentmail";
import { AgentMailToolkit } from "agentmail-toolkit/ai-sdk";
const client = new AgentMailClient({ apiKey: process.env.AGENTMAIL_API_KEY });
const toolkit = new AgentMailToolkit(client);
The toolkit constructor takes an existing SDK client as its only argument — it does not accept an { apiKey } options object directly. Construct the SDK client first, then pass it in.
from agentmail_toolkit.openai import AgentMailToolkit
from agents import Agent
agent = Agent(
name="Email Agent",
instructions="Use email tools only when the user authorizes the external action.",
tools=AgentMailToolkit().get_tools(),
)
from agentmail import AgentMail
from agentmail_toolkit.openai import AgentMailToolkit
client = AgentMail()
toolkit = AgentMailToolkit(client=client)
The toolkit constructor takes an existing SDK client as its only argument — it does not accept an api_key option directly. Construct the SDK client first, then pass it in.
import os
from agentmail_toolkit.langchain import AgentMailToolkit
from langchain.agents import create_agent
agent = create_agent(
model=os.environ["LANGCHAIN_MODEL"],
tools=AgentMailToolkit().get_tools(),
system_prompt="Use email tools only when the user authorizes the external action.",
)
from agentmail import AgentMail
from agentmail_toolkit.livekit import AgentMailToolkit
from livekit.agents import Agent
class EmailAssistant(Agent):
def __init__(self) -> None:
client = AgentMail()
super().__init__(
instructions="Handle email only when explicitly requested.",
tools=AgentMailToolkit(client=client).get_tools(),
)
Subclass the LiveKit Agent and pass instructions and toolkit tools through super().__init__.
Requires toolkit TypeScript >= 0.5.0 or Python >= 0.3.0.
structuredContent plus a matching JSON text block on success; void operations (deletes) return a stable { success: true } object.isError: true. Do not treat a returned value as an error string; catch the thrown error or check isError.| Framework | TypeScript Import | Python Import |
|---|---|---|
| Vercel AI SDK | from 'agentmail-toolkit/ai-sdk' | - |
| LangChain | from 'agentmail-toolkit/langchain' | from agentmail_toolkit.langchain import AgentMailToolkit |
| Clawdbot | from 'agentmail-toolkit/clawdbot' | - |
| OpenAI Agents SDK | - | from agentmail_toolkit.openai import AgentMailToolkit |
| LiveKit Agents | - | from agentmail_toolkit.livekit import AgentMailToolkit |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub agentmail-to/agentmail-plugins --plugin agentmail9 skills in this plugin
/agent-email-patternsArchitecture patterns for AI agents that communicate over email -- why agents need dedicated inboxes rather than human email accounts, infrastructure/provider tradeoffs, one-inbox-per-agent, two-way conversation loops, human-in-the-loop drafts, WebSocket vs webhook event design, multi-agent topologies, OTP flows, and the threat model (prompt injection, webhook spoofing, credential exposure, data leakage). Use when designing how agents send, receive, and manage email conversations, evaluating whether an agent needs email, or choosing an email provider; do not use for AgentMail SDK method calls or basic send/receive implementation./agentidCreate accounts for an agent at third-party services with AgentID, using an AgentMail inbox as the agent's identity, and see where each inbox already has an account. Use for ANY request like "create an account at Firecrawl", "sign my agent up for Turso", "get my agent a web search API", "log my agent back in to Firecrawl", "sign in with the auth token this page shows", "which services is this inbox signed up for?", or browsing the AgentID app marketplace. Do not use for sending or reading mail (send-email, check-email), inbox lifecycle on its own (manage-inboxes), or MCP connection setup (agentmail-mcp)./agentmailBuild with the AgentMail TypeScript or Python SDK for inbox, message, thread, draft, attachment, domain, allow/block list, pod, webhook, and WebSocket workflows, including programmatic agent sign-up, domain/DNS administration, and deliverability triage (bounces, spam, blocked mail). Use when implementing or reviewing AgentMail API code; do not use for direct mailbox operations, CLI usage, MCP setup, or framework-toolkit integration./agentmail-cliOperate AgentMail from a shell with the official CLI. Use when the user wants commands for listing or creating inboxes, reading or searching mail, sending or replying, managing drafts, or scripting JSON/YAML output; do not use for SDK code, MCP setup, or framework adapters./agentmail-mcpConfigure or troubleshoot the hosted AgentMail MCP server for Codex, Claude Code, Cursor, Claude.ai, ChatGPT, or another Streamable HTTP MCP client. Use for installation, OAuth, API-key headers, connection failures, or MCP tool discovery. Do not use when the connection already works and the user just wants to send, check, or manage mail — use the sibling action skills for that./check-emailRead, search, summarize, and triage AgentMail inboxes through the connected MCP server. Use for ANY request to look at, search, or process mail — even a simple 'search my inbox for X' or 'any new mail?'; the read workflow applies regardless of task size. Also use to summarize conversations, inspect attachments, manage read/unread labels, or find messages needing a reply; do not use for sending or drafting (send-email), inbox administration (manage-inboxes), or MCP connection setup (agentmail-mcp).Other plugins' skills for the same job