npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-agentmail-cli

v1.0.0

Published

CLI for AgentMail - Email accounts for AI agents

Readme

AgentMail CLI

CLI tool for AgentMail - scalable, API-first email accounts for AI agents.

Installation

npm install -g agentmail-cli

Or use directly with npx:

npx agentmail-cli inboxes list

Setup

Get your API key from agentmail.to

Authentication

Two options for providing your API key:

# Option 1: Environment variable (recommended)
export AGENTMAIL_API_KEY="your_api_key"
agentmail inboxes list

# Option 2: CLI parameter
agentmail --api-key "your_api_key" inboxes list

The --api-key flag can be placed before any command.

Usage

# Show help
agentmail --help

# List inboxes
agentmail inboxes list

# Create an inbox
agentmail inboxes create --display-name "My Bot"

# List threads
agentmail threads list <inbox-id> --limit 10

# Send an email
agentmail messages send <inbox-id> \
  --to [email protected] \
  --subject "Hello" \
  --text "Email body here"

# Reply to a message
agentmail messages reply <inbox-id> <message-id> \
  --text "Thanks for your email!"

# Update labels
agentmail messages update <inbox-id> <message-id> \
  --add-labels '["processed"]' \
  --remove-labels '["unread"]'

Commands

| Command | Description | |---------|-------------| | inboxes list | List all inboxes | | inboxes get <id> | Get inbox details | | inboxes create | Create new inbox | | inboxes delete <id> | Delete inbox | | threads list <inbox-id> | List threads in inbox | | threads get <inbox-id> <thread-id> | Get thread with messages | | messages send <inbox-id> | Send new email | | messages reply <inbox-id> <msg-id> | Reply to email | | messages forward <inbox-id> <msg-id> | Forward email | | messages update <inbox-id> <msg-id> | Update message labels | | attachments get <thread-id> <att-id> | Get attachment |

Examples

Create inbox and send email

# Create inbox
agentmail inboxes create \
  --username support-bot \
  --domain agentmail.to \
  --display-name "Support Bot"

# Send email (use inbox-id from response)
agentmail messages send <inbox-id> \
  --to [email protected] \
  --subject "Welcome" \
  --text "Thanks for reaching out!"

Check and process emails

# List unread threads
agentmail threads list <inbox-id> --labels '["unread"]'

# Get thread details
agentmail threads get <inbox-id> <thread-id>

# Reply to message
agentmail messages reply <inbox-id> <message-id> \
  --text "Thanks for your email!"

# Mark as processed
agentmail messages update <inbox-id> <message-id> \
  --add-labels '["processed"]' \
  --remove-labels '["unread"]'

OpenClaw / Claude Code Skill

This package includes a skill for OpenClaw and Claude Code.

Installation

# For OpenClaw
cp -r skills/agentmail ~/.openclaw/skills/

# For Claude Code
cp -r skills/agentmail ~/.claude/skills/

Alternative: MCPorter (MCP)

This package includes MCPorter integration for MCP-based usage. MCPorter wraps the agentmail-mcp server into a CLI.

Current Status

MCPorter support is temporarily unavailable due to an MCP SDK version mismatch:

  • agentmail-mcp uses @modelcontextprotocol/sdk@^1.24.1
  • mcporter uses @modelcontextprotocol/sdk@^1.25.1

This causes structuredContent validation errors. Once agentmail-mcp updates to SDK 1.25.1+, MCPorter will work.

Testing MCPorter

Check if the issue is resolved:

# List available tools
npm run list-tools

# Test a call
export AGENTMAIL_API_KEY="your_key"
npx mcporter call agentmail.list_inboxes

If successful, you'll see the inbox list. If you see structuredContent errors, the dependency hasn't been updated yet.

MCPorter Configuration

The MCPorter config is at config/mcporter.json:

{
  "mcpServers": {
    "agentmail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "${AGENTMAIL_API_KEY}"
      }
    }
  }
}

MCPorter Commands

Once working, MCPorter provides a different syntax:

# List inboxes
npx mcporter call agentmail.list_inboxes

# Create inbox
npx mcporter call agentmail.create_inbox displayName:"My Bot"

# Send message
npx mcporter call agentmail.send_message \
  inboxId:inbox_123 \
  to:'["[email protected]"]' \
  subject:"Hello" \
  text:"Email body"

# Function-call syntax (alternative)
npx mcporter call 'agentmail.send_message(inboxId: "inbox_123", to: ["[email protected]"])'

Switching to MCPorter as Default

When the dependency is updated, you can switch to MCPorter as the primary CLI:

  1. Update package.json:
{
  "bin": {
    "agentmail": "./bin/agentmail-mcp.js",
    "agentmail-direct": "./bin/agentmail.js"
  }
}
  1. Regenerate as standalone binary (optional):
npm run build:mcp          # JavaScript CLI
npm run build:mcp:binary   # Compiled binary (requires Bun)

Command Mapping

| Direct CLI | MCPorter | |------------|----------| | agentmail inboxes list | npx mcporter call agentmail.list_inboxes | | agentmail inboxes get X | npx mcporter call agentmail.get_inbox inboxId:X | | agentmail inboxes create --display-name Y | npx mcporter call agentmail.create_inbox displayName:Y | | agentmail threads list X | npx mcporter call agentmail.list_threads inboxId:X | | agentmail messages send X --to [email protected] | npx mcporter call agentmail.send_message inboxId:X to:'["[email protected]"]' |

Development

# Clone and install
git clone https://github.com/agentmail-to/agentmail-cli
cd agentmail-cli
npm install

# Run CLI
node bin/agentmail.js inboxes list

# Run MCPorter wrapper
node bin/agentmail-mcp.js list-tools

Links

License

MIT