.agents/docs/SLACK_MCP_SETUP.md
This guide explains how to configure the Slack MCP server for use with Cursor IDE, specifically for the send-code-review-slack command.
This setup uses the custom Slack MCP server (ghcr.io/korotovsky/slack-mcp-server) which supports User OAuth Tokens (SLACK_MCP_XOXP_TOKEN). Messages will be posted as your authenticated user account, not as a bot.
Workspace-Level Setup (One-Time, Done by Admin):
User-Level Setup (Per Developer):
Note: This is a one-time workspace setup step, typically done by a workspace admin. Once the app is created and configured, all users in the workspace can use it.
Note: This is a one-time workspace setup step, typically done by a workspace admin. Once the scopes are configured, all users in the workspace will have access to these scopes when they install the app.
CRITICAL: You must add scopes to "User Token Scopes" (NOT "Bot Token Scopes") for the User OAuth Token to appear.
chat:write - Send messages as your authenticated user accountchannels:read - View basic information about public channelsusers:read - Read user information (required by the MCP server for caching)channels:history - View messages in public channels (required by the MCP server for channel caching)Note: The users:read and channels:history scopes are required by the ghcr.io/korotovsky/slack-mcp-server to properly cache and access channel information. Without these, you may see "missing_scope" errors in the logs, though basic message posting may still work.
Note: This is a per-user step. Each developer needs to install the app to their workspace to authorize it and get their own User OAuth Token.
After installing/reinstalling the app, you need to find your User OAuth Token:
xoxp- (not xoxb-).env.local in your project root and add your User OAuth Token:SLACK_MCP_XOXP_TOKEN=xoxp-your-user-oauth-token-here
Important Configuration Options:
mcp-server --transport stdio: Required for the server to communicate with Cursor via the MCP protocol. Without these, the server will start an SSE server instead, which won't work with Cursor's MCP integration.
SLACK_MCP_ADD_MESSAGE_TOOL: Required to enable the conversations_add_message tool (disabled by default for safety).
true or 1: Enable for all channels and DMsXXXXXXXX,YYYYYYYY)!XXXXXXXX: Enable for all channels except the specified onetrue to enable posting to #code-reviewenvFile: Points to ${workspaceFolder}/.env.local where your SLACK_MCP_XOXP_TOKEN is stored securely.Important:
xoxp-your-user-oauth-token-here in .env.local with your User OAuth Token from Step 4 (starts with xoxp-, NOT xoxb-).env.local via the envFile configuration, keeping it out of mcp.jsonNote: This configuration uses the custom Slack MCP server that supports User OAuth Tokens. Messages will be posted as your authenticated user account, not as a bot.
Requirements:
ghcr.io/korotovsky/slack-mcp-server:latest will be pulled automatically on first use.env.local should be added to .gitignore to prevent committing your tokencursor send-code-review-slack.env.local to .gitignore to prevent committing your tokenmcp.json file references the token via environment variable, but it may contain secrets, check it before committingSLACK_MCP_XOXP_TOKEN is stored in .env.local (which should be in .gitignore), not directly in mcp.jsonmcp.json is in the correct location (.cursor/mcp.json or ~/.cursor/mcp.json)docker --version and docker psIf you see errors like "Usage: docker [OPTIONS] COMMAND" in the MCP logs:
Verify Docker is running:
docker ps
If this fails, start Docker Desktop or Docker daemon
Test the Docker command manually:
docker run -i --rm -e SLACK_MCP_XOXP_TOKEN=xoxp-your-token -e LOG_LEVEL=error ghcr.io/korotovsky/slack-mcp-server:latest
This should start the MCP server. If it fails, check the error message.
Pull the Docker image:
docker pull ghcr.io/korotovsky/slack-mcp-server:latest
Check mcp.json structure: Ensure the args array is properly formatted with each argument as a separate string element
xoxp-, NOT xoxb-)
xoxb- in the logs, you're using a bot token instead of a user tokenchat:write (required for posting messages)channels:read (required for channel access)users:read (required by MCP server for caching)channels:history (recommended for full functionality)SLACK_MCP_XOXP_TOKEN in your Docker args (not SLACK_BOT_TOKEN)xoxp-...If you see "missing_scope" errors in the MCP logs:
users:read, channels:historymcp.json if a new token was generatedNote: Some "missing_scope" errors may be warnings that don't prevent basic functionality (like posting messages), but adding all recommended scopes ensures full MCP server functionality.
chat:write scope in User Token Scopes#code-review channel