# Setup Guide Turn the Slack browser session you already have into 22 tools for any stdio MCP client. ## Fast path **Node 22 or 24 recommended. Node 20+ is supported and CI-tested.** On macOS, sign into Slack in Chrome once, then run: ```bash npx -y @jtalk22/slack-mcp --setup ``` The wizard: 1. asks where credentials should live; 2. extracts the current Chrome Slack session locally; 3. validates the Slack identity and workspace; 4. persists the selected storage mode; 5. prints the stdio command to register, as a JSON object and as a `claude mcp add` one-liner. Chrome does not need to stay open after the session exists on disk. No DevTools or clipboard step is required for the normal macOS path. Prefer a persistent global command: ```bash npm install -g @jtalk22/slack-mcp slack-mcp --setup ``` ## Your own Slack app The other way to connect, beside the browser session. You create a private Slack app in your own workspace, install it, and give this server the user token Slack shows (`xoxp-`). That token does not expire, needs no Chrome and no cookie, works on any operating system, and can do only what its scopes allow. Slack enforces the scopes, not this server. ```bash npx -y @jtalk22/slack-mcp --setup app # read-only npx -y @jtalk22/slack-mcp --setup app --write # also the four write tools ``` The command prints one link that opens Slack's "create an app" page with the app already described, then these clicks: 1. Open the link, pick your workspace, click **Next**, then **Create and Install**. 2. Slack opens a window that asks for permission. Click **Allow**. 3. Click **Go to App Settings**, open **OAuth & Permissions** and copy the **User OAuth Token** (Slack's newer screens call it the Workspace token). It starts with `xoxp-`. If Slack shows **Create** in place of **Create and Install**, click it, then **Install to Workspace**, then **Allow**. If the link does not fill in the form, it also prints the same app as a manifest to paste under **Create New App**, then **From a manifest**. Paste the token when asked. Nothing is shown as you type. The wizard checks it with Slack, prints the scopes Slack granted and which tools lack one, and stores it the way `--setup` stores a session (`auto`, `keychain-only` or `file`, see [Storage modes](#storage-modes)). Then it prints the stdio command to register, as it does for a session. To keep the token out of storage, set it in your client's environment instead: ```json { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"], "env": { "SLACK_MCP_XOXP_TOKEN": "xoxp-..." } } ``` `SLACK_TOKEN` set to an `xoxp-` token with no cookie works the same way. An app token is read before the `SLACK_MCP_XOXC_TOKEN` and `SLACK_MCP_XOXD_TOKEN` pair, because it is the one that does not expire. A bot token (`xoxb-`) is not read. What to know before you choose it: - **Some workspaces need an admin to approve a new app.** If **Allow** is not offered, ask one. On a free workspace the app takes one of the 10 app slots. - **The read-only app cannot write.** It has no write scope, so `slack_send_message`, the two reaction tools and `slack_conversations_mark` fail at Slack with `missing_scope`. `--write` adds `chat:write`, `reactions:write` and the four `:write` conversation scopes. - **Unread counts cost more.** Slack gives an app token no unread numbers, so `slack_conversations_unreads` and a catch-up with no named channels count them from `conversations.info` and `conversations.history`: one call for a DM, two for a channel, for at most 40 conversations by default. Pass `max_conversations` (up to 100) to check more. The answer says how many it checked and how many it did not. - **Unread thread replies and the mention badges in Slack's sidebar are not available.** Mentions are counted from message text. - **Nothing is refreshed from Chrome.** `slack_refresh_tokens` and `--refresh-tokens` answer "not applicable" for an app token and change nothing. To go back to a browser session, run `--setup` and answer yes when it offers to replace the stored token. Check it: ```bash npx -y @jtalk22/slack-mcp --status npx -y @jtalk22/slack-mcp --doctor --security ``` Both name the credential kind. In your client, `slack_health_check` and `slack_token_status` report the kind, that it does not expire, the scopes it holds and the tools those scopes leave out. To end access, remove the app in Slack. ## Verify the CLI ```bash npx -y @jtalk22/slack-mcp --version npx -y @jtalk22/slack-mcp --help npx -y @jtalk22/slack-mcp --doctor ``` `--doctor` exits with one classified result: - `0`: ready; - `1`: credentials missing; - `2`: credentials invalid or expired; - `3`: network or runtime failure. `--status` is read-only and does not trigger Chrome extraction. `--refresh-tokens` runs the Chrome extraction on its own, without the wizard's prompts, and prints the reason code if it fails: ```bash npx -y @jtalk22/slack-mcp --refresh-tokens ``` These flags are the whole supported surface for an `npx` install. The `npm run tokens:*` scripts exist only in a git checkout. ## Pick your client Every local client starts the same stdio command: ```json { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } ``` ### Claude Code ```bash claude mcp add slack -- npx -y @jtalk22/slack-mcp ``` Or install it as a plugin, which adds the same server and updates with each release: ```text /plugin install slack-mcp --marketplace jtalk22/slack-mcp-server ``` On Claude Code before 2.1.275, run `/plugin marketplace add jtalk22/slack-mcp-server`, then `/plugin install slack-mcp@jtalk22`. Use one of the two, not both, or the server is registered twice. Or add to `~/.claude.json`: ```json { "mcpServers": { "slack": { "type": "stdio", "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### Claude Desktop Configuration file: - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` - Windows: `%APPDATA%\Claude\claude_desktop_config.json` ```json { "mcpServers": { "slack": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### Cursor [Install in Cursor](https://cursor.com/en/install-mcp?name=slack&config=eyJjb21tYW5kIjoibnB4IC15IEBqdGFsazIyL3NsYWNrLW1jcCJ9) opens Cursor with the server filled in. Or add to `.cursor/mcp.json`: ```json { "mcpServers": { "slack": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### GitHub Copilot in VS Code [Install in VS Code](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522slack%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540jtalk22%252Fslack-mcp%2522%255D%257D) or [in VS Code Insiders](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522slack%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540jtalk22%252Fslack-mcp%2522%255D%257D) opens the editor with the server filled in. Or add to `.vscode/mcp.json`: ```json { "servers": { "slack": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### Windsurf Add to `~/.codeium/windsurf/mcp_config.json`: ```json { "mcpServers": { "slack": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### Gemini CLI Add to `~/.gemini/settings.json`: ```json { "mcpServers": { "slack": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"] } } } ``` ### Codex CLI ```bash codex mcp add slack -- npx -y @jtalk22/slack-mcp ``` Or add to `~/.codex/config.toml`: ```toml [mcp_servers.slack] command = "npx" args = ["-y", "@jtalk22/slack-mcp"] ``` ### Any other stdio MCP client Point the client's stdio MCP configuration at: ```text npx -y @jtalk22/slack-mcp ``` On Windows or Linux, pass `SLACK_TOKEN` and `SLACK_COOKIE` through the client's environment configuration because macOS Chrome/Keychain extraction is unavailable. ## Restart and prove the connection Fully restart the client after adding its MCP configuration. MCP clients commonly snapshot tool lists at startup. Then ask the agent to run: ```text slack_health_check ``` A returned workspace and username means the server is live. Useful follow-ups: ```text slack_token_status slack_list_conversations slack_conversations_unreads ``` ## Storage modes The macOS setup wizard remembers the selected backend in `~/.slack-mcp-meta.json`. `SLACK_MCP_TOKEN_STORAGE` can override it per client or process. ### `auto` — default - owner-only token file; - macOS Keychain backup; - automatic local refresh. ### `keychain-only` - credentials live exclusively in the macOS Keychain; - no plaintext credential file is written; - file-to-Keychain migration is verified by read-back before the old file is removed; - a failed Keychain write never silently falls back to plaintext. Choose **Keychain only** during setup, or configure: ```json { "env": { "SLACK_MCP_TOKEN_STORAGE": "keychain-only" } } ``` If a background refresh cannot write to a locked Keychain, the fresh credentials stay available in process memory and persistence is retried later. Existing Keychain entries remain untouched. ### `file` - owner-only token file; - Keychain is never accessed; - useful for CI or machines where Keychain prompts are undesirable. An unknown storage mode fails at startup rather than guessing. ## Multiple workspaces Use a profile to isolate every credential and metadata surface: ```json { "mcpServers": { "slack-work": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"], "env": { "SLACK_MCP_PROFILE": "work" } }, "slack-personal": { "command": "npx", "args": ["-y", "@jtalk22/slack-mcp"], "env": { "SLACK_MCP_PROFILE": "personal" } } } } ``` Set up each profile once: ```bash npx -y @jtalk22/slack-mcp --setup --profile work npx -y @jtalk22/slack-mcp --setup --profile personal ``` When workspaces live in different Chrome profiles, add `SLACK_MCP_CHROME_PROFILE` to each entry. Profile names accept 1–32 letters, numbers, hyphens, and underscores; invalid names fail closed. ## Keep credentials fresh during long idle periods The MCP server checks credential health and can refresh while it is running. An optional macOS LaunchAgent can refresh twice daily even when the MCP client is closed. Create `~/Library/LaunchAgents/com.yourname.slack-token-refresh.plist`: ```xml Label com.yourname.slack-token-refresh ProgramArguments /bin/bash -c export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && exec npx -y @jtalk22/slack-mcp --refresh-tokens StartCalendarInterval Hour6Minute17 Hour18Minute17 RunAtLoad StandardErrorPath/tmp/slack-token-refresh.log ``` Load it: ```bash launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.yourname.slack-token-refresh.plist ``` The refresh process follows the storage mode selected during setup. Users of Homebrew Node can replace the `nvm` wrapper with explicit `/opt/homebrew/bin/node` and `/opt/homebrew/bin/npx` paths. ## Manual credentials Where automatic macOS extraction is not available, the simplest route is [your own Slack app](#your-own-slack-app): one token, no cookie. The browser-session route stays available: 1. retrieve your own `xoxc-` session token and `xoxd-` `d` cookie from the signed-in Slack browser session; 2. pass them as `SLACK_TOKEN` and `SLACK_COOKIE` through the MCP client's environment configuration; 3. never paste them into an issue, prompt, log, or checked-in file. `SLACK_MCP_XOXC_TOKEN` and `SLACK_MCP_XOXD_TOKEN` are read as the same pair, so a config written for korotovsky/slack-mcp-server works with only its command changed. See [MIGRATING.md](MIGRATING.md). See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for extraction failure codes and recovery actions. ## Docker and HTTP ```bash docker pull ghcr.io/jtalk22/slack-mcp-server:latest ``` The package also includes local HTTP and self-hosted deployment modes. See [DEPLOYMENT-MODES.md](DEPLOYMENT-MODES.md) for transport, authentication, and allowed-origin configuration. ## Hosted alternative The self-hosted server is complete. Hosted is the continuation path when the workflow must run without you: - saved profiles run on a schedule, daily or weekly; - a hosted model writes the brief and delivers it to Slack or a signed webhook; - profiles shared across a small team. It connects with the same kind of Slack session this package uses, so Slack can still rotate it there too. [Hosted free tier and live pricing →](https://mcp.revasserlabs.com/pricing?utm_source=setup_guide&utm_medium=github) ## Troubleshooting ### Missing credentials ```bash npx -y @jtalk22/slack-mcp --doctor npx -y @jtalk22/slack-mcp --setup ``` ### `invalid_auth` The Slack session rotated or was revoked. Re-run setup or call `slack_refresh_tokens` on macOS. With an app token the same Slack answer arrives as `app_token_rejected`, and `missing_scope` means the app lacks a scope the call needs. Both are explained in [TROUBLESHOOTING.md](TROUBLESHOOTING.md#app-token-errors). ### Client does not show the tools 1. validate the client's MCP configuration syntax; 2. confirm `npx -y @jtalk22/slack-mcp --version` works in a normal shell; 3. fully quit and restart the client; 4. run `slack_health_check` again. ### Chrome extraction fails Run `--doctor` and use the structured extraction code. The failure table and exact next actions live in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).