Slack MCP Server Configuration Guide#
This guide provides detailed steps to configure and run the Slack MCP Server, including the required environment variables and instructions for obtaining the necessary Slack User OAuth token.
1. Required Environment Variables#
To configure and run the Slack MCP Server successfully, the following environment variables must be set.
1.1 SLACK_MCP_XOXP_TOKEN (User Token)#
Description:
A Slack User OAuth Token that allows the MCP server to interact with Slack on behalf of an authenticated user.
How to Obtain the Token#
2.
Click “Create New App” → “From scratch”.
3.
Enter an App Name (e.g., MCP Server) and select your Workspace.
4.
In the left sidebar, navigate to “OAuth & Permissions”.
5.
Scroll down to “Scopes” → “User Token Scopes”.
6.
Click “Add an OAuth Scope” and add the following scopes:
| Scope | Description |
|---|
channels:history | View messages and other content in public channels |
channels:read | View basic information about public channels |
chat:write | Send messages on a user’s behalf |
groups:history | View messages and other content in private channels |
groups:read | View basic information about private channels |
im:history | View messages and other content in direct messages |
im:read | View basic information about direct messages |
mpim:history | View messages and other content in group direct messages |
mpim:read | View basic information about group direct messages |
search:read | Search a workspace’s content |
team:read | View workspace name, email domain, and icon |
users:read | View people in a workspace |
7.
Scroll back up and click “Install to Workspace”.
8.
Authorize the app when prompted.
9.
Copy the User OAuth Token — it begins with xoxp-.
Example#
1.2 SLACK_MCP_PORT#
Description:
Defines the port on which the Slack MCP server will listen for incoming requests.Configuration Note: Set this value according to your hosting platform (e.g., Azure App Service).
The default is typically 8080.
Example#
1.3 SLACK_MCP_ADD_MESSAGE_TOOL#
Description:
Determines whether the MCP server can send messages to Slack channels or only operate in read-only mode.| Value | Behavior |
|---|
true | Enables message sending capabilities |
false | Disables message sending (read-only mode) |
Recommended Setting:
true (for full functionality)
Example#
2. Summary of Environment Variables#
| Variable | Description | Example Value |
|---|
SLACK_MCP_XOXP_TOKEN | Slack user token (User OAuth Token) | xoxp-xxxxxxxxxxxx-xxxxxxxxxxxx |
SLACK_MCP_PORT | Port number for the MCP server | 8080 |
SLACK_MCP_ADD_MESSAGE_TOOL | Enables or disables message sending | true |
3. Tips & Best Practices#
Keep your OAuth token secure. Never share or commit it to version control systems.
Reinstall the app to your workspace after updating any scopes or permissions.
Ensure your app is properly authorized in the target workspace before running the MCP server.
When deploying on platforms like Azure App Service, set all environment variables under your app’s Configuration Settings panel.
You can verify successful setup by checking if your Slack MCP Server logs indicate an authenticated connection to the workspace.
4. Troubleshooting#
Slack Connection Issues#
Verify your token starts with xoxp-
Check that the app is installed in the correct workspace
Confirm all required scopes are added in the Slack App settings
Azure Deployment Issues#
Check Application Insights logs for runtime errors
Verify all environment variables are set correctly
Confirm container registry credentials are configured properly
5. Support Resources#
For additional assistance: