Your agent can now respond to mentions and messages on Slack, Discord, Telegram and more. Attach channel adapters and connect a single agent to multiple platforms without building custom integrations.
Mastra supports all official adapters from Vercel's Chat SDK.
Channels don't change how your agent works. You can still interact, test, iterate and observe it from Studio.
Get started
Install adapters for the platforms you want to use (requires @mastra/core@1.22.0 or later):
1npm install @chat-adapter/slack @chat-adapter/discordAdd adapters for each platform. This example connects the agent to both Slack and Discord.
1import { Agent } from "@mastra/core/agent";
2import { createSlackAdapter } from "@chat-adapter/slack";
3import { createDiscordAdapter } from "@chat-adapter/discord";
4
5export const channelAgent = new Agent({
6 id: "channel-agent",
7 name: "Channel Agent",
8 model: "anthropic/claude-opus-4-6",
9 instructions: "You are a helpful assistant. Answer questions, help with tasks, and have natural conversations.",
10 channels: {
11 adapters: {
12 slack: createSlackAdapter(),
13 discord: createDiscordAdapter()
14 }
15 }
16});
17
18// Adapters read credentials from environment variables.
19// See the Chat SDK docs for setup:
20// Slack: https://chat-sdk.dev/adapters/slack
21// Discord: https://chat-sdk.dev/adapters/discordMastra exposes a webhook URL for each adapter on your agent's endpoint. Add it to your platform's event configuration to start receiving messages. For example:
1<your-server-url>/api/agents/channel-agent/channels/slack/webhookFollow this step-by-step guide on how to set up a Slack app with the correct permissions.
For more information and full configuration options, see:
