A Slack CLI and MCP server that allows you to send Slack messages. Inspired by the GitHub CLI, it aims to provide a simple and efficient way for humans and AI to interact with Slack from the command line or via MCP.
Like jq, it is packaged in a tiny (10Mb) binary, without the need to install a runtime such as Node.js or Python, and securely stores your secret in the key-ring, rather than in plain-text.
It's aimed at coding agents with a very simple interface, and is not intended to be a full-featured Slack client.
Download the binary for your platform from the release page.
VERSION=v0.0.13
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
sudo curl -fsL -o /usr/local/bin/slack https://github.com/kitproj/slack-cli/releases/download/${VERSION}/slack_${VERSION}_${PLATFORM}_${ARCH}
sudo chmod +x /usr/local/bin/slack- Visit https://api.slack.com/apps
- Create a new app or select an existing one
- Navigate to "OAuth & Permissions"
- Add the following Bot Token Scopes:
chat:write- Send messagesusers:read.email- Look up users by email
- Install the app to your workspace
- Copy the "Bot User OAuth Token" (starts with
xoxb-)
For security, the Slack token is stored in your system keyring (login keyring). Configure it once:
echo "xoxb-your-slack-token" | slack configureOr configure it interactively (token input will be hidden):
slack configureAlternatively, you can use the SLACK_TOKEN environment variable:
export SLACK_TOKEN="xoxb-your-slack-token"Note: Using the keyring is more secure in multi-user systems as environment variables are visible in the process list.
Usage:
slack configure - configure Slack token (reads from stdin)
slack send-message <channel|email> <message> [thread-ts] - send a message (optionally reply to a thread)
slack mcp-server - start MCP server (Model Context Protocol)Examples:
# Send a message (prints thread-ts for starting a thread)
slack send-message alex_collins@intuit.com "I love this tool! It makes Slack integration so easy."
# Output:
# Message sent to alex_collins@intuit.com (U12345678)
# thread-ts: 1234567890.123456
# Reply to a message in a thread (use the thread-ts from the previous message)
slack send-message alex_collins@intuit.com "Thanks for the feedback!" "1234567890.123456"
# Output:
# Reply sent to alex_collins@intuit.com (U12345678) in thread 1234567890.123456Sending to a Channel by ID:
slack send-message C1234567890 "Hello team! 👋"Using Markdown Formatting:
slack send-message alex_collins@intuit.com "**Bold**, *italic*, ~~strikethrough~~, [link](https://example.com)"Messages automatically convert Markdown to Slack's Mrkdwn format. Supported features:
- Bold:
**text**or__text__→*text* - Italic:
*text*or_text_→_text_(single underscores already in Mrkdwn format) - Strikethrough:
~~text~~→~text~ - Inline code:
`code`(unchanged) - Links:
[text](url)→<url|text> - Code blocks:
```language\ncode\n```(language identifier removed) - Unordered lists:
* itemor- item→• item - Ordered lists:
1. item(unchanged)
To get a channel ID in Slack:
- Right-click on the channel name
- Select "Copy" → "Copy link"
- The channel ID is the part after the last slash (e.g.,
C1234567890)
The MCP (Model Context Protocol) server allows AI assistants and other tools to interact with Slack. This enables seamless integration with AI coding assistants and other automation tools.
Setup:
-
First, configure your Slack token (stored securely in the system keyring):
echo "xoxb-your-slack-token" | slack configure
-
Add the MCP server configuration to your MCP client:
{ "mcpServers": { "slack": { "command": "slack", "args": ["mcp-server"] } } }
The server exposes the send_message tool with the following parameters:
identifier- Slack channel ID (e.g., 'C1234567890') or user email address (e.g., 'user@example.com')message- The message to send (supports Markdown formatting)thread_ts- Optional: The thread timestamp of the parent message to reply to (e.g., '1234567890.123456'). When provided, the message will be sent as a threaded reply.
Example usage from an AI assistant:
"Slack alex_collins@intuit.com to say how much you like this tool." "Reply to that Slack message with a thumbs up emoji."