Content
# Slack MCP Server
Model Context Protocol (MCP) server for Slack Workspaces. This integration supports both Stdio and SSE transports, proxy settings and does not require any permissions or bots being created or approved by Workspace admins 😏.
### Feature Demo
...
## Setup Guide
### 1. Authentication Setup
Open up your Slack *in your browser* and login.
#### Lookup `SLACK_MCP_XOXC_TOKEN`
- Open your browser's *Developer Console*.
- In Firefox, under `Tools -> Browser Tools -> Web Developer tools` in the menu bar
- In Chrome, click the 'three dots' button to the right of the URL Bar, then select
'More Tools -> Developer Tools'
- Switch to the console tab.
- Type "allow pasting" and press ENTER.
- Paste the following snippet and press ENTER to execute:
`JSON.parse(localStorage.localConfig_v2).teams[document.location.pathname.match(/^\/client\/([A-Z0-9]+)/)[1]].token`
Token value is printed right after the executed command (it starts with
"``xoxc-``"), save it somewhere for now.
#### Lookup `SLACK_MCP_XOXD_TOKEN`
- Switch to Application_ tab and select **Cookies** in the left
navigation pane.
- Find the cookie with the name "``d``". That's right, just the
letter "d".
- Double-click the Value of this cookie.
- Press Ctrl+C or Cmd+C to copy it's value to clipboard.
- Save it for later.
### 2. Installation
Choose one of these installation methods:
#### 2.1. Docker
```bash
git clone https://github.com/korotovsky/slack-mcp-server.git
cd slack-mcp-server
docker build -t slack-mcp-server .
```
#### 2.2. Docker Compose
```bash
git clone https://github.com/korotovsky/slack-mcp-server.git
cd slack-mcp-server
cp .env.example .env
nano .env # Edit .env file with your tokens from step 1 of the setup guide
docker-compose build
```
### 3. Configuration and Usage
You can configure the MCP server using command line arguments and environment variables.
Add the following to your `claude_desktop_config.json`:
#### Option 1 with `stdio` transport:
```json
{
"mcpServers": {
"slack": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SLACK_MCP_XOXC_TOKEN",
"-e",
"SLACK_MCP_XOXD_TOKEN",
"slack-mcp-server",
"--transport",
"stdio"
],
"env": {
"SLACK_MCP_XOXC_TOKEN": "xoxc-...",
"SLACK_MCP_XOXD_TOKEN": "xoxd-..."
}
}
}
}
```
#### Option 2 with `sse` transport:
Complete steps from 2.2 and run `docker compose up -d` to launch MCP server or with your preferred method and then configure it:
```json
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://x.y.z.q:3001"],
"env": {
"SLACK_SSE_API_KEY": "my-$$e-$ecret"
}
}
}
}
```
#### Console Arguments
| Argument | Required ? | Description |
|-----------------------|------------|--------------------------------------------------------------------------|
| `--transport` or `-t` | Yes | Select transport for the MCP Server, possible values are: `stdio`, `sse` |
#### Environment Variables
| Variable | Required ? | Default | Description |
|--------------------------------|------------|-------------|-------------------------------------------------------------------------------|
| `SLACK_MCP_XOXC_TOKEN` | Yes | `nil` | Authentication data token field `token` from POST data field-set (`xoxc-...`) |
| `SLACK_MCP_XOXD_TOKEN` | Yes | `nil` | Authentication data token from cookie `d` (`xoxd-...`) |
| `SLACK_MCP_SERVER_PORT` | No | `3001` | Port for the MCP server to listen on |
| `SLACK_MCP_SERVER_HOST` | No | `127.0.0.1` | Host for the MCP server to listen on |
| `SLACK_MCP_SSE_API_KEY` | No | `nil` | Authorization Bearer token when `transport` is `sse` |
| `SLACK_MCP_PROXY` | No | `nil` | Proxy URL for the MCP server to use |
| `SLACK_MCP_SERVER_CA` | No | `nil` | Path to the CA certificate of the trust store |
| `SLACK_MCP_SERVER_CA_INSECURE` | No | `false` | Trust all insecure requests (NOT RECOMMENDED) |
## Available Tools
| Tool | Description |
|-------------------------|-------------------------------|
| `conversations.history` | Get messages from the channel |
### Debugging Tools
```bash
# Run the inspector with stdio transport
npx @modelcontextprotocol/inspector go run mcp/mcp-server.go --transport stdio
# View logs
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
```
## Security
- Never share API tokens
- Keep .env files secure and private
## License
Licensed under MIT - see [LICENSE](LICENSE) file. This is not an official Slack product.