81 lines
4.5 KiB
Plaintext
81 lines
4.5 KiB
Plaintext
---
|
|
title: "Your AI Agents, Live in Discord: Discord Adapter Ships on Molecule AI"
|
|
description: "Molecule AI's Discord adapter connects AI agent workspaces to Discord servers via slash commands and webhooks — no polling, no bot token management, no separate setup required beyond a webhook URL."
|
|
publishedAt: 2026-04-21
|
|
tags: [channels, discord, integrations, platform]
|
|
---
|
|
|
|
The same question that comes up every time someone deploys an AI agent team: *can we talk to it from where our team already communicates?*
|
|
|
|
For many teams, that place is Discord. Not as a notification sink — as a working interface. Teams run standups, triage issues, and coordinate deployments in Discord channels. The idea of switching to a web UI or a separate tool to interact with an agent feels like a step backward.
|
|
|
|
Molecule AI's Discord adapter makes that unnecessary.
|
|
|
|
## How the Discord Adapter Works
|
|
|
|
The adapter connects an AI agent workspace to a Discord channel using two standard Discord features: **Incoming Webhooks** (for outbound messages) and **Discord Interactions** (for inbound slash commands).
|
|
|
|
**Setup is minimal.** You provide a Discord Incoming Webhook URL — the one that Discord generates when you add a webhook to any channel. That's it. No bot creation in the Developer Portal, no OAuth flow, no Gateway setup. The webhook URL encodes the channel and bot credentials, so a single URL is all the adapter needs to send and receive.
|
|
|
|
On the inbound side, Discord delivers slash command interactions as signed JSON POSTs to your Interactions endpoint. The adapter parses the interaction, reconstructs the slash command as text (`/ask what's our deployment status`), and passes it to the agent as a standard inbound message.
|
|
|
|
On the outbound side, the agent's response is sent back to the same Discord channel via the webhook. Messages longer than 2000 characters are automatically split at word boundaries.
|
|
|
|
## Slash Commands as the Interface
|
|
|
|
Discord bots in guilds can only read messages they have specific permissions for. The Discord adapter sidesteps this entirely by using **slash commands** as the only inbound interface.
|
|
|
|
Users invoke the agent by typing a slash command:
|
|
|
|
```
|
|
/ask what's our current deployment status?
|
|
/ask any open incidents?
|
|
/ask summarize the last 24 hours of test results
|
|
```
|
|
|
|
The command name and options are extracted from the Discord Interactions payload and reconstructed as plain text for the agent. The agent's response goes back to the same channel via the webhook.
|
|
|
|
This means:
|
|
- No message reading permissions required
|
|
- No rate limit concerns from polling
|
|
- Clean, deliberate interaction model — users invoke the agent explicitly
|
|
|
|
## How It Fits Into the Agent Hierarchy
|
|
|
|
A Discord channel connected to a workspace becomes part of the agent hierarchy like any other channel. The Community Manager agent can be the primary interface — it receives the slash command, routes it to the right sub-agent (Security Auditor, QA Engineer, PM), and returns the answer to Discord.
|
|
|
|
```
|
|
Discord server
|
|
↓ slash command
|
|
Community Manager (Molecule AI workspace)
|
|
↓ delegate_task
|
|
Security Auditor / QA Engineer / PM
|
|
↓ response
|
|
Discord channel ← answer
|
|
```
|
|
|
|
The routing is invisible to the Discord user. They see a single response from the Community Manager, with the sub-agent delegation happening entirely within the Molecule AI platform.
|
|
|
|
## Connecting to Canvas
|
|
|
|
The Discord adapter is managed from the **Channels** tab in Canvas, alongside Telegram and other social channels. From there you can:
|
|
|
|
- Connect a Discord channel with a webhook URL
|
|
- Set an allowlist of Discord user IDs or roles (optional — empty means allow everyone)
|
|
- Send a test message to verify the connection
|
|
- View channel status and message counts
|
|
|
|
The adapter also works via API: `POST /workspaces/:id/channels` with `channel_type: "discord"` and the webhook URL in the config.
|
|
|
|
## Security Notes
|
|
|
|
Discord Interactions payloads are verified at the router layer before reaching the adapter — requests without a valid signature are rejected before any parsing occurs.
|
|
|
|
Webhook URLs contain embedded credentials and are stored masked in the database. Error messages throughout the adapter intentionally do not wrap the full webhook URL to prevent credentials leaking into logs or error responses.
|
|
|
|
## What's Next
|
|
|
|
Discord is the third platform adapter, following Telegram. Slack and WhatsApp are next on the roadmap.
|
|
|
|
If you're already running Molecule AI agents and want to connect a Discord server, the Channels tab in Canvas is where to start. The adapter is live now.
|