# Slack Setup via MCP ## 1. Create a Slack App Go to https://api.slack.com/apps and click "Create New App". Choose "From scratch". Give it a name and select your workspace. ## 2. Add Bot Token Scopes Navigate to "OAuth & Permissions" in the sidebar. Under "Bot Token Scopes", add: - `chat:write` - post messages - `channels:read` - list channels - `channels:history` - read messages (if needed) ## 3. Install to workspace Click "Install to Workspace" at the top of the OAuth & Permissions page. Authorize. Copy the "Bot User OAuth Token" (starts with `xoxb-`). ## 4. Add to .mcp.json ```json { "mcpServers": { "slack": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "xoxb-your-token-here", "SLACK_TEAM_ID": "T0123456789" } } } } ``` Find your Team ID in the Slack URL when logged into the web app: `https://app.slack.com/client/T0123456789/...` Store the token in an environment variable rather than hardcoding it. ## 5. Test Start Claude Code in your project directory. Try: ``` Send a message to #general saying "Claude Code Slack integration is working" ``` Claude will use the `slack_post_message` tool from the MCP server. ## Troubleshooting - "not_in_channel": Invite the bot to the channel first (`/invite @your-bot-name`) - Token not found: verify the env var is exported before launching Claude Code