Skip to main content
Glama

⚡ AgentBox

AIエージェントのためのメール&アイデンティティレイヤー

CI npm version npm downloads GitHub Release Rust MCP License: MIT

AgentBox は、あらゆる自律型AIエージェント(Claude Code、Cursor、Antigravity、OpenAI Swarm)に、マシンネイティブなメールアイデンティティ、受信トレイ、送信通信、認証、イベント駆動型メール機能を提供します — セルフホスト、完全自律、そして圧倒的な高速性を備えています。

クイックスタート • コア抽象化 • エージェントのアイデンティティとセキュリティ • ユースケース • ベンチマーク • MCPツール • アーキテクチャ


💡 コアとなる問題

自律型AIエージェントには、人間の世界や互いとやり取りする手段が必要です。今日、メールはあらゆるソフトウェアとプラットフォームにわたる普遍的な通信プロトコルです:

  • ブラウザエージェントがGitHubやAWSでアカウントを検証するには? メール。

  • 顧客がAIサポートアシスタントに問い合わせるには? メール。

  • 外部QAエージェントがコーディングエージェントにバグレポートを委任するには? メール。

  • リサーチエージェントがarXivダイジェストや業界アラートを受け取るには? メール。

マシンネイティブなメールインフラがなければ、開発者は脆いAPIポーリング、個人用Gmail受信トレイのハッキング、手動での検証リンククリックを強いられます。

AgentBox がこれを完全に解決します。

                    ┌─────────────────────────┐
                    │        AGENTBOX         │
                    └────────────┬────────────┘
                                 │
              ┌──────────────────┴──────────────────┐
              ▼                                     ▼
        🧑🚀 IDENTITY                         📬 COMMUNICATION
  • User-Defined Name & Email           • Inbound Inbox (SMTP/IMAP/HTTP)
  • Persistent Agent ID                 • Outbound SMTP Relay
  • Scoped Capability Matrix            • Realtime Event Bus (<0.001ms)
  • Object-Level Ownership              • OTP Isolator & SafeLink Engine
              │                                     │
              └──────────────────┬──────────────────┘
                                 │
                                 ▼
                     Autonomous AI Agent

Related MCP server: Mailgent MCP Server

🧑🚀 エージェントのアイデンティティとセキュリティモデル

AgentBox は、あなたのエージェントが誰であるかを規定しません。エージェントの名前、メール、機能ポリシーはあなたが定義します:

# 1. Create a Support Agent with a custom company email
npx agentbox-mail agent create support \
  --email support@mycompany.com \
  --capabilities "inbox.read,email.send"

# 2. Create an Autonomous Coding Agent
npx agentbox-mail agent create coder \
  --email coder@mycompany.com \
  --capabilities "inbox.read,task.claim,task.update,otp.read"

# 3. Create a Browser QA Agent with standard verification permissions
npx agentbox-mail agent create browser-qa \
  --capabilities "inbox.read,otp.read,links.read"
╔══════════════════════════════════════════════════════════════════╗
║             🧑‍🚀 AGENT IDENTITY PROVISIONED                      ║
╠══════════════════════════════════════════════════════════════════╣
║  Agent ID     : agent_coder_7f92a1                               ║
║  Name         : coder                                            ║
║  Email        : coder@mycompany.com                              ║
║  Auth Token   : agb_92d7e8f1c3a04b12                             ║
║  Capabilities : ["inbox.read", "task.claim", "otp.read"]        ║
║  Status       : active                                           ║
╚══════════════════════════════════════════════════════════════════╝
⚠️  NOTE: Store this auth_token securely. It is only displayed once upon creation.

🔐 多層セキュリティの強制:

  1. トークン認証:エージェントのアイデンティティとステータス(active と revoked)を検証します。

  2. 機能スコープ:必要な権限(inbox.read、email.send、otp.read、task.claim)を検証します。

  3. オブジェクトレベルのメールボックス所有権:otp.read を持つエージェントAは、自身に割り当てられたメールボックス(owner_agent_id)に厳密に制限されます。エージェント間のアクセスを試みると、明示的な AccessDenied エラーが返されます。

  4. 認証情報の衛生管理:公開クエリ(get_agent_identity、list_agent_identities)は、トークンを決して公開しないサニタイズ済み構造体を使用します。


