$ brew install omotg

Chat with AI Agents from Telegram

A bidirectional bridge connecting Telegram and OpenCode. Control AI agents directly from your phone with full session support and forum integration.

$brew tap itokun99/omotg && brew install omotg
=> Tapping itokun99/omotg/omotg
=> Installing omotg from itokun99/omotg
✓ omotg v0.2.0 installed

Key Features

Everything you need for seamless AI agent control from Telegram

Telegram Integration

Send messages to OpenCode directly from Telegram, get responses instantly with session awareness.

Multi-Session Support

Create, switch, and delete multiple OpenCode sessions on-the-fly, all from your Telegram chat.

Forum Topic Support

Dedicated Telegram forum topics with bound sessions for organized group conversations.

Secure by Default

Secret token verification, chat ID whitelisting, and TLS encryption for all communications.

MCP SSE Server

Exposes send_message and send_notification tools to any MCP client via HTTP/SSE.

Systemd Ready

Ships with systemd user service files for production deployment on any Linux system.

How It Works

Three simple steps to get your AI agent on Telegram

01

Install & Configure

Install OMOTG via Homebrew and set your Telegram bot token and webhook URL.

02

Run the Bridge

Start the OMOTG service on your VPS, it will listen for webhook requests on TLS port 8443.

03

Chat with AI

Send messages from Telegram and get instant responses from your OpenCode AI agent.

Architecture

Understand the system design

graph LR A["Telegram<br/>App"] -->|POST<br/>/webhook| B["OMOTG<br/>Server<br/>Port 8443"] B -->|sendMessage| A B -->|POST /session| C["OpenCode<br/>CLI<br/>Port 4096"] B -->|POST /session/msg| C C -->|Response| B B -->|MCP SSE<br/>Port 9090| C C -->|MCP Tools| B style A fill:#5764F6,stroke:#5764F6,color:#ffffff,stroke-width:2px style B fill:#5764F6,stroke:#5764F6,color:#ffffff,stroke-width:2px style C fill:#5764F6,stroke:#5764F6,color:#ffffff,stroke-width:2px
8443
OMOTG Webhook
HTTPS (TLS)
9090
OMOTG MCP SSE
HTTP/SSE
4096
OpenCode Serve
HTTP/REST

Ready to Get Started?

Install OMOTG in seconds and bring your AI agent to Telegram.

Built with v0