|
| 1 | +--- |
| 2 | +title: "MCP Use Case: Connect Slack" |
| 3 | +description: Learn how to connect the open-source Slack MCP Server to Claude Desktop. |
| 4 | +--- |
| 5 | + |
| 6 | +# How to use Slack from your MCP Client |
| 7 | + |
| 8 | +This guide demonstrates how to connect your Slack workspace to your MCP Client. |
| 9 | + |
| 10 | +As Slack doesn't provide an official MCP server, and Anthropic's reference implementation was deprecated due to [security vulnerabilities](https://embracethered.com/blog/posts/2025/security-advisory-anthropic-slack-mcp-server-data-leakage/), this guide uses the open-source [`slack-mcp-server`](https://github.com/korotovsky/slack-mcp-server) instead. |
| 11 | + |
| 12 | +After following this guide you'll be able to read and summarize conversations, search message history, and analyze team communications without leaving Claude Desktop or whatever client you prefer. Here's an example where Claude finds all messages with reactions in a specific channel: |
| 13 | + |
| 14 | +<video |
| 15 | + controls={false} |
| 16 | + loop={true} |
| 17 | + autoPlay={true} |
| 18 | + muted={true} |
| 19 | + width="100%" |
| 20 | + className="mt-10" |
| 21 | +> |
| 22 | + <source src="/assets/mcp/using-mcp/slack-claude-quickstart/demo.mp4" type="video/mp4" /> |
| 23 | +</video> |
| 24 | + |
| 25 | +## Prerequisites |
| 26 | + |
| 27 | +To follow along, you'll need |
| 28 | + |
| 29 | +* A user account on a Slack workspace |
| 30 | +* An MCP Client like Claude Desktop |
| 31 | +* Ideally some familiarity with editing JSON files and using your browser's developer tools |
| 32 | + |
| 33 | +## Getting your Slack `xoxc` and `xoxd` auth tokens |
| 34 | + |
| 35 | +Instead of connecting to the Slack API, which would require admin access, we'll use the browser session tokens to authorize the Slack MCP Server to connect to your Slack workspace. Your MCP client will then have access to anything that you would in Slack. To get these, you'll need to log into your Slack workspace using a browser like Google Chrome. |
| 36 | + |
| 37 | +To get the `xoxc` token: |
| 38 | + |
| 39 | +1. Open the Slack workspace in your browser. |
| 40 | +2. Open the developer console by pressing `Ctrl+Shift+I` (`Cmd+Option+I` on macOS) or `F12`. |
| 41 | +3. Switch to the **Console** tab. |
| 42 | +4. Type "allow pasting" into the console and press `Enter`. |
| 43 | +5. Paste the following snippet into the console and press `Enter`: |
| 44 | + |
| 45 | + ```text |
| 46 | + JSON.parse(localStorage.localConfig_v2).teams[document.location.pathname.match(/^\/client\/([A-Z0-9]+)/)[1]].token |
| 47 | + ``` |
| 48 | + |
| 49 | +The token will be returned in the console. It starts with `xoxc-`. Save this somewhere. |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +To get the `xoxd` token: |
| 54 | + |
| 55 | +1. Switch to the **Application** tab (**Storage** in Firefox and Safari). |
| 56 | +2. In the sidebar, under **Storage**, click **Cookies**. |
| 57 | +3. Find the cookie named `d` in the table. |
| 58 | +4. Copy the cookie's value to the clipboard. |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +The token value starts with `xoxd-`. Save this somewhere. |
| 63 | + |
| 64 | +## Cloning and modifying the project |
| 65 | + |
| 66 | +The Slack MCP Server only [recently added support](https://github.com/korotovsky/slack-mcp-server/pull/91) for reactions, and that functionality is not yet included in their latest release, so we need to clone and build the project locally. |
| 67 | + |
| 68 | +Run the following commands |
| 69 | + |
| 70 | + |
| 71 | +```bash |
| 72 | +mkdir slack-mcp-setup |
| 73 | +cd slack-mcp-setup |
| 74 | +git clone https://github.com/korotovsky/slack-mcp-server.git |
| 75 | +cd slack-mcp-server |
| 76 | +go build -o slack-mcp-server ./cmd/slack-mcp-server |
| 77 | +``` |
| 78 | + |
| 79 | +The build will be located in the root of the cloned project at `slack-mcp-server/slack-mcp-server`. |
| 80 | + |
| 81 | +## Installing the MCP server in Claude |
| 82 | + |
| 83 | +Now update your Claude Desktop configuration to include the MCP server. |
| 84 | + |
| 85 | +Open Claude Desktop and go to **Settings** > **Developer** > **Edit Config**. |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +In the `claude_desktop_config.json` file that opens, add the Slack MCP Server configuration: |
| 90 | + |
| 91 | +```json |
| 92 | +{ |
| 93 | + "mcpServers": { |
| 94 | + "SlackMCPServer": { |
| 95 | + "command": "PATH_TO_MCP_SERVER/slack-mcp-server", |
| 96 | + "args": ["-transport", "stdio"], |
| 97 | + "env": { |
| 98 | + "SLACK_MCP_XOXC_TOKEN": "YOUR_XOXC_TOKEN", |
| 99 | + "SLACK_MCP_XOXD_TOKEN": "YOUR_XOXD_TOKEN", |
| 100 | + "SLACK_MCP_USERS_CACHE": "PATH_TO_MCP_SERVER/.users_cache.json", |
| 101 | + "SLACK_MCP_CHANNELS_CACHE": "PATH_TO_MCP_SERVER/.channels_cache.json" |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +Replace `PATH_TO_MCP_SERVER` with the absolute path to your cloned `slack-mcp-server` directory. Replace `YOUR_XOXC_TOKEN` and `YOUR_XOXD_TOKEN` with the Slack tokens you saved previously. |
| 109 | + |
| 110 | +Restart Claude Desktop to load the server. |
| 111 | + |
| 112 | +To test that the connection is working, ask Claude to list the current channels in your Slack workspace. |
| 113 | + |
| 114 | +## Testing reaction functionality |
| 115 | + |
| 116 | +In Claude Desktop, start a new chat. Click the **Search and tools** button to see the MCP server listed. Enable all tools if needed. |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | +Add reaction emojis to messages in your Slack workspace, then ask Claude to show you messages with reactions to test the server's reaction-reading functionality. |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +## Conclusion |
| 125 | + |
| 126 | +Claude Desktop can now access your Slack workspace and read message reactions through the customized MCP server. While the server can be installed directly using a [DXT file](https://github.com/korotovsky/slack-mcp-server/blob/master/docs/03-configuration-and-usage.md#Using-DXT), building from source lets you customize functionality for your workflows. |
0 commit comments