|
1 | | -# MCP Server: Slack Identity Auth |
| 1 | +# Slack Identity |
2 | 2 |
|
3 | | -Demonstrates Slack identity-based authentication for MCP servers. Exposes a `search_notes` tool that returns personal and team notes scoped to the requesting user. |
4 | | - |
5 | | -Slack sends signed requests with `user_id` and `team_id` in `_meta.slack`. Your server verifies the signature and uses the identity to scope results — no separate OAuth flow needed. |
6 | | - |
7 | | -## How it works |
8 | | - |
9 | | -1. Your app declares an MCP server with `"auth_type": "slack_identity_auth"` |
10 | | -2. Slackbot sends requests signed with your app's signing secret |
11 | | -3. The server verifies the signature, reads `user_id`/`team_id` from the request |
12 | | -4. Notes are looked up from `notes/TEAMID-USERID.md` (personal) and `notes/TEAMID.md` (shared) |
| 3 | +Run an MCP server that responds with Block Kit and authenticates with existing installations. |
13 | 4 |
|
14 | 5 | ## Setup |
15 | 6 |
|
16 | | -```bash |
17 | | -npm install |
18 | | -ngrok http 3000 |
19 | | -``` |
20 | | - |
21 | | -Update `manifest.json` with your ngrok URL, create the app at [api.slack.com/apps](https://api.slack.com/apps), then: |
22 | | - |
23 | | -```bash |
24 | | -cp .env.sample .env |
25 | | -# Fill in SLACK_SIGNING_SECRET, SLACK_CLIENT_ID, SLACK_CLIENT_SECRET |
26 | | -npm start |
27 | | -``` |
28 | | - |
29 | | -### Add your notes |
30 | | - |
31 | | -Create notes files using your real team and user IDs: |
32 | | - |
33 | | -```bash |
34 | | -cp notes/T0000000000-U0123456789.md notes/YOUR_TEAM_ID-YOUR_USER_ID.md |
35 | | -cp notes/T0000000000.md notes/YOUR_TEAM_ID.md |
36 | | -``` |
37 | | - |
38 | | -## Try it |
39 | | - |
40 | | -Ask Slackbot: _"What are my current projects?"_ |
41 | | - |
42 | | -## Manifest |
43 | | - |
44 | | -```json |
45 | | -"mcp_servers": { |
46 | | - "notes": { |
47 | | - "url": "https://YOUR_URL/mcp", |
48 | | - "auth_type": "slack_identity_auth" |
49 | | - } |
50 | | -} |
| 7 | +```sh |
| 8 | +$ ngrok http 3000 |
| 9 | +$ slack install --app local # Create a new app |
| 10 | +$ slack app settings |
| 11 | +$ slack env init # Update defaults |
| 12 | +$ slack manifest # Validate fields |
| 13 | +$ slack run |
| 14 | +$ open https://1234-56-78-90-0.ngrok-free.app/slack/install # Install the app |
51 | 15 | ``` |
52 | 16 |
|
53 | | -The `auth_type: "slack_identity_auth"` tells Slack to send signed requests with user context. |
| 17 | +Ask Slackbot: "Make me a profile card using the latest MCP tools" |
0 commit comments