Skip to content

Commit b7d23fa

Browse files
committed
feat: slack bot
1 parent b7c8e98 commit b7d23fa

File tree

6 files changed

+264
-0
lines changed

6 files changed

+264
-0
lines changed
63.9 KB
Loading
46.2 KB
Loading

mission-control/docs/integrations/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Mission Control integrates with a wide range of platforms and services. Each int
4040
| <Icon name="postgres"/> [PostgreSQL](/docs/integrations/postgres) ||| | |
4141
| <Icon name="prometheus"/> [Prometheus](/docs/integrations/prometheus) || | | |
4242
| <Icon name="slack"/> [Slack](/docs/integrations/slack) | ||| |
43+
| <Icon name="slack"/> [Slack Bot](/docs/integrations/slack-bot) | | | ||
4344
| <Icon name="mssql"/> [SQL Server](/docs/integrations/sql-server) ||| | |
4445
| <Icon name="terraform"/> [Terraform](/docs/integrations/terraform) | || | |
4546
| <Icon name="trivy"/> [Trivy](/docs/integrations/trivy) | || | |
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
---
2+
title: Slack Bot
3+
sidebar_custom_props:
4+
icon: slack
5+
---
6+
7+
import Tabs from '@theme/Tabs'
8+
import TabItem from '@theme/TabItem'
9+
10+
Mission Control Assistant is a Slack bot that responds to direct messages and @mentions. The bot uses Slack Socket Mode, which opens a WebSocket connection so you do not expose a public webhook endpoint.
11+
12+
## Slack app creation and installation
13+
14+
### Before you start
15+
16+
- A Slack workspace where you can create apps
17+
- An Anthropic, OpenAI, or Google Generative AI API key for the LLM provider
18+
19+
20+
### Create the Slack app
21+
22+
1. Go to [api.slack.com/apps](https://api.slack.com/apps) and select **Create New App**.
23+
2. Choose **From scratch**, name the app, and select the workspace.
24+
3. Select **Create App**.
25+
26+
![](./api.slack.com_apps.png)
27+
28+
### Enable Socket Mode
29+
30+
Open **Settings****Socket Mode** and turn on **Enable Socket Mode**.
31+
32+
You'll be prompted to generate an app-level token with access to the `connections:write` scope.
33+
34+
![](./app-level-token.png)
35+
36+
Store the token value as `SLACK_APP_TOKEN` env var.
37+
38+
### Enable App Home messages
39+
40+
Open **Features****App Home** and enable these settings:
41+
42+
- **Messages Tab**
43+
- **Allow users to send Slash commands and messages from the messages tab**
44+
45+
These settings let users send direct messages to the bot from the App Home Messages tab. Without them, Slack disables messages to the app.
46+
47+
### Add bot token scopes
48+
49+
Open **Features****OAuth & Permissions** and add these bot token scopes:
50+
51+
| Scope | Description |
52+
| --- | --- |
53+
| `app_mentions:read` | View messages that directly mention @Mission Control AI Assistant in conversations that the app is in. |
54+
| `chat:write` | Send messages as @Mission Control AI Assistant. |
55+
| `groups:history` | View messages and other content in private channels that Mission Control AI Assistant has been added to. |
56+
| `im:history` | View messages and other content in direct messages that Mission Control AI Assistant has been added to. |
57+
| `im:read` | View basic information about direct messages that Mission Control AI Assistant has been added to. |
58+
| `im:write` | Start direct messages with people. |
59+
60+
### Add bot events
61+
62+
Open **Features****Event Subscriptions**, enable events, and subscribe the bot to these events:
63+
64+
| Event name | Description | Required scope |
65+
| --- | --- | --- |
66+
| `app_mention` | Subscribe to only the message events that mention your app or bot. | `app_mentions:read` |
67+
| `message.im` | A message was posted in a direct message channel. | `im:history` |
68+
69+
### Install the app
70+
71+
Finally, you can go back to **Features****OAuth & Permissions** and select **Install to Workspace**.
72+
73+
After installation, you'll see the Bot User OAuth Token (starts with `xoxb-`) on that same page.
74+
Store the token value as `SLACK_BOT_TOKEN` env var.
75+
76+
## Mission Control MCP URL and token
77+
78+
You need the MCP URL and bearer token to connect the bot to Mission Control tools.
79+
80+
### Get the MCP URL and token
81+
82+
Use the Setup MCP flow to get both values.
83+
84+
1. In Mission Control, open the user menu and select **Setup MCP**.
85+
2. Select **Create new token**.
86+
3. In the token details dialog, select **Slack Bot** and copy `MCP_URL` and `MCP_BEARER_TOKEN`.
87+
88+
![](./token-mcp-slack.png)
89+
90+
## Deployment
91+
92+
#### Create the Kubernetes Secrets (Helm and Flux)
93+
94+
Create three Secrets for Slack, LLM, and MCP credentials before you deploy with Helm or Flux.
95+
96+
```yaml title="slack-secret.yaml"
97+
apiVersion: v1
98+
kind: Secret
99+
metadata:
100+
name: mission-control-slack-bot-slack
101+
type: Opaque
102+
stringData:
103+
SLACK_BOT_TOKEN: xoxb-your-bot-token
104+
SLACK_APP_TOKEN: xapp-your-app-token
105+
```
106+
107+
```yaml title="llm-secret.yaml"
108+
apiVersion: v1
109+
kind: Secret
110+
metadata:
111+
name: mission-control-slack-bot-llm
112+
type: Opaque
113+
stringData:
114+
ANTHROPIC_API_KEY: sk-ant-your-api-key
115+
```
116+
117+
```yaml title="mcp-secret.yaml"
118+
apiVersion: v1
119+
kind: Secret
120+
metadata:
121+
name: mission-control-slack-bot-mcp
122+
type: Opaque
123+
stringData:
124+
MCP_URL: https://mission-control.example.com/mcp
125+
MCP_BEARER_TOKEN: your-mcp-token
126+
```
127+
128+
129+
130+
<Tabs>
131+
<TabItem label="kubectl Helm release" value="helm" default>
132+
133+
### Create Secrets
134+
135+
136+
```bash title="Apply the Slack bot secrets"
137+
kubectl apply -f slack-secret.yaml
138+
kubectl apply -f llm-secret.yaml
139+
kubectl apply -f mcp-secret.yaml
140+
```
141+
142+
#### Create the values file
143+
144+
Create a Helm values file to set the secret name and LLM settings for the chart. Update the provider, model, and log level to match your environment.
145+
146+
```yaml title="slack-bot-values.yaml"
147+
slack:
148+
secretName: mission-control-slack-bot-slack
149+
llm:
150+
provider: anthropic
151+
secretName: mission-control-slack-bot-llm
152+
secretKey: ANTHROPIC_API_KEY
153+
model: claude-haiku-4-5
154+
mcp:
155+
secretName: mission-control-slack-bot-mcp
156+
```
157+
158+
#### Add the Helm repository
159+
160+
Add the Flanksource Helm repository so Helm can find the Slack bot chart.
161+
162+
```bash title="Add the Flanksource Helm repository"
163+
helm repo add flanksource https://flanksource.github.io/charts
164+
```
165+
166+
#### Update the Helm repository
167+
168+
Update the Helm repository index so Helm can install the latest chart version.
169+
170+
```bash title="Update the Helm repository index"
171+
helm repo update flanksource
172+
```
173+
174+
This command refreshes the `flanksource` repository metadata on your workstation.
175+
176+
#### Install the chart
177+
178+
Install the chart from the Flanksource Helm repository so Kubernetes runs the deployment with your values.
179+
180+
```bash title="Install the Slack bot chart"
181+
helm upgrade --install mission-control-slack-bot flanksource/mission-control-ai-assistant -f slack-bot-values.yaml -n mission-control --create-namespace
182+
```
183+
184+
The `flanksource/mission-control-ai-assistant` chart name targets the Slack bot chart, `-f` loads your values file, and `--create-namespace` creates the namespace when it does not exist.
185+
186+
</TabItem>
187+
<TabItem label="Flux Helm release" value="flux">
188+
189+
#### Create the HelmRepository
190+
191+
Define the Flanksource Helm repository so Flux can fetch the chart.
192+
193+
```yaml title="slack-bot-helm-repository.yaml"
194+
apiVersion: source.toolkit.fluxcd.io/v1
195+
kind: HelmRepository
196+
metadata:
197+
name: flanksource
198+
namespace: mission-control
199+
spec:
200+
interval: 10m
201+
url: https://flanksource.github.io/charts
202+
```
203+
204+
#### Create the HelmRelease
205+
206+
Create a HelmRelease that points to the Slack bot chart and sets the values for your Slack and LLM credentials.
207+
208+
```yaml title="slack-bot-helm-release.yaml"
209+
apiVersion: helm.toolkit.fluxcd.io/v2
210+
kind: HelmRelease
211+
metadata:
212+
name: mission-control-slack-bot
213+
namespace: mission-control
214+
spec:
215+
interval: 10m
216+
chart:
217+
spec:
218+
chart: mission-control-ai-assistant
219+
sourceRef:
220+
kind: HelmRepository
221+
name: flanksource
222+
namespace: mission-control
223+
interval: 10m
224+
values:
225+
slack:
226+
secretName: mission-control-slack-bot-slack
227+
llm:
228+
provider: anthropic
229+
secretName: mission-control-slack-bot-llm
230+
secretKey: ANTHROPIC_API_KEY
231+
model: claude-haiku-4-5
232+
mcp:
233+
secretName: mission-control-slack-bot-mcp
234+
```
235+
236+
#### Add a flux Kustomization
237+
238+
Use a Kustomization to apply the HelmRelease and Secrets together.
239+
240+
```yaml title="kustomization.yaml"
241+
apiVersion: kustomize.config.k8s.io/v1beta1
242+
kind: Kustomization
243+
resources:
244+
- slack-secret.yaml
245+
- llm-secret.yaml
246+
- mcp-secret.yaml
247+
- slack-bot-helm-repository.yaml
248+
- slack-bot-helm-release.yaml
249+
```
250+
251+
</TabItem>
252+
</Tabs>
84.5 KB
Loading

styles/ignore/words-with-suggestions.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ config_id
118118
configmap
119119
configmaps
120120
Configmaps
121+
Flux
122+
HelmRelease
123+
HelmRepository
121124
configs
122125
consumesApis
123126
containerd
@@ -475,3 +478,11 @@ YAMLArray
475478
Youtube
476479
yq
477480
Zulip
481+
Anthropic
482+
Docker
483+
Helm
484+
LLM
485+
MCP
486+
OpenAI
487+
Slack
488+
WebSocket

0 commit comments

Comments
 (0)