OMOTG — Telegram ↔ OpenCode Bridge
OMOTG is a Go-based bidirectional bridge that connects Telegram to OpenCode via an MCP SSE server and Telegram webhook. It allows you to interact with OpenCode directly from Telegram.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
OMOTG is a Go-based bidirectional bridge that connects Telegram to OpenCode via an MCP SSE server and Telegram webhook. It allows you to interact with OpenCode directly from Telegram.
💬 Interact with OpenCode directly from Telegram. A thread-safe, zero-dependency Go bridge with MCP tool integration for personal "vibecoding".
send_message, send_notification) to any MCP client (including OpenCode itself)/topic new creates a dedicated topic + OpenCode sessionbrew tap itokun99/omotg
brew install omotg
This installs the binary to $(brew --prefix)/bin/omotg and the env template to $(brew --prefix)/etc/omotg/env.template.
go install github.com/itokun99/omotg@latest
This installs the omotg binary to $(go env GOPATH)/bin/omotg. Make sure
$(go env GOPATH)/bin is in your PATH.
git clone [email protected]:itokun99/omotg.git
cd omotg
go build -o omotg .
sudo cp omotg /usr/local/bin/ # optional, for system-wide install
Or install directly to your local bin:
go build -o ~/.local/bin/omotg/omotg .
Telegram webhook requires HTTPS. You have two options:
Place OMOTG behind a reverse proxy (Traefik, Caddy, Nginx) with Let's Encrypt. Set
both OMOTG_TLS_CERT_FILE= and OMOTG_TLS_KEY_FILE= to empty in your env file to
start the webhook server in plain HTTP mode. The proxy handles HTTPS termination.
mkdir -p ~/.config/omotg
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ~/.config/omotg/webhook.key \
-out ~/.config/omotg/webhook.crt \
-subj "/CN=your-domain.com" \
-addext "subjectAltName=DNS:your-domain.com"
Replace your-domain.com with your actual domain pointing to your server.
cp env.template ~/.config/omotg/env
# Then edit with your values:
# TELEGRAM_BOT_TOKEN — from @BotFather
# TELEGRAM_WEBHOOK_URL — https://your-domain.com/webhook (or :8443/webhook for standalone)
# TELEGRAM_SECRET_TOKEN — any random string
# OPENCODE_SERVER_PASSWORD — any string (opencode serve on localhost ignores auth)
#
# For reverse proxy mode, also set:
# OMOTG_TLS_CERT_FILE=
# OMOTG_TLS_KEY_FILE=
See Configuration for all options.
Copy the systemd service files:
mkdir -p ~/.config/systemd/user
opencode-serve.service — starts OpenCode headless server:
[Unit]
Description=OpenCode Headless Server (Serve)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/path/to/opencode serve --port 4096
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=default.target
omotg.service — starts the OMOTG bridge:
[Unit]
Description=OMOTG — Telegram ↔ OpenCode bridge
After=network-online.target opencode-serve.service
Wants=network-online.target
BindsTo=opencode-serve.service
[Service]
Type=simple
ExecStart=/path/to/omotg
Restart=on-failure
RestartSec=5
EnvironmentFile=%h/.config/omotg/env
NoNewPrivileges=true
ProtectHome=read-only
ProtectSystem=full
PrivateTmp=true
[Install]
WantedBy=default.target
Then enable and start:
systemctl --user daemon-reload
systemctl --user enable opencode-serve omotg
systemctl --user start opencode-serve omotg
Configuration is via environment variables in ~/.config/omotg/env:
OMOTG can run multiple Telegram bots simultaneously, each bound to a different OMO agent:
TELEGRAM_BOT_TOKEN) is required — it maps to Sisyphus for backward compatibility.OMO_*_BOT_TOKEN vars for the agents you want./webhook/<key>) with its own Telegram webhook registration.SessionMap.To add an auxiliary bot, set its token and register the webhook via @BotFather:
https://your.domain.com/webhook/prometheus
Note: Hephaestus is configured but requires an upstream OpenCode server fix (server-side
UnknownErroras of 2026-06-22). Enable once resolved.
Any non-command message is forwarded to OpenCode using the current session.
OMOTG supports Telegram supergroup forum topics. Conversations are routed as follows:
To create a dedicated workspace, use /topic new <nama> — this creates a new forum topic and binds a fresh OpenCode session to it. Use /topic close or /topic delete to clean up the topic and its session.
Each OpenCode session maps to one topic, keeping conversations organized in busy groups.
Available via the MCP SSE server at http://127.0.0.1:9090/mcp/sse:
Add to your OpenCode config (~/.config/opencode/opencode.json):
{
"mcp": {
"omotg": {
"type": "remote",
"url": "http://127.0.0.1:9090/mcp/sse"
}
}
}
Telegram App Server (VPS) OpenCode CLI
│ │ │
│ POST /webhook │ │
│ ────────────────────→ omotg (port 8443, TLS) │
│ │ │ │
│ │ │ POST /session │
│ │ │ POST /session/{id}/msg │
│ │ │ DELETE /session/{id} │
│ │ └───────────────────────→ opencode serve
│ │ │ (port 4096)
│ │ │
│ sendMessage │ │
│ ←──────────────────── omotg (sync response) │
│ │ │ │
│ │ │ MCP SSE endpoint │
│ │ │ http://127.0.0.1:9090 │
│ │ │ │
│ │ │ ←── MCP tools ────── OpenCode
Telegram App Server (VPS) OpenCode CLI
│ │ │
│ POST /webhook │ │
│ ────────────────────→ Traefik (port 443, Let's Encrypt) │
│ │ │ │
│ │ │ http://172.17.0.1:8443 │
│ │ ↓ │
│ │ omotg (plain HTTP) │
│ │ │ │
│ │ │ POST /session │
│ │ │ POST /session/{id}/msg │
│ │ │ DELETE /session/{id} │
│ │ └───────────────────────────────→ opencode serve
│ │ │ (port 4096)
│ │ │
│ sendMessage │ │
│ ←──────────────────── omotg (sync response) │
│ │ │ │
│ │ │ MCP SSE endpoint │
│ │ │ http://127.0.0.1:9090 │
│ │ │ │
│ │ │ ←── MCP tools ────────────── OpenCode
brew uninstall omotg
brew untap itokun99/omotg
Then proceed to steps 1–3 below to clean up services & config.
systemctl --user stop omotg opencode-serve
systemctl --user disable omotg opencode-serve
rm ~/.config/systemd/user/omotg.service
rm ~/.config/systemd/user/opencode-serve.service
systemctl --user daemon-reload
curl -X POST "https://api.telegram.org/bot<YOUR_TOKEN>/deleteWebhook"
# If installed via Homebrew:
rm -rf ~/.config/omotg
# If installed from source:
rm -rf ~/.local/bin/omotg
rm -rf ~/.config/omotg
Edit ~/.config/opencode/opencode.json and remove the omotg entry from the mcp section.
This is normal if OMOTG was stopped. Start the service:
systemctl --user start omotg
OpenCode serve is not running:
systemctl --user status opencode-serve
systemctl --user start opencode-serve
# OMOTG logs
journalctl --user -u omotg -f
# OpenCode serve logs
journalctl --user -u opencode-serve -f
OMOTG_TLS_CERT_FILE= and OMOTG_TLS_KEY_FILE= to empty to disable internal TLS.0.0.0.0 with plain HTTP. Ensure your proxy is the only publicly reachable endpoint and that the proxy port is firewalled.127.0.0.1 only — not accessible from the network.CC BY-NC 4.0 — Attribution-NonCommercial 4.0 International
Copyright (c) 2026 Indrawan Lisanto
You are free to share and adapt this software for non-commercial purposes only, provided you give appropriate credit. Commercial use is strictly prohibited without explicit permission.
See LICENSE for full terms.
💬 Interact with OpenCode directly from Telegram. A thread-safe, zero-dependency Go bridge with MCP tool integration for personal "vibecoding".
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Omotg 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 💬 Interact with OpenCode directly from Telegram. A thread-safe, zero-dependency Go bridge with MCP tool integration for personal "vibecoding".