molecule-core/docs/blog/2026-04-21-discord-adapter/index.md
devops-engineer 55689e0b10
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 16s
Check merge_group trigger on required workflows / Required workflows have merge_group trigger (pull_request) Successful in 22s
CI / Detect changes (pull_request) Successful in 24s
E2E API Smoke Test / detect-changes (pull_request) Successful in 20s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 21s
pr-guards / disable-auto-merge-on-push (pull_request) Failing after 9s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 44s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 38s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 35s
Harness Replays / detect-changes (pull_request) Successful in 44s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 27s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 56s
CodeQL / Analyze (${{ matrix.language }}) (go) (pull_request) Failing after 2m1s
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (pull_request) Failing after 2m34s
CodeQL / Analyze (${{ matrix.language }}) (python) (pull_request) Failing after 2m34s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 23s
Harness Replays / Harness Replays (pull_request) Failing after 1m12s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 2m51s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Failing after 5m37s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6m15s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6m34s
CI / Python Lint & Test (pull_request) Successful in 8m20s
CI / Canvas (Next.js) (pull_request) Successful in 9m46s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 13m23s
fix(post-suspension): migrate github.com/Molecule-AI refs to git.moleculesai.app (Class G #168)
The GitHub org Molecule-AI was suspended on 2026-05-06; canonical SCM
is now Gitea at https://git.moleculesai.app/molecule-ai/. Stale
github.com/Molecule-AI/... URLs return 404 and break tooling that
clones / pip-installs / curls them.

This bundles all non-Go-module URL fixes for this repo into a single PR.
Go module path references (in *.go, go.mod, go.sum) are out of scope
here -- tracked separately under Task #140.

Token-auth clone URLs also flip ${GITHUB_TOKEN} -> ${GITEA_TOKEN} since
the GitHub token does not auth against Gitea.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 13:08:15 -07:00

5.0 KiB

title date slug description tags
Your AI Agents Just Joined Discord 2026-04-21 discord-adapter-launch Molecule AI workspaces can now connect to Discord — send messages to channels and receive slash commands, using only a webhook URL. No bot account, no OAuth flow, no Gateway connection.
launch
discord
social-channels
platform
MCP

Your AI Agents Just Joined Discord

Your team is in Discord. Your AI agents are in Molecule AI. Until today, those two places didn't talk to each other without building a full Discord bot.

That's now one webhook URL.

Molecule AI workspaces can now connect to Discord. Here's what shipped in PR #656.


The Problem with Traditional Discord Bot Setup

Most Discord bot integrations follow the same pattern: create an app in the Developer Portal, set up OAuth2, handle the Gateway connection, configure intents and permissions, manage rate limits. That's a significant chunk of work before your agent can say hello in a channel.

For internal tooling and team workflows, that overhead rarely pays for itself.

The Molecule AI Discord adapter takes a different approach — two standard Discord primitives, no bot account required.


What the Adapter Does

Outbound: your agent sends to Discord

You create a Discord Incoming Webhook — one URL, generated from any channel's Integrations settings. That URL encodes the channel and the bot credentials. You paste it into your Molecule AI workspace config.

That's the only credential. Your workspace agent can now send messages to that Discord channel. Long responses are automatically split into Discord-safe chunks (2,000-character limit).

Inbound: slash commands route to your agent

Users type /ask what's the deployment status? in a Discord channel where your bot is present. Discord POSTs a signed JSON payload to your platform's Interactions endpoint. The adapter parses the command name and options, reconstructs it as plain text, and routes it to your workspace agent. The agent's response goes back to the same Discord channel.

No polling. No Gateway. No message-reading permissions. The only Discord permission you need is the one that comes with the webhook itself.

Works in servers and in DMs.


Setup: Less Than a Minute

  1. Create a Discord Incoming Webhook — Channel Settings → Integrations → Webhooks → New Webhook
  2. Copy the webhook URL
  3. In Molecule AI Canvas: open your workspace → Channels tab → + ConnectDiscord → paste the URL

Or via API:

curl -X POST https://your-platform.com/workspaces/${WORKSPACE_ID}/channels \
  -H 'Authorization: Bearer ${TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{
    "channel_type": "discord",
    "config": {
      "webhook_url": "https://discord.com/api/webhooks/123456789/abcdefghijklmnop"
    }
  }'

For inbound slash commands, point your Discord app's Interactions Endpoint URL at POST /webhooks/discord on your platform. Discord handles the signing; your platform verifies the signature at the router layer before the adapter sees the payload.


Security: Webhook Tokens Don't Appear in Logs

Webhook URLs contain a token (/webhooks/{id}/{token}). If that token leaks into server logs, it's a rotation event. The Discord adapter is explicit about this: HTTP request errors are logged without the URL, and the adapter returns a generic error message. This was hardened in PR #659.


What to Actually Use It For

The adapter fits naturally into workflows your team already runs in Discord:

  • Incident triage — an agent receives a /incident <description> slash command, runs checks, and posts a formatted status report back to the incident channel
  • Deployment coordination — a CI/CD agent posts build results, rollback recommendations, and health checks to a DevOps Discord channel
  • Community management — a Community Manager agent receives /support <question>, routes to the right sub-agent, and returns the answer to Discord
  • Scheduled summaries — agents post periodic status updates, log digests, or metric snapshots to a channel on a schedule

Slash commands are the interface. The agent decides what to do and how to respond. Your Discord server is the front-end your team already knows.


What's Next

The Discord adapter is the second channel in Molecule AI's social channels system — after Telegram. The same adapter interface handles new platforms: implement ChannelAdapter, register it, and the full CRUD API, Canvas UI, and MCP tools work automatically.

Documentation: Social Channels guide

Connect a Discord channel →


Discord adapter shipped in PR #656. Security hardening in PR #659. Molecule AI is open source — contributions welcome.