Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 65 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,69 @@
# AgentMail Toolkit

The AgentMail Toolkit integrates popular agent frameworks and protocols including OpenAI Agents SDK, Vercel AI SDK, and Model Context Protocol (MCP) with the AgentMail API.
[![npm](https://img.shields.io/npm/v/agentmail-toolkit)](https://www.npmjs.com/package/agentmail-toolkit)
[![pypi](https://img.shields.io/pypi/v/agentmail-toolkit)](https://pypi.org/project/agentmail-toolkit)

## Setup & Usage
Pre-built integrations that connect popular AI agent frameworks to the [AgentMail](https://agentmail.to) email API. Give your agents their own email inboxes in minutes.

See the [Python](/python) and [Node](/node) packages for language specific setup and usage.
## Supported Frameworks

| Framework | Python | TypeScript |
|---|---|---|
| [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) | ✓ | — |
| [Vercel AI SDK](https://sdk.vercel.ai) | — | ✓ |
| [Model Context Protocol (MCP)](https://modelcontextprotocol.io) | ✓ | ✓ |

## Quick Start

### TypeScript (Vercel AI SDK)

```bash
npm install agentmail-toolkit
export AGENTMAIL_API_KEY=am_us_xxx
```

```typescript
import { openai } from "@ai-sdk/openai";
import { AgentMailToolkit } from "agentmail-toolkit/ai-sdk";
import { streamText } from "ai";

const result = streamText({
model: openai("gpt-4o"),
messages,
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The TypeScript quick start snippet references messages without defining it, so the example won't run as-is. Inline a minimal messages array in the snippet to make it self‑contained.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 32:

<comment>The TypeScript quick start snippet references `messages` without defining it, so the example won't run as-is. Inline a minimal messages array in the snippet to make it self‑contained.</comment>

<file context>
@@ -1,7 +1,69 @@
+
+const result = streamText({
+  model: openai("gpt-4o"),
+  messages,
+  system: "You are an email agent that can create inboxes, send, and receive emails.",
+  tools: new AgentMailToolkit().getTools(),
</file context>
Suggested change
messages,
messages: [{ role: "user", content: "Create an inbox" }],
Fix with Cubic

system: "You are an email agent that can create inboxes, send, and receive emails.",
tools: new AgentMailToolkit().getTools(),
});
```

### Python (OpenAI Agents SDK)

```bash
pip install agentmail-toolkit
export AGENTMAIL_API_KEY=am_us_xxx
```

```python
from agentmail_toolkit.openai import AgentMailToolkit
from agents import Agent

agent = Agent(
name="Email Agent",
instructions="You are an agent that can send, receive, and manage emails.",
tools=AgentMailToolkit().get_tools(),
)
```

## Packages

| Package | Directory | Docs |
|---|---|---|
| [`agentmail-toolkit`](https://www.npmjs.com/package/agentmail-toolkit) (npm) | [`/node`](./node) | [Node README](./node/README.md) |
| [`agentmail-toolkit`](https://pypi.org/project/agentmail-toolkit) (PyPI) | [`/python`](./python) | [Python README](./python/README.md) |

## Links

- [AgentMail](https://agentmail.to) — The email API for AI agents
- [Documentation](https://docs.agentmail.to)
- [Examples](https://github.com/agentmail-to/agentmail-examples)
- [MCP Server](https://github.com/agentmail-to/agentmail-mcp)
- [Discord](https://discord.gg/ZYN7f7KPjS)