Slack bot that integrates with Mintlify's documentation assistant API to provide intelligent answers to your team's and customers' questions. Built with Cloudflare Workers, Hono, and TypeScript.
- 📚 Smart Documentation Search: Leverages Mintlify's API to search through your documentation
- 🧵 Thread Context Awareness: Maintains conversation context within Slack threads
- 💬 Natural Conversations: Reply in threads without mentioning the bot after initial interaction
- 🔗 Source Citations: Provides numbered source links for every answer
- 👀 Visual Feedback: Shows "eyes" emoji while processing requests
- 🐛 Debug Mode: Add
[DEBUG]
to messages for detailed execution information - ⚡ Fast Response: Built on Cloudflare Workers for edge performance

- Cloudflare account with Workers enabled
- Slack workspace with admin access
- Mintlify API key
- Node.js 18+ and npm/yarn
git clone https://github.com/AnandChowdhary/mintlify-slack-assistant
npm install
-
Go to api.slack.com/apps and create a new app
-
Choose "From scratch" and select your workspace
-
Navigate to OAuth & Permissions and add these scopes:
app_mentions:read
- Read messages that mention your appchat:write
- Send messages as the botreactions:write
- Add emoji reactionsreactions:read
- View emoji reactionschannels:history
- View messages in public channelsgroups:history
- View messages in private channelsim:history
- View messages in DMsmpim:history
- View messages in group DMs
-
Install the app to your workspace and copy the Bot User OAuth Token
- In your Slack app settings, go to Event Subscriptions
- Enable Events and add your Worker URL:
https://your-worker.workers.dev/slack/events
- Subscribe to these bot events:
app_mention
- When someone mentions your botmessage.channels
- Messages in public channelsmessage.groups
- Messages in private channelsmessage.im
- Direct messagesmessage.mpim
- Group direct messages
Create a .dev.vars
file for local development:
SLACK_BOT_USER_OAUTH_TOKEN=xoxb-your-token
MINTLIFY_PUBLIC_ASSISTANT_API_KEY=mint_dsc_your_key
- Create a KV namespace:
wrangler kv:namespace create "KV"
- Update
wrangler.jsonc
with the namespace ID:
{
"kv_namespaces": [
{
"binding": "KV",
"id": "your-namespace-id"
}
]
}
# Deploy to production
wrangler publish
# Or deploy to a specific environment
wrangler publish --env production
Variable | Description | Required |
---|---|---|
SLACK_BOT_USER_OAUTH_TOKEN |
Slack bot OAuth token | ✅ |
MINTLIFY_PUBLIC_ASSISTANT_API_KEY |
Mintlify API key | ✅ |
The bot uses Cloudflare KV to store thread-to-topic mappings with a 7-day TTL. This enables conversation continuity within threads.
Add [DEBUG]
to any message to see:
- Channel and thread information
- KV storage operations
- API request/response details
- Message processing steps
- Bot not responding: Check OAuth scopes and event subscriptions
- No thread context: Verify KV namespace is properly configured
- API errors: Confirm Mintlify API key is valid
MIT (c) Anand Chowdhary