A self-hosted Slack bot that connects to an EventCatalog MCP server, allowing users to query their eventcatalog documentation directly from Slack.
Note: This bot requires an EventCatalog Scale license.
- Architecture
- Prerequisites
- Slack App Setup
- Configuration
- Running Locally
- Deployment
- Usage
- Supported AI Providers
- Troubleshooting
- User @mentions the bot (e.g.,
@eventcatalog Tell me about the OrderCreated event) - Bot connects to your EventCatalog MCP server and queries your documentation
- AI-powered response is posted back to the user in a thread
- Node.js 22+
- An EventCatalog Scale license
- An EventCatalog instance with MCP enabled
- A Slack workspace where you can create apps
- An API key for your chosen AI provider (Anthropic, OpenAI, or Google)
You can create the Slack app either using a manifest (recommended) or manually.
- Go to api.slack.com/apps
- Click Create New App → From an app manifest
- Select your workspace and click Next
- Choose YAML and paste the following manifest:
display_information:
name: EventCatalog Bot
description: Query your EventCatalog directly from Slack
background_color: "#000000"
features:
bot_user:
display_name: EventCatalog
always_online: true
oauth_config:
scopes:
bot:
- app_mentions:read
- chat:write
- reactions:read
- reactions:write
- channels:history
settings:
event_subscriptions:
bot_events:
- app_mention
- message.channels
interactivity:
is_enabled: false
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false- Click Next, review the summary, and click Create
- After creation, go to Basic Information → App-Level Tokens
- Click Generate Token and Scopes:
- Name:
socket-mode-token - Add scope:
connections:write
- Name:
- Click Generate and copy the token (starts with
xapp-) - this is yourSLACK_APP_TOKEN - Go to OAuth & Permissions and click Install to Workspace
- Copy the Bot User OAuth Token (starts with
xoxb-) - this is yourSLACK_BOT_TOKEN - Go to Basic Information → App Credentials and copy the Signing Secret - this is your
SLACK_SIGNING_SECRET
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Name your app (e.g., "EventCatalog Bot") and select your workspace
- Click Create App
- In the left sidebar, click Socket Mode
- Toggle Enable Socket Mode to On
- When prompted, create an App-Level Token:
- Name:
socket-mode-token - Scope:
connections:write
- Name:
- Click Generate
- Copy the token (starts with
xapp-) - this is yourSLACK_APP_TOKEN
- In the left sidebar, click OAuth & Permissions
- Scroll to Scopes → Bot Token Scopes
- Add these scopes:
app_mentions:read- Receive @mention eventschat:write- Send messagesreactions:read- Read reactionsreactions:write- Add/remove reactionschannels:history- Read public channel messages (for thread context)
- In the left sidebar, click Event Subscriptions
- Toggle Enable Events to On
- Expand Subscribe to bot events
- Add these events:
app_mentionmessage.channels(if using auto-reply channels)
- In the left sidebar, click OAuth & Permissions
- Click Install to Workspace
- Review permissions and click Allow
- Copy the Bot User OAuth Token (starts with
xoxb-) - this is yourSLACK_BOT_TOKEN
- In the left sidebar, click Basic Information
- Scroll to App Credentials
- Copy the Signing Secret - this is your
SLACK_SIGNING_SECRET
Create a .env file:
# EventCatalog Scale License (Required)
EVENTCATALOG_SCALE_LICENSE_KEY=XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
# Slack (Required)
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
SLACK_SIGNING_SECRET=...
# AI Provider (at least one required)
ANTHROPIC_API_KEY=sk-ant-...
# OPENAI_API_KEY=sk-...
# GOOGLE_GENERATIVE_AI_API_KEY=...Create eventcatalog-bot.config.ts:
export default {
eventCatalog: {
url: 'https://your-catalog.example.com',
// Optional: Add authentication headers
// headers: {
// 'Authorization': 'Bearer your-token',
// },
},
ai: {
provider: 'anthropic', // 'anthropic' | 'openai' | 'google'
// model: 'claude-sonnet-4-20250514', // Optional: override default model
maxSteps: 5,
temperature: 0.4,
},
slack: {
// Optional: Channel IDs for auto-reply (bot responds to all messages)
autoReplyChannels: [],
// Optional: Custom icon URL for bot messages
icon: 'https://your-domain.com/bot-icon.png',
// Optional: Custom display name for bot messages
username: 'EventCatalog',
},
};pnpm installpnpm devOr with a custom config path:
pnpm dev --config ./my-config.tsThe bot uses Socket Mode, so it doesn't need a public URL or incoming webhooks - it maintains an outbound WebSocket connection to Slack. This makes it easy to deploy anywhere.
# Build the image
docker build -t eventcatalog-slack-bot .
# Run with docker-compose
docker compose up -d
# View logs
docker compose logs -fWhen running the bot in Docker, the container needs to reach your EventCatalog server. The approach depends on where EventCatalog is running:
EventCatalog running locally (on your host machine):
The bot container cannot use localhost to reach your host machine. You have two options:
-
Use
host.docker.internal(recommended for local development):Update your
eventcatalog-bot.config.ts:eventCatalog: { url: 'http://host.docker.internal:3000', }
Note: This requires your EventCatalog server to bind to all interfaces (
0.0.0.0), not justlocalhost. Check your EventCatalog startup - if it only showslocalhost:3000, you may need to start it with a--host 0.0.0.0flag or equivalent configuration. -
Run the bot outside Docker for local development:
pnpm install pnpm dev
This avoids networking complexity and is often simpler during development.
EventCatalog running in Docker:
Put both containers on the same Docker network and use the container name as the hostname:
# docker-compose.yml
services:
eventcatalog:
# your eventcatalog config
networks:
- app-network
eventcatalog-slack-bot:
build: .
env_file:
- .env
volumes:
- ./eventcatalog-bot.config.ts:/app/eventcatalog-bot.config.ts:ro
networks:
- app-network
networks:
app-network:Then in your config:
eventCatalog: {
url: 'http://eventcatalog:3000',
}EventCatalog deployed to a public URL:
Simply use the public URL - no special configuration needed:
eventCatalog: {
url: 'https://your-catalog.example.com',
}- Create a new project and connect your repository
- Add environment variables in the Railway dashboard:
EVENTCATALOG_SCALE_LICENSE_KEYSLACK_BOT_TOKENSLACK_APP_TOKENSLACK_SIGNING_SECRETANTHROPIC_API_KEY(or your chosen provider)
- Add your
eventcatalog-bot.config.tsto the repository - Deploy - Railway will automatically detect the Dockerfile
# Install flyctl and login
fly launch --no-deploy
# Set secrets
fly secrets set EVENTCATALOG_SCALE_LICENSE_KEY=your-key
fly secrets set SLACK_BOT_TOKEN=xoxb-...
fly secrets set SLACK_APP_TOKEN=xapp-...
fly secrets set SLACK_SIGNING_SECRET=...
fly secrets set ANTHROPIC_API_KEY=sk-ant-...
# Deploy
fly deploy- Create a new Background Worker (not a Web Service)
- Connect your repository
- Set the build command:
pnpm install && pnpm build - Set the start command:
pnpm start - Add environment variables in the Render dashboard
- Deploy
Deploy as a container or long-running process. Since the bot uses Socket Mode, it doesn't need:
- Load balancers
- Public endpoints
- SSL certificates
Just ensure the process stays running and can make outbound HTTPS/WSS connections.
There are two ways to interact with the bot:
Invite the bot to any channel and @mention it to ask questions:
@eventcatalog Tell me about the OrderCreated event
@eventcatalog What services consume the InventoryUpdated event?
@eventcatalog List all events in the Orders domain
The bot will reply in a thread to keep channels organized.
Create a dedicated channel where the bot automatically responds to every message - no @mention needed. This gives your team a go-to place for architecture questions.
Setup:
- Create a channel (e.g.,
#ask-eventcatalogor#ask-eda) - Invite the bot to the channel
- Get the channel ID (right-click channel → View channel details → scroll to bottom)
- Add the channel ID to your config:
slack: {
autoReplyChannels: ['C0123456789'],
}Now anyone can post questions directly in the channel and get instant answers.
When you interact with the bot in a thread, it automatically reads the conversation history. This allows for natural follow-up questions:
- "Tell me more about that"
- "What are its consumers?"
- "Show me the schema"
Thread context works automatically in public channels. For private channels and DMs, optionally add these scopes to your Slack app:
groups:history- Private channelsim:history- Direct messagesmpim:history- Group DMs
| Provider | Environment Variable | Default Model |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
claude-sonnet-4-20250514 |
| OpenAI | OPENAI_API_KEY |
gpt-4o |
GOOGLE_GENERATIVE_AI_API_KEY |
gemini-2.0-flash |
- Check that the bot is invited to the channel
- Verify Socket Mode is enabled in Slack app settings
- Check logs for connection errors
Ensure you have the correct API key set for your configured AI provider.
- Verify your EventCatalog URL is correct
- Check that MCP is enabled in your EventCatalog
- If using authentication, verify headers are correct
Review the OAuth scopes in your Slack app and ensure all required scopes are added.
Copyright (c) EventCatalog Ltd. All rights reserved.
Usage of this software requires a valid EventCatalog Scale license.