I spent a Saturday afternoon building a Slack bot. By Sunday it was already obsolete.
The bot I built could post a message when a GitHub action finished. That's it. Someone on my team asked it a question — "did the deploy succeed?" — and it stared back blankly. It didn't know. It couldn't check. It was a one-way notification pipe dressed up as a chatbot.
That's the hidden problem with most Slack bots: they're notifications masquerading as intelligence. Slash commands that return canned responses. Webhooks that push data in but can't pull anything out. Meanwhile, your team's actual questions go unanswered. "What's the status of ticket #4821?" "Can you create an invoice for Acme Corp?" "Who's on-call this weekend?" Silence.
This guide shows you how to build a slack bot the right way: the full Slack app setup first, then how to wire an AI model to your real tools via MCP so it can answer questions, take actions, and run on every channel. We'll cover what each step actually does and where people get stuck.
Why most Slack bots don't actually help
I've built both types. There are two fundamentally different things people call a Slack bot. The first is a notification bot: it watches something and posts when that something happens. Build finished. Payment received. Alert fired. These are useful but passive. They can't answer a follow-up question.
The second type is a tool-connected AI bot. It understands natural language, queries your real data sources, and takes actions on your behalf. "Create a Zendesk ticket for this conversation." "Show me open invoices over a threshold amount." "Who was the last engineer to touch this file?" These bots aren't just reacting to events. They're handling work.
| Notification bot | Tool-connected AI bot | |
|---|---|---|
| What it does | Posts messages when events occur | Understands questions, queries tools, takes actions |
| Responds to questions | No — one-way output only | Yes — natural language in, structured response out |
| Reads live data | Only what the webhook payload contains | Any connected tool: DB, CRM, ticketing, payments |
| Takes actions | No | Yes — creates tickets, queries records, runs lookups |
| Setup complexity | Low — incoming webhook or simple bot token | Medium — AI model plus MCP tool connections |
| Works on other channels too | Requires a separate bot per platform | One definition, all channels (with Aerostack) |
Most tutorials teach you how to build the first type and stop. That's fine if all you need is a notification pipe. But if your team is asking the bot real questions, you need the second type, and that requires wiring an LLM to your actual toolset. That's what the MCP architecture makes practical.
How a Slack bot works under the hood
Before you create anything, it helps to understand the flow. When someone messages your Slack AI integration, here's what happens:
The key constraint: Slack's Events API requires a publicly reachable HTTPS URL that can respond within 3 seconds. The verification payload arrives the moment you paste your URL into the portal, so your server must be live before that step. This is why "create the bot on your platform first, then configure Slack" is the correct order, not the other way around.
Step-by-step: create a Slack app and get your credentials
These are the Slack-side steps you'll need regardless of what you build the bot on. You'll need a Slack workspace where you have admin rights.
Create a Slack app
- Go to the Slack API portal and create your app
Head to api.slack.com/apps and click "Create New App". Choose "From scratch". Give it a name and select your workspace. You don't need to pick a manifest or template — scratch is simpler.
- Add Bot Token Scopes
In the left sidebar, click "OAuth & Permissions". Scroll to "Scopes" then "Bot Token Scopes". Add these six scopes: chat:write, channels:read, channels:history, users:read, im:history, app_mentions:read. These cover DMs, channel messages, and @mention events.
- Install to workspace and copy the Bot Token
Scroll up on the OAuth & Permissions page and click "Install to Workspace". Authorize. You'll see the "Bot User OAuth Token" starting with xoxb-. Copy it now. This is the token your slack ai integration uses to post messages.
- Copy the Signing Secret
In the left sidebar, click "Basic Information". Under "App Credentials", click "Show" next to the Signing Secret. Copy it. This is what your server uses to verify that incoming payloads actually came from Slack.
- Enable Event Subscriptions (do this AFTER your server is live)
In the left sidebar, click "Event Subscriptions". Toggle "Enable Events" to ON. Paste your bot's webhook URL as the Request URL. Wait for the green "Verified" checkmark — Slack sends a challenge request and your server must respond immediately. Then add bot events: message.im and app_mention. Click "Save Changes" and reinstall the app.
Slack's permission model can be confusing at first. Here's what each scope controls and why it's needed:
| Scope | What it allows | Why you need it |
|---|---|---|
| chat:write | Post messages to channels and DMs | Without this your bot can't reply |
| app_mentions:read | Receive events when @mentioned | Handles @BotName in channels |
| im:history | Read DMs sent to the bot | Required for direct message conversations |
| channels:history | Read messages in channels the bot is in | Context for multi-turn conversations |
| channels:read | List channels and their metadata | Lets the bot know what channels exist |
| users:read | Look up user info by ID | Resolve user names in replies |
A common mistake I see is adding more scopes than necessary. Slack audits installed apps and unnecessary scopes get flagged in security reviews. They can slow down workspace approval for enterprise customers. I'd start with these six and add more only when a specific feature requires it.
Build a Slack bot with AI and real tool access
Here's where most tutorials end and where the actual problem starts. You've got a working Slack app. You've got credentials. Now you need a server that handles Slack's event payloads, verifies signatures, integrates an LLM, connects to your tools, manages conversation history, handles retries, and runs behind a stable public HTTPS URL. That's a two-week project before your bot can answer a single question about your own data.
Aerostack handles all of that infrastructure. The slack mcp bot wizard takes you from credentials to a live AI bot in five steps. You bring the Slack credentials, pick the tools you want it to call, and the platform manages the rest.
The Aerostack bot wizard walkthrough
I've run through this wizard a few times now. Here's what each step does and what to watch for.
Create a Slack AI bot with Aerostack
- Open the bot wizard and pick a template
Head to app.aerostack.dev, go to Bots, and click New Bot. Choose a starting template: Support Bot, Data Bot, or blank. The template sets the initial system prompt. You can edit it freely later.
- Select Slack as the channel
On the Platform step, select Slack. You'll see two input fields: Bot User OAuth Token (xoxb-) and Signing Secret. Paste the credentials you copied from the Slack API portal.
- Create and activate — get your webhook URL
Click "Create & Activate Bot". Aerostack creates the bot, assigns it a stable webhook URL in the format https://api.aerostack.dev/api/bots/webhook/slack/{your-bot-id}, and starts listening for Slack events. Copy this URL.
- Paste the webhook URL into Slack Event Subscriptions
Return to the Slack API portal, go to your app, then Event Subscriptions. Paste the Aerostack webhook URL. The Verified checkmark appears within a second because Aerostack responds to Slack's challenge automatically. Add message.im and app_mention under "Subscribe to bot events". Save Changes, then reinstall the app.
- Connect MCP tools from the workspace
In the bot dashboard, click Connect Tools to open the MCP workspace. Browse the catalog: Postgres, Stripe, Notion, Zendesk, Linear, GitHub, and more. Add the tools relevant to your use case. Each tool you connect becomes a function the bot's LLM can call when answering questions.
$ https://api.aerostack.dev/api/bots/webhook/slack/{your-bot-id}
Slack Event Subscriptions > Request URL > paste this > wait for Verified checkmark Which MCP tools to connect for your team
Not every bot needs all 254 available tools. Here's how I'd approach the decision based on what different teams actually ask for:
| Use case | Postgres | Notion | Stripe | Zendesk | Linear | GitHub |
|---|---|---|---|---|---|---|
| Engineering team bot | yes | maybe | no | no | yes | yes |
| Support team bot | maybe | yes | yes | yes | no | no |
| Finance team bot | yes | no | yes | no | no | no |
| Operations bot | yes | yes | maybe | yes | yes | no |
My rule: connect the tools that contain the data your team currently looks up manually in browser tabs. If someone's opening Stripe in one tab and Zendesk in another to answer a customer question, that's the bot's job.
I'd recommend pairing this with the MCP gateway — it gives your bot a single URL that routes to all 250+ tools, so you paste it once and pick up new tools without reconfiguring the Slack connection.
One bot definition, every channel
The bot you just built on Slack can also run on Discord, Telegram, and WhatsApp using the exact same system prompt and tool connections. In Aerostack, a bot is a definition: a system prompt, a model selection, and a set of connected tools. You add a Slack channel to it, or a Discord server, or a Telegram bot token. They're all delivery endpoints. The intelligence is shared.
If you update the system prompt or add a new MCP tool, the change applies across every channel at once. No per-platform code changes, no separate deployments.
If you've already worked through the discord bot MCP tutorial, the same bot definition extends to Slack in under two minutes. No changes to the bot itself, just paste in your Slack credentials as a new channel.
Slack-specific behavior your bot handles automatically
Slack has a few quirks worth knowing about. The 3-second acknowledgment rule is the big one: when Slack sends an event, your server must respond with HTTP 200 within 3 seconds or Slack retries repeatedly with exponential backoff. If your LLM call takes 8 seconds (common with tool use), you need to acknowledge immediately and post the response asynchronously. Aerostack handles this internally, so you don't think about it.
Thread replies are the second quirk. When a bot receives an @mention in a channel, it's cleaner to reply in a thread rather than the main channel feed. This keeps conversations organized and doesn't flood the channel. Aerostack's Slack handler defaults to threading: it detects the original message's thread_ts and replies there.
Common mistakes when you build a Slack bot for the first time
I've seen the same issues come up repeatedly. The ordering mistake is the most common:
The workflow must be: create your bot server first, get a live URL, then go back to Slack and configure Event Subscriptions. I've seen teams waste hours on this. Do it in reverse and Slack's verification request hits a server that isn't ready. The error looks like a credentials problem. It's a sequencing problem.
If you want to replicate this pattern for a different messaging platform, I'd recommend reading the build a Telegram bot with MCP guide — the setup pattern is almost identical and the bot definition transfers directly.
Frequently asked questions about building a Slack bot
Do I need to pay for a Slack workspace to build a bot?
No. You can create a free Slack workspace and build bots on it. Free workspaces have some message history limits but full API access for bot development. Slack's API and bot functionality are available on all plans including free.
What's the difference between a Slack app and a Slack bot?
A Slack app is the container — it holds permissions, webhook URLs, and configuration. A bot user is one component of the app, the entity that can send messages and respond to events. When people say "Slack bot", they usually mean a Slack app that includes a bot user and subscribes to message events. You need to create both.
What is a Slack MCP bot exactly?
A Slack MCP bot is an AI bot that runs inside Slack and calls external tools via the Model Context Protocol. Instead of being limited to canned responses or webhook notifications, it can query live data from Postgres, Stripe, Zendesk, or any other MCP-compatible tool when answering questions. The MCP layer is what makes it genuinely useful rather than just a notification pipe.
Can I connect the same bot to multiple Slack workspaces?
Yes, but it requires OAuth app distribution — you'd build a public Slack app that users install into their workspaces via the standard OAuth flow. For internal bots covering one workspace, the single-workspace install used in this guide is simpler and sufficient.
How long does it take to build a Slack bot with Aerostack?
The Slack API setup takes about 5 minutes once you know the steps. Creating the bot on Aerostack, connecting tools, and configuring event subscriptions adds another 5-10 minutes. You can have a working AI bot with MCP tool access in under 15 minutes on a first attempt.
What Slack scopes does an AI bot need?
For a conversational AI bot, the minimum scopes are: chat:write (post replies), app_mentions:read (receive @mention events in channels), and im:history (receive direct messages). If you want the bot active in channels without @mention, add channels:history. Start minimal — Slack flags apps with excessive scopes in enterprise workspace security reviews, and unnecessary scopes can slow down workspace approval.
The full guide to connecting bots across channels is at the ai chatbot builder page — it covers multi-channel setup, system prompt design, and tool selection patterns.