Slack Configuration Guide
This document provides instructions for setting up your Slack app for use with the slack-mcp-client
application.
Slack App Setup Requirements
Token Types
The application requires two types of tokens:
Bot Token (
SLACK_BOT_TOKEN
): Starts withxoxb-
App-Level Token (
SLACK_APP_TOKEN
): Starts withxapp-
Required Bot Token Scopes
Add these OAuth scopes to your Bot Token in the "OAuth & Permissions" section:
Essential Scopes:
app_mentions:read
- Allows the bot to receive mention eventschat:write
- Allows the bot to post messagesim:history
- Allows the bot to read direct messagesim:read
- Allows the bot to receive DM events
Additional Scopes (for full functionality):
channels:history
- Allows reading public channel history (needed for message management)groups:history
- Allows reading private channel historympim:history
- Allows reading multi-person IM history
App-Level Token Configuration
Go to the "Socket Mode" section in your Slack app settings
Enable Socket Mode
Create an App-Level Token with the
connections:write
scopeUse this token for the
SLACK_APP_TOKEN
environment variable
Event Subscriptions
In the "Event Subscriptions" section:
Turn ON Event Subscriptions
Under "Subscribe to bot events", add these event subscriptions:
message.im
- For direct messages to your appapp_mention
- For mentions of your app in channels
App Home Configuration
In the "App Home" section:
Enable the Messages Tab
Turn ON "Allow users to send Slash commands and messages from the messages tab"
Troubleshooting Common Issues
"Sending messages to this app has been turned off"
If you see this error:
Check the App Home settings as described above
Verify Event Subscriptions are properly configured
Ensure the app is properly installed to your workspace with the required scopes
Check if a workspace admin has restricted DMs with apps
Try reinstalling the app to reset permissions
Message Delivery Issues
If the bot isn't receiving or responding to messages:
Confirm Socket Mode is enabled
Verify both tokens are valid and properly set in your environment
Check that your application is running and connected to Slack
Look for any errors in your application logs
Ensure your network allows connections to Slack's API servers
Environment Variables
Configure these environment variables in your .env
file:
Installation Process
Create a new Slack app at https://api.slack.com/apps
Configure all the settings described above
Install the app to your workspace
Copy the Bot Token and App-Level Token to your environment variables
Start the application
Runtime Verification
When the application starts successfully, it should:
Log "Connected to Slack!" in your application logs
The bot should appear online in your Slack workspace
You should be able to send direct messages to the bot and mention it in channels
Last updated
Was this helpful?