🌐 多様なユースケース

AgentBox は、基盤となるメールアイデンティティレイヤーを提供します。その上に構築された最も強力なワークフローのいくつかを紹介します:

1. 🤖 エージェント間の作業委任とタスクプロトコル

外部のQAまたは発見エージェント(Julesなど)が、バグまたは機能リクエストを含むメールを送信します。AgentBox の組み込み TaskDetector が件名([TASK:BUG])を自動的に解析し、リポジトリ、ブランチ、優先度、行の引用を抽出し、AgentTask をプロビジョニングし、イベントバスを介してコーディングエージェントを起動します:

   Jules (QA Agent)
          │
          │ 1. Sends email: "[TASK:BUG] Fix duplicate property filter in EstateFlow"
          │    Body: "Repository: RABNEER/EstateFlow\nPriority: high\nEvidence: tests/search.spec.ts:87"
          ▼
 ┌─────────────────┐
 │    AgentBox     │ ──► Auto-detects Work Order via `TaskDetector`
 └────────┬────────┘ ──► Provisions `AgentTask` & records audit event
          │
          │ 2. Realtime Event Bus Dispatch (<0.001ms) / SSE Daemon Bridge
          ▼
 Coder (Worker Agent / Claude Code)
          │ 3. Instantaneously claims task via `claim_agent_task`
          │ 4. Fixes code, opens GitHub PR, calls `update_task_progress`
          │ 5. Calls `complete_agent_task` with CI results
          ▼
 ┌─────────────────┐
 │    AgentBox     │ ──► Status: "completed" + Immutable Audit Lineage
 └────────┬────────┘
          │ 6. Emits completion notification to Jules / User
          ▼
   Jules closes ticket

2. 🔐 自律的なSaaSサインアップと2FA / OTP検証

ブラウザエージェント(Puppeteer、Playwright、Stagehand)は、ツールへのサインアップ、メールアドレスの検証、OTPチャレンジの解決が必要です:

  • エージェントが受信トレイを作成 create_agent_inbox(name: "signup-bot")。

  • プラットフォーム(例:AWS、Stripe、Vercel)でサインアップをトリガー。

  • get_latest_otp()(0.14ms未満で正規表現により抽出)または get_verification_link()(アンチリダイレクト&フィッシング防御でチェック)を呼び出し。

  • 人間の介入なしにアカウントが自律的に検証されます。


3. 💬 自律的な受信サポートと顧客トリアージ

カスタマーサポートエージェントに専用のメールアドレス(support@yourcompany.com)を付与します:

  • 顧客が問題を抱えてサポートにメールを送信。

  • AgentBox が生のSMTPまたはIMAP同期を介してメールを取り込み。

  • リアルタイムSSEイベントがサポートエージェントに通知。

  • エージェントが問い合わせを分析し、社内ドキュメントを参照し、send_agent_email() で返信。


4. 🔬 リサーチ&インテリジェンス収集

リサーチエージェントにアイデンティティ(researcher@yourcompany.com)を付与します:

  • 業界ニュースレター、セキュリティアドバイザリ(CVE)、arXivダイジェストフィードに購読。

  • エージェントが read_agent_inbox() を使用して受信メールを定期的に読み取り。

  • エグゼクティブブリーフィングを統合し、調査結果を要約し、ダイジェストをチームに転送。


5. 🛡️ DevOpsアラートと自動インシデントレスポンス

インシデントレスポンスエージェントにアイデンティティ(oncall@yourcompany.com)を付与します:

  • Datadog、Sentry、PagerDutyから重大なエラーアラートを受信。

  • リアルタイムイベントフックがエージェントを即座に起動。

  • エージェントがログを照会し、障害のあるコミットを特定し、コーディングエージェントに修正指示を送信。


📊 再現可能なパフォーマンスベンチマーク

AgentBox には、生バイトから完全なJSON-RPC出力までのパイプライン全体を測定する完全なベンチマークテストスイート(tests/benchmark.rs)が含まれています:

