M8B Slack Bot

M8B Slack Bot (MetricsHub)

M8B is a grumpy but competent system administrator living in Slack. Ask it about your infrastructure and it queries your MetricsHub agents over MCP, runs PromQL, reads your knowledge base, analyzes the screenshots and data files you post, and streams the answer back into the thread. It runs on hosted OpenAI or on a model you host yourself (Ollama, vLLM, or any OpenAI-compatible /v1/responses endpoint); in self-hosted modes nothing is ever sent to OpenAI. Outbound traffic goes to your own inference endpoint, to the public web pages users ask the bot to read (the page reader is on by default), and to a web search backend when you configure one; see privacy.

Requirements

Install

M8B is distributed as a Docker image at docker.metricshub.com. Pulling it requires MetricsHub customer registry credentials.

Create an installation directory, authenticate and pull the image:

mkdir m8b-slack
cd m8b-slack
docker login docker.metricshub.com
docker pull docker.metricshub.com/metricshub/m8b-slack:latest

Copy the supplied Compose file and SearXNG template from the image using a temporary container. Run this in the new installation directory; copying the deployment files over an existing installation would replace its templates. This does not start the bot or require any Slack or AI credentials:

docker create --name m8b-install-files docker.metricshub.com/metricshub/m8b-slack:latest
docker cp m8b-install-files:/app/deploy/. .
docker rm m8b-install-files

This creates docker-compose.yml and searxng/settings.yml locally. To pin a published version, replace latest in both commands above and M8B_IMAGE_TAG below with that tag (3.0.0 or later; earlier images do not contain the deployment files).

1. Create the Slack app

  1. Go to https://api.slack.com/apps/new and choose From an app manifest.
  2. Pick your workspace, paste the contents of manifest.json into the JSON tab, Next, Create.
  3. Install App to your workspace. In workspaces where app installation is restricted, this sends a request to a workspace administrator; nothing below is available until it is approved.
  4. Once installed, copy the Bot User OAuth Token (xoxb-...) from OAuth & Permissions (it does not exist before the installation), then create an App-level token with connections:write (xapp-...) under Basic Information > App-Level Tokens.

The manifest uses Slack’s Agent messaging experience: conversations live in the app’s Messages tab, each message starting or continuing a thread. The bot also answers @M8B mentions in channels.

2. Configure

Create a file named .env in the installation directory with the following contents, replacing the token/key placeholders. Restrict access to this file to the installation administrator.

M8B_IMAGE_TAG=latest
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token

# Hosted OpenAI (default)
AI_PROVIDER=openai
OPENAI_API_KEY=sk-...

# Or replace the two OpenAI settings above with a self-hosted backend. All of
# them use AI_* variables; OPENAI_API_KEY is ignored (put the backend's token,
# if any, in AI_API_KEY). Ollama:
# AI_PROVIDER=ollama
# AI_BASE_URL=http://ollama-host:11434/v1
# AI_MODEL=qwen3.8:27b
# vLLM (the served model is adopted automatically when there is exactly one):
# AI_PROVIDER=vllm
# AI_BASE_URL=http://vllm-host:8000/v1
# AI_API_KEY=...

Add a MetricsHub agent when you have one. Its MCP endpoint is https://<agent-host>:31888/sse (/mcp on MetricsHub versions serving Streamable HTTP; port 31888 unless the agent administrator changed it), with the API key from the agent’s configuration:

MCP_AGENT_URL=https://metricshub.example.com:31888/sse
MCP_AGENT_TOKEN=...
# Only when the agent uses a self-signed certificate:
# MCP_ALLOW_SELF_SIGNED_CERT=true

The bot refers to this agent by its hostname (MCP_AGENT_LABEL overrides it). Several agents are configured with MCP_SERVERS or M8B_MCP_CONFIG instead.

Every variable is documented in CONFIGURATION.md.

3. Run with Docker

The deployment files were copied from the image above. With .env configured, start the services:

docker compose up -d
docker compose logs -f m8b

Compose starts the bot and a private SearXNG service for web search, stores data in the m8b-data volume, and runs as a non-root user. Use hostnames reachable from the container in AI_BASE_URL and MCP URLs (localhost is the bot container). See Docker Compose configuration for upgrades and customization.

4. Check

The image runs at the production log level and only prints warnings and errors. A failed AI health check or malformed configuration stops the bot with a reason in docker compose logs m8b. For a complete checklist of Slack scopes, MCP servers, AI, embeddings, web search and storage, run:

docker compose run --rm m8b node scripts/doctor.js

Then open the app in Slack and ask “M8B, please list all the systems you are currently monitoring.”

Documentation

License

MIT License.