Moltbot

Give your Moltbot agent its own email inbox

Getting started

Moltbot (formerly Clawdbot) is an open-source AI personal assistant that runs on your own devices and integrates with messaging platforms like WhatsApp, Telegram, Discord, and Slack. By adding AgentMail to Moltbot, your agent gains the ability to send and receive emails, enabling two-way email conversations alongside your existing chat channels.

There are three ways to integrate AgentMail with Moltbot: using the official AgentMail skill, the AgentMail MCP server, or creating a custom skill.

The easiest way to add email capabilities to Moltbot is by installing the official AgentMail skill from skills.sh. This skill is maintained by the AgentMail team and provides comprehensive email functionality.

Installation

Install the skill using the Moltbot CLI:

$moltbot skills install agentmail-to/agentmail-skills/agentmail

Or install via ClawdHub:

$clawdhub install agentmail

Configuration

Add your AgentMail API key to the skill configuration in ~/.clawdbot/moltbot.json:

1{
2 "skills": {
3 "entries": {
4 "agentmail": {
5 "enabled": true,
6 "env": {
7 "AGENTMAIL_API_KEY": "your-api-key-here"
8 }
9 }
10 }
11 }
12}

Get your API key from the AgentMail Console.

Features

The official skill includes:

  • Inbox management: Create scalable inboxes on-demand with unique email addresses
  • Message operations: Send emails with text and HTML content for best deliverability
  • Thread management: Group related messages in conversations
  • Attachments: Send and receive attachments with Base64 encoding
  • Drafts: Create drafts for human-in-the-loop approval before sending
  • Pods: Multi-tenant isolation for SaaS platforms
  • Idempotency: Safe retries on create operations
  • Real-time events: WebSocket and webhook support for notifications

Verify installation

Check that the skill is loaded:

$moltbot skills list --eligible

You should see agentmail in the list of available skills.

Option 2: MCP Server

An alternative way to add email capabilities to Moltbot is through the AgentMail MCP server. Moltbot supports MCP (Model Context Protocol) servers, which allows it to connect to external tools like AgentMail.

Setup

  1. Get your AgentMail API key from the AgentMail Console.

  2. Add the AgentMail MCP server to your Moltbot configuration. Edit your ~/.clawdbot/moltbot.json file:

1{
2 "mcp": {
3 "servers": {
4 "agentmail": {
5 "command": "npx",
6 "args": ["-y", "@agentmail/mcp-server"],
7 "env": {
8 "AGENTMAIL_API_KEY": "your-api-key-here"
9 }
10 }
11 }
12 }
13}
  1. Restart Moltbot to load the new MCP server:
$moltbot restart
  1. Verify the integration by asking Moltbot to list your inboxes:
List my AgentMail inboxes

Available tools

Once connected, Moltbot can use the following AgentMail tools:

  • Inbox management: Create, list, and delete inboxes
  • Message operations: Send, receive, and reply to emails
  • Thread management: Access and manage email threads
  • Attachments: Handle email attachments

Option 3: Custom Skill

For more control over the integration, you can create a custom AgentMail skill. Skills are directories containing a SKILL.md file with instructions for Moltbot.

Create the skill directory

Create a new skill in your Moltbot workspace:

$mkdir -p ~/.clawdbot/skills/agentmail

Create the skill file

Create ~/.clawdbot/skills/agentmail/SKILL.md with the following content:

1---
2name: agentmail
3description: Send and receive emails using AgentMail
4requires:
5 env:
6 - AGENTMAIL_API_KEY
7---
8
9# AgentMail Skill
10
11You can send and receive emails using the AgentMail API. Use the `exec` tool to run curl commands against the AgentMail API.
12
13## API Base URL
14
15```
16https://api.agentmail.to/v1
17```
18
19## Authentication
20
21Include your API key in the Authorization header:
22
23```
24Authorization: Bearer $AGENTMAIL_API_KEY
25```
26
27## Common Operations
28
29### List inboxes
30
31```bash
32curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
33 https://api.agentmail.to/v1/inboxes
34```
35
36### Create an inbox
37
38```bash
39curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
40 -H "Content-Type: application/json" \
41 -d '{"display_name": "My Agent"}' \
42 https://api.agentmail.to/v1/inboxes
43```
44
45### Send an email
46
47```bash
48curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
49 -H "Content-Type: application/json" \
50 -d '{
51 "to": ["recipient@example.com"],
52 "subject": "Hello from Moltbot",
53 "text": "This email was sent by my AI assistant."
54 }' \
55 https://api.agentmail.to/v1/inboxes/{inbox_id}/messages
56```
57
58### List messages in an inbox
59
60```bash
61curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
62 https://api.agentmail.to/v1/inboxes/{inbox_id}/messages
63```
64
65### Reply to a message
66
67```bash
68curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
69 -H "Content-Type: application/json" \
70 -d '{"text": "Thanks for your email!"}' \
71 https://api.agentmail.to/v1/inboxes/{inbox_id}/messages/{message_id}/reply
72```

Configure the skill

Add your AgentMail API key to the skill configuration in ~/.clawdbot/moltbot.json:

1{
2 "skills": {
3 "entries": {
4 "agentmail": {
5 "enabled": true,
6 "env": {
7 "AGENTMAIL_API_KEY": "your-api-key-here"
8 }
9 }
10 }
11 }
12}

Verify the skill

Check that the skill is loaded:

$moltbot skills list --eligible

You should see agentmail in the list of available skills.

Example use cases

Once AgentMail is integrated with Moltbot, you can ask your agent to:

  • “Create a new email inbox for my project”
  • “Check my inbox for new emails”
  • “Send an email to john@example.com about the meeting tomorrow”
  • “Reply to the latest email from Sarah”
  • “Forward the invoice email to accounting@company.com

Real-time email notifications

For proactive email handling, you can combine AgentMail webhooks with Moltbot’s webhook support. This allows Moltbot to notify you immediately when new emails arrive.

  1. Set up a webhook endpoint in Moltbot (see Moltbot webhook documentation)

  2. Register the webhook with AgentMail:

$curl -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
$ "url": "https://your-moltbot-webhook-url",
$ "events": ["message.received"]
$ }' \
> https://api.agentmail.to/v1/webhooks

Now Moltbot will be notified whenever a new email arrives, allowing it to proactively inform you or take action.

Resources