cargo test --release --test benchmark -- --nocapture

⚡ 検証済みエンドツーエンドMCPパイプライン(1,000サイクル):

テスト済みパイプライン:生MIME取り込み ➔ mail-parser ➔ SafeLink分析 ➔ 正規表現OTP ➔ SQLite INSERT ➔ ブロードキャスト配信 ➔ 認証済みMCPツール呼び出し(tools/call)➔ JSON-RPC結果出力

パイプラインメトリクス

測定レイテンシ

スループット

平均(Mean)

451.9 µs(0.451 ms)

毎秒2,213完全MCPサイクル

p50中央値

431.5 µs(0.431 ms)

—

p95

586.2 µs(0.586 ms)

—

p99

1.04 ms

—

⚡ サブコンポーネントのマイクロ秒レイテンシ(10,000イテレーション):

  • イベントバスチャネル配信:0.216 µs(0.0002 ms)— 毎秒462万イベント

  • リンク安全性&アンチリダイレクト:0.652 µs(0.0007 ms)— 毎秒153万チェック

  • OTP正規表現抽出:138.2 µs(0.138 ms)— 毎秒7,230抽出


🛠️ MCPツールリファレンス

AgentBox は、stdio 上で Model Context Protocol(MCP) 仕様を実装しています:

カテゴリ

ツール

パラメータ

説明

アイデンティティ

create_agent_identity

name, email?, capabilities?

カスタム/自動メールで永続的なアイデンティティを作成し、ワンタイム認証トークンを返します。

アイデンティティ

get_agent_identity

agent_id

公開エージェントメタデータを取得します(トークンはサニタイズされます)。

アイデンティティ

list_agent_identities

—

登録済みのすべての公開エージェントアイデンティティとアクティブなポリシーを一覧表示します。

アイデンティティ

revoke_agent_identity

agent_id

エージェントのアイデンティティを失効させ、認証トークンを即座に無効化します。

メールボックス

create_agent_inbox

name, address?, agent_token?

呼び出し元のエージェントアイデンティティにリンクされた新しい仮想メールボックスを作成します。

メールボックス

get_latest_otp

account_id, agent_token?

所有権チェック付きで最新の4〜8桁の検証コードを0.14ms未満で抽出します。

メールボックス

wait_for_email

account_id, timeout_secs?, agent_token?

イベント駆動フック:非同期Tokioブロードキャストチャネルが0.001ms未満でエージェントを起動します。

メールボックス

get_verification_link

account_id, agent_token?

ディープリンク安全性&アンチリダイレクト防御付きで解析済みアクティベーションリンクを返します。

メールボックス

read_agent_inbox

account_id, limit?, agent_token?

最近のメッセージ、完全な本文テキスト、HTML、送信者メタデータを取得します。

メールボックス

send_agent_email

account_id, to, subject, body, agent_token?

機能認証付きでSMTPリレーを介して送信メールを配信します。

メールボックス

delete_agent_inbox

account_id, agent_token?

一時メールボックスを削除し、保存されたメッセージを消去します。

タスクプロトコル

dispatch_agent_task

action, description, repository?, branch?, priority?, target_agent?, evidence?, acceptance_criteria?, agent_token?

あるエージェントから別のエージェントへ構造化された作業指示を配信します。

タスクプロトコル

claim_agent_task

task_id, agent_token

タスクをアトミックにロックし、要求したワーカーエージェントに割り当てます。

タスクプロトコル

update_task_progress

task_id, status, commit_sha?, pr_url?, test_results?, note?, agent_token

タスクステータス(running、testing、pr_opened)を更新し、監査ログを記録します。

タスクプロトコル

complete_agent_task

task_id, summary, commit_sha?, pr_url?, test_results?, agent_token

完了詳細付きでタスクをクローズし、完了イベントを発行します。

タスクプロトコル

list_agent_tasks

status?, agent_token?, limit?

ライフサイクル状態またはエージェントアイデンティティでフィルタリングされたタスクを一覧表示します。

タスクプロトコル

get_task_audit_trail

task_id, agent_token?

タスクの不変の監査ログとライフサイクル履歴を取得します。


