You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,10 @@ Behind the scenes, Casey has access to five simulated tools: knowledge base sear
28
28
29
29
> **Note:** All tools return simulated data for demonstration purposes. In a production app, these would connect to your actual IT systems.
30
30
31
+
### Slack MCP Server
32
+
33
+
Casey also works with the [Slack MCP Server](https://docs.slack.dev/agents-ai/model-context-protocol), giving it the ability to search messages and files, read channel history and threads, send messages, schedule messages, and create or update Slack canvases. When deployed with OAuth (HTTP mode), Casey automatically connects to the Slack MCP Server using the user's token, unlocking these capabilities on top of the built-in IT tools.
34
+
31
35
## Local Development
32
36
33
37
This repo uses a vendored (pre-release) build of `slack-bolt` from the [bolt-python](https://github.com/slackapi/bolt-python)`main` branch. The `.whl` file lives in `vendor/` and is referenced by each app's `requirements.txt`.
Copy file name to clipboardExpand all lines: claude-agent-sdk/README.md
+123Lines changed: 123 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ Casey uses five simulated tools to assist users:
22
22
23
23
> **Note:** All tools return simulated data for demonstration purposes. In a production app, these would connect to your actual IT systems.
24
24
25
+
### Slack MCP Server
26
+
27
+
Casey also works with the [Slack MCP Server](https://docs.slack.dev/agents-ai/model-context-protocol), giving it the ability to search messages and files, read channel history and threads, send messages, schedule messages, and create or update Slack canvases. When deployed with OAuth (HTTP mode), Casey automatically connects to the Slack MCP Server using the user's token, unlocking these capabilities on top of the built-in IT tools.
28
+
25
29
## Setup
26
30
27
31
Before getting started, make sure you have a development workspace where you have permissions to install apps.
@@ -140,6 +144,101 @@ python3 app.py
140
144
141
145
</details>
142
146
147
+
<details><summary><strong>Using OAuth HTTP Server (with ngrok)</strong></summary>
148
+
149
+
#### OAuth HTTP Server
150
+
151
+
This mode uses an HTTP server instead of Socket Mode, which is required for OAuth-based distribution.
152
+
153
+
1. Install [ngrok](https://ngrok.com/download) and start a tunnel:
154
+
155
+
```sh
156
+
ngrok http 3000
157
+
```
158
+
159
+
2. Copy the `https://*.ngrok-free.app` URL from the ngrok output.
8. Click the install URL printed in the terminal to install the app to your workspace via OAuth.
199
+
200
+
</details>
201
+
202
+
<details><summary><strong>Using the Terminal</strong></summary>
203
+
204
+
#### Terminal
205
+
206
+
3. Create your Slack app at [api.slack.com/apps/new](https://api.slack.com/apps/new) using [`manifest.json`](./manifest.json). Before pasting the manifest, set `socket_mode_enabled` to `false` and replace `ngrok-free.app` with your ngrok domain.
207
+
208
+
4. Install the app to your workspace and copy the following values into your `.env`:
209
+
-**Signing Secret** — from _Basic Information_
210
+
-**Bot User OAuth Token** — from _OAuth & Permissions_
211
+
-**Client ID** and **Client Secret** — from _Basic Information_
Replace `your-subdomain` in `SLACK_REDIRECT_URI` with your ngrok subdomain.
222
+
223
+
5. Enable MCP for your app:
224
+
- Open your app at [api.slack.com/apps](https://api.slack.com/apps)
225
+
- Navigate to **Agents & AI Apps** in the left-side navigation
226
+
- Toggle **Model Context Protocol** on
227
+
228
+
6. Start the app:
229
+
230
+
```sh
231
+
python3 app_oauth.py
232
+
```
233
+
234
+
7. Click the install URL printed in the terminal to install the app to your workspace via OAuth.
235
+
236
+
</details>
237
+
238
+
> **Note:** Each time ngrok restarts, it generates a new URL. You'll need to update the ngrok domain in `manifest.json`, `SLACK_REDIRECT_URI` in your `.env`, and re-install the app.
239
+
240
+
</details>
241
+
143
242
### Using the App
144
243
145
244
Once Casey is running, there are three ways to interact:
@@ -172,6 +271,14 @@ ruff format
172
271
173
272
`app.py` is the entry point for the application and is the file you'll run to start the server. This project uses `AsyncApp` from Bolt for Python, with all handlers running asynchronously.
174
273
274
+
### `app_oauth.py`
275
+
276
+
`app_oauth.py` is an alternative entry point that runs the app in HTTP mode instead of Socket Mode. This is intended for deployments that use OAuth for app distribution. See the HTTP Mode section under Development for setup instructions.
277
+
278
+
### `manifest_oauth.json`
279
+
280
+
`manifest_oauth.json` is the app manifest configured for HTTP mode (Socket Mode disabled, with request URLs for event subscriptions and interactivity). Use this when setting up the app for HTTP mode instead of `manifest.json`.
281
+
175
282
### `/listeners`
176
283
177
284
Every incoming request is routed to a "listener". This directory groups each listener based on the Slack Platform feature used.
@@ -205,3 +312,19 @@ The `tools` directory contains five IT helpdesk tools defined using the `@tool`
205
312
### `/thread_context`
206
313
207
314
The `store.py` file implements a thread-safe in-memory session ID store, keyed by channel and thread. The Claude Agent SDK manages conversation history server-side via sessions, so only session IDs need to be tracked locally for resuming conversations.
315
+
316
+
## Troubleshooting
317
+
318
+
### MCP Server connection error: `HTTP error 400 (Bad Request)`
319
+
320
+
If you see an error like:
321
+
322
+
```
323
+
Failed to connect to MCP server 'streamable_http: https://mcp.slack.com/mcp': HTTP error 400 (Bad Request)
324
+
```
325
+
326
+
This means the Slack MCP feature has not been enabled for your app. There is no manifest property for this yet, so it must be toggled on manually:
327
+
328
+
1. Run `slack app settings` to open your app's settings page (or visit [api.slack.com/apps](https://api.slack.com/apps) and select your app)
329
+
2. Navigate to **Agents & AI Apps** in the left-side navigation
0 commit comments