GitHub - agent-messenger/agent-messenger: Messenger automation CLI & SDK for AI agents
Blog

GitHub - agent-messenger/agent-messenger: Messenger automation CLI & SDK for AI agents

agent-messenger
2026.11.06
·GitHub·by Mineru
#Agent#AI#DL#LLM#ML

Key Points

  • 1Agent Messenger is a unified CLI and TypeScript SDK that enables AI agents to communicate across twelve major messaging platforms by using existing user session credentials instead of restricted bot tokens.
  • 2The tool simplifies automation by extracting authentication from desktop applications or browsers, allowing agents to act with the user's own permissions and identity without requiring OAuth approvals or API keys.
  • 3It provides a consistent interface for tasks like sending messages, searching threads, and real-time event streaming, offering a flexible solution for developers to integrate multi-channel messaging directly into agent workflows.

Agent Messenger is a messaging automation CLI and TypeScript SDK designed to empower AI agents to interact with communication platforms as individual users rather than as restricted bots. By circumventing the traditional dependency on OAuth apps, administrative approvals, and bot tokens, it allows agents to operate with the same permissions, identity, and context as the human user.

Core Methodology

The framework operates by abstracting 12 major messaging platforms—including Slack, Discord, Microsoft Teams, Telegram, WhatsApp, and iMessage—into a unified, agent-native interface. Its core technical approach relies on two primary authentication strategies:

  1. Credential Extraction: For desktop-based applications (e.g., Slack, Discord, Teams, KakaoTalk, Channel Talk), the system programmatically reads session tokens directly from local storage or Chromium browser profiles. For platforms like Webex and Instagram, it performs targeted extraction from browser cookies.
  2. Interactive Authentication: For platforms lacking straightforward local storage access, it implements modern sign-in protocols. This includes QR code-based authentication (Slack/Discord), one-time phone code verification (Telegram), and QR/pairing code sessions (WhatsApp, LINE).

The SDK provides a consistent, type-safe API, utilizing Zod schemas for structured data validation. This enables LLMs to parse output programmatically, ensuring reliable tool-use. For state management, the system utilizes a local configuration directory (defaulting to ~/.config/agent-messenger) to persist workspace IDs, channel mappings, and preferences.

Technical Architecture

  • Multi-Transport Handling: The SDK manages varied transport layers, from platform-specific WebSockets (e.g., Discord Gateway, Slack Socket Mode, Webex Mercury, Teams Trouter, Instagram MQTToT) to long-polling mechanisms for platforms like Telegram.
  • Unified Interface: It maps diverse platform APIs into a consistent set of commands for sending messages, searching threads, listing channels, and real-time event streaming.
  • Language Integration: By providing a TypeScript SDK, it supports deep integration into agent runtimes (e.g., TypeClaw), allowing developers to import specific clients (e.g., SlackClient, DiscordClient) and credential managers.
  • Real-time Event Handling: Real-time capabilities are achieved via specialized listeners (e.g., SlackListener, DiscordBotListener). These listeners translate proprietary platform events into consistent EventEmitter patterns, allowing agents to respond to incoming messages or interactions without requiring public HTTP endpoints or webhooks.
  • Constraints and Platform Specifics: Certain platforms require unique handling; for example, iMessage functionality is strictly local to macOS due to the lack of an official Apple API, requiring direct interaction with the imsg tool and System-level Full Disk Access. Conversely, bot variants (-bot CLI suffixes) support standard API integrations for server-side or CI/CD deployments.