Skip to content

Slack Gateway

BMO can expose a Slack Socket Mode gateway for direct messages via:

Terminal window
bmo gateway --config gateway.yaml
  • Slack is the only built-in gateway adapter in this repo.
  • Direct messages are the only supported interaction mode.
  • Group channels, thread routing, and mention-based activation are not supported by this gateway.

If you start the gateway with --addr, BMO exposes:

  • GET /health for liveness only

/health does not validate Slack credentials or adapter connectivity. Treat a healthy response as process liveness only.

For local readiness without contacting Slack, run:

Terminal window
bmo gateway check --config gateway.yaml
bmo gateway check --config gateway.yaml --json

The check validates the YAML config, supported Slack channel shape, direct-message routing scope, local gateway session store, worker capacity, and liveness binding. Output is token-redacted. Add --live-slack only when you intentionally want BMO to call Slack Web API methods with the configured credentials.

Use a YAML config file:

approval_mode: 0 # auto approval
channels:
- type: slack
slack:
app_token: xapp-...
bot_token: xoxb-...
router:
dm_scope: 2 # per channel+peer direct-message sessions

Gateway approval mode supports auto approval. Use a DM routing scope that matches how you want direct messages mapped into BMO sessions.

Configure the Slack app around the BMO gateway contract: Slack-only, DM-first, Socket Mode.

  • Create a new internal Slack app for the target workspace.
  • Add a bot user to the app.
  • Turn on Socket Mode for the app.
  • Create an app-level token (xapp-...).
  • Grant the app-level token the connections:write scope.

BMO uses the app token to open the Socket Mode connection.

Add these bot token scopes:

  • chat:write
  • im:history

BMO uses the bot token for auth.test, DM event handling, and message replies.

Under Event Subscriptions, enable events and add:

  • message.im

The gateway listens for Slack direct-message events.

  • Install or reinstall the app after scopes and events are configured.
  • Copy the bot token (xoxb-...) after installation.

You need both:

  • app_token: xapp-...
  • bot_token: xoxb-...

Check local posture first:

Terminal window
bmo gateway check --config gateway.yaml

This command does not send a Slack DM and does not contact Slack unless you add --live-slack.

Terminal window
bmo gateway --config gateway.yaml

Optional liveness endpoint:

Terminal window
bmo gateway --config gateway.yaml --addr :8081
  • Send the bot a direct message in Slack.
  • Confirm BMO receives it and replies.
  • Confirm Slack channels remain ignored.
  • The /health endpoint exposes liveness, not readiness; use bmo gateway check for local readiness posture.
  • No support for Slack channels or mention-triggered activation.
  • Slack MCP tools are configured separately and are not this inbound gateway.
  • Teams, Mattermost, Telegram, Discord, and Google Chat adapters are not implemented.