Skip to main content

Project case study

AMG — Agent Messaging Gateway

AI/ML

A messaging gateway exposing a four-tool MCP + REST surface over iMessage and Discord behind one normalized envelope

PythonFastAPIMCPSQLiteDiscordiMessagelaunchduv

A personal-scale messaging gateway that exposes the same four-tool MCP surface, along with an equivalent REST surface, over both iMessage and Discord. It normalizes their very different I/O models behind a single message envelope and serves as Capo's transport layer.

Built decoupled-by-design across three independently replaceable layers: agent runtimes talk to a thin Python MCP wrapper (or directly over HTTP), a FastAPI adapter owns persistence and is the source of truth, and one connector per platform translates raw events into the normalized envelope. Full operator docs live at sequenzia.github.io/amg.

Key capabilities:

  • Four MCP tools (list_unread_messages, send_message, mark_read, and get_message_context) exposed over stdio for Claude Code, Claude Desktop, and Codex clients
  • macOS-native adapter supervised by launchd, reading iMessage from chat.db and driving Messages.app via AppleScript, with a Discord gateway/REST connector
  • Swappable layers: replacing the agent framework, the MCP wrapper, or either connector requires no changes to the others