Skip to main content
Lesson 16 of 16·9 min

Chat With Agent in Slack

The Theme Park agent is deployed and reachable over HTTP. In this lesson, you'll connect it to Slack using Mastra's Channels feature, so you can message it from anywhere Slack runs.

You'll install the @chat-adapter/slack package, add a channels config to the Theme Park agent, and create a Slack app with the right scopes. Mastra exposes the webhook route automatically. Point Slack's Event Subscriptions at it, and messages go straight to the agent.

The same tools, memory, and ticket purchase workflow with its approval gate run from a DM. Channels also supports Discord and Telegram through the same pattern: install the adapter, add it under channels.adapters, set the env vars, deploy, and point the platform webhook at Mastra's generated route.

"You don't build the webhook handler yourself. You don't verify Slack signatures yourself. The adapter handles all of that."

— Guil Hernandez

Mentioned in the lesson
Direct link to Mentioned in the lesson

Code:

Webhook URL format:

https://<your-project>.server.mastra.cloud/api/agents/your-agent-id/channels/slack/webhook

Relevant Mastra docs:

Join the community
Direct link to Join the community

Ask questions:

Follow Mastra:

  • X — follow Mastra for updates
  • YouTube — watch more tutorials
  • LinkedIn — follow for updates