Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Slack CLI

FreeNot checked

CLI tool and server for full CRUD operations on Slack channels, messages, users, files, and reactions with JSON-first output optimized for LLM agents.

GitHubEmbed

About

CLI tool and server for full CRUD operations on Slack channels, messages, users, files, and reactions with JSON-first output optimized for LLM agents.

README

Test Release License: MIT

For AI, by AI. The Slack CLI and MCP server built from the ground up for LLM-powered agents and programmatic access.

Why slackcli?

Most Slack tools are built for humans. slackcli is built for agents. Every design decision — JSON-first output, structured error codes, automatic pagination, rate limit retries — is made so LLMs can interact with Slack reliably without hand-holding. Plug it in as an MCP server and your AI agent gets Slack superpowers. Use --read-only mode when you want guardrails.

Quick Start

  1. Create a Slack app and install it to your workspace with the scopes you need (e.g. channels:read, chat:write, search:read).
  2. Grab the Bot or User OAuth Token (xoxb-...) from OAuth & Permissions.
  3. Run:
brew install jackchuka/tap/slackcli
export SLACK_TOKEN=xoxb-your-token
slackcli channels list

Features

  • CLI commands for channels, messages, users, files, reactions, and search
  • MCP server (stdio transport) for AI agent integration
  • JSON-first output optimized for LLM consumption, with TTY-aware table fallback
  • Rate limit handling with automatic retry
  • Error classification with structured error codes
  • Pagination support across all list operations
  • Read-only mode to prevent accidental writes by AI agents

Installation

Homebrew:

brew install jackchuka/tap/slackcli

Or via Go:

go install github.com/jackchuka/slackcli/cmd/slackcli@latest

Or build from source:

make build

Authentication

Set your Slack token via environment variable or the CLI:

# Environment variable
export SLACK_TOKEN=xoxb-your-token

# Or use the auth command
slackcli auth login --token xoxb-your-token

# With a named workspace
slackcli auth login --token xoxb-your-token --name my-workspace

Token resolution order: --token flag > SLACK_TOKEN env > stored config.

Usage

CLI

# Channels
slackcli channels list
slackcli channels info C1234567890
slackcli channels create new-channel

# Messages
slackcli messages list --channel C1234567890
slackcli messages send --channel C1234567890 --text "Hello"
slackcli messages search --query "important"

# Users
slackcli users list
slackcli users info U1234567890

# Files
slackcli files list
slackcli files upload --channel C1234567890 --file ./report.pdf

# Reactions
slackcli reactions add --channel C1234567890 --timestamp 1234567890.123456 --name thumbsup
slackcli reactions list --user U1234567890

MCP Server

Start the MCP server for AI agent integration:

slackcli mcp serve

Configure in your MCP client (e.g., Claude Desktop):

{
  "mcpServers": {
    "slack": {
      "command": "slackcli",
      "args": ["mcp", "serve"],
      "env": {
        "SLACK_TOKEN": "xoxb-your-token"
      }
    }
  }
}

Available MCP tools:

Category Tools
Channels list_channels, get_channel_info, create_channel, archive_channel, invite_to_channel, kick_from_channel, set_channel_topic, set_channel_purpose
Messages list_messages, send_message, edit_message, delete_message, search_messages
Users list_users, get_user_info, get_user_presence
Reactions add_reaction, remove_reaction, list_reactions
Files list_files, get_file_info, delete_file
Auth auth_test

Read-Only Mode

Use --read-only to restrict to read-only operations. This prevents AI agents from accidentally sending messages, deleting files, or modifying channels.

CLI -- write commands are rejected before execution:

slackcli --read-only channels list           # works
slackcli --read-only messages send ...       # blocked
# Error: command "slackcli messages send" is a write operation and cannot be used in read-only mode

MCP server -- write tools are hidden entirely (AI agents never see them):

{
  "mcpServers": {
    "slack-readonly": {
      "command": "slackcli",
      "args": ["--read-only", "mcp", "serve"],
      "env": {
        "SLACK_TOKEN": "xoxb-your-token"
      }
    }
  }
}

Read-only tools (always available): auth_test, list_channels, get_channel_info, list_messages, list_users, get_user_info, get_user_presence, list_reactions, list_files, get_file_info, search_messages.

Write tools (hidden in read-only mode): create_channel, archive_channel, invite_to_channel, kick_from_channel, set_channel_topic, set_channel_purpose, send_message, edit_message, delete_message, add_reaction, remove_reaction, delete_file.

Output Formats

# Force JSON output
slackcli channels list -o json

# Force table output
slackcli channels list -o table

Default: table for TTY, JSON for piped output.

License

MIT

from github.com/jackchuka/slackcli

Installing Slack CLI

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/jackchuka/slackcli

FAQ

Is Slack CLI MCP free?

Yes, Slack CLI MCP is free — one-click install via Unyly at no cost.

Does Slack CLI need an API key?

No, Slack CLI runs without API keys or environment variables.

Is Slack CLI hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Slack CLI in Claude Desktop, Claude Code or Cursor?

Open Slack CLI on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Slack CLI with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All communication MCPs