🚀 クイックスタート

1. ヘッドレスNPM CLI(ゼロセットアップ)

AIツールを1秒で即座に自動設定:

# 1-Click Auto-Install MCP Server & AI Skill into Claude Code, Cursor, Antigravity
npx agentbox-mail init

# Start MCP stdio server with live daemon SSE event bridge
npx agentbox-mail mcp

# Create an Agent Identity with scoped capabilities
npx agentbox-mail agent create support --email support@mycompany.com --capabilities "inbox.read,email.send"

# Retrieve latest OTP code
npx agentbox-mail otp agent@yourdomain.com

# Launch Web Dashboard
npx agentbox-mail ui

2. ネイティブ Electron デスクトップアプリ

# Clone the repository
git clone https://github.com/RABNEER/AgentBox.git
cd AgentBox

# Install dependencies and start Desktop App
npm install
npm run app

3. 高速 Rust コアデーモン

# Build the optimized production binary
cargo build --release

# Start all-in-one daemon (HTTP Port 3000 + SMTP Port 2525)
./target/release/agentbox-mail server --port 3000

🏗️ アーキテクチャ

                                  ┌───────────────────────────┐
                                  │   Inbound Emails & Tasks  │
                                  └─────────────┬─────────────┘
                                                │
                 ┌──────────────────────────────┼──────────────────────────────┐
                 │                              │                              │
                 ▼                              ▼                              ▼
     ┌───────────────────────┐      ┌───────────────────────┐      ┌───────────────────────┐
     │ Hostinger / Titan /   │      │ Raw SMTP Listener     │      │ Inbound HTTP Webhook  │
     │ Google IMAP TLS (993) │      │ (0.0.0.0:2525)        │      │ (POST /v1/inbound)    │
     └───────────┬───────────┘      └───────────┬───────────┘      └───────────┬───────────┘
                 │                              │                              │
                 └──────────────────────────────┼──────────────────────────────┘
                                                │
                                                ▼
                                 ┌─────────────────────────────┐
                                 │   High-Speed Parser Engine  │
                                 │  • 4–8 Digit OTP Isolator   │
                                 │  • Link Safety Engine       │
                                 │  • TaskDetector (Work Order)│
                                 └──────────────┬──────────────┘
                                                │
                                                ▼
                                 ┌─────────────────────────────┐
                                 │ Embedded SQLite Storage     │
                                 │       (`agentbox.db`)       │
                                 │  • Identities & Auth Tokens │
                                 │  • Mailboxes & Messages     │
                                 │  • Resource Ownership Graph │
                                 │  • Agent Tasks & Audit Logs │
                                 └──────────────┬──────────────┘
                                                │
                 ┌──────────────────────────────┼──────────────────────────────┐
                 │                              │                              │
                 ▼                              ▼                              ▼
     ┌───────────────────────┐      ┌───────────────────────┐      ┌───────────────────────┐
     │ Realtime SSE Bus      │      │ MCP Server (stdio)    │      │ Native Desktop App /  │
     │ (`GET /v1/events`)    │      │ Full Tool Interface   │      │ Web Dashboard (:3000) │
     │ (Live Daemon Bridge)  │      │ Object-Level Auth     │      │                       │
     └───────────────────────┘      └───────────────────────┘      └───────────────────────┘

📄 ライセンス

MIT License の下で配布されています。詳細は LICENSE をご覧ください。

🖤 を込めて RABNEER と AgentBox オープンソースコミュニティによって作られました

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Disposable email MCP server for autonomous AI agents. Create labeled temporary inboxes, wait for verification emails, extract OTP codes and confirmation links — zero human intervention required.
    6
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides identity infrastructure for AI agents to manage email communications, including sending, replying, and organizing messages. It also includes a secure vault for managing credentials and generating TOTP codes.
    9 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    An MCP server that provides AI agents with a persistent, agent-native email mailbox for sending, receiving, and managing emails through bounded-context retrieval, idempotent operations, and explicit acknowledgement.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Disposable email for humans and AI agents. Enables AI agents to create mailboxes and receive verification emails through an MCP server.
    37
    MIT