Slack. Agent-Native.
Channels. Messages. Threads. DMs. Search. Users. Full Slack control from the terminal.
Slack’s own bots and webhooks are built for single-purpose apps — one trigger, one message, a console full of OAuth scopes to wade through.
So we built slack-agent-cli — 28 commands across 6 groups, every one also registered as an MCP tool, wired for autonomous workspace access from day one.

Why slack-agent-cli Exists
Slack is where your team already lives — but giving an agent access usually means standing up a custom Slack app, wiring webhooks, and hand-rolling Web API calls. This collapses all of that into one CLI that’s also an MCP server: install it, set two tokens, and your agent can read, post, search, and DM.
Without slack-agent-cli
- Stand up a custom Slack app and manage OAuth scopes by hand for every workflow
- Hand-rolled Web API calls — auth headers, pagination, rate limits, all bespoke
- Webhooks are one-way and single-purpose — no reading history or searching back
- User resolution is manual — copy IDs out of the UI to send a single DM
- No MCP wrapper — every agent integration starts from scratch
With slack-agent-cli
- 28 commands with flat, JSON-first output — pipe straight into an agent
- Channels, messages, threads, DMs, search, and users behind one interface
- Bidirectional — read history and search the workspace, not just post
- Look up users by email — resolve
jane@acme.comto a DM in one call - 29 MCP tools — plug directly into Claude Code, Claude Desktop, or Cursor
What Your Agent Can Do
28 commands across 6 groups — every Slack workspace operation your agent needs.
Channel Management
List, create, archive, join, and leave channels — public or private. Set topics, pull full message history with a limit. Your agent owns the entire channel lifecycle without anyone clicking through the Slack UI.
Messaging & Threads
Post to any channel, reply inside a thread, edit or delete messages by timestamp. Build a running conversation an agent can extend — not just a fire-and-forget bot that drops one message and disappears.
Direct Messages
Open a DM with any user, send a message, list active conversations, and fetch DM history. Agents run 1:1 outreach, onboarding flows, and personalized nudges — straight into someone's direct messages.
Workspace Search
Search every message and file across the workspace in one query — or both at once. Backed by a user token, agents find that one thread from three weeks ago, surface a shared file, or pull every mention of a deal.
User Directory & Presence
List workspace members, look up a user by email, pull full profiles, and check who's online right now. Resolve "message Jane" into a real user ID and DM channel without a single manual lookup.
Reactions & Engagement
Add or remove emoji reactions and read the full reaction set on any message. Agents acknowledge, triage, and tag messages the way a teammate would — 👀 on the inbound, ✅ when it's handled.
MCP Server Mode
29 MCP tools registered for direct AI agent connectivity. Run slack-agent-cli as an MCP stdio server and give Claude, Cursor, or any MCP-compatible agent full Slack access with one config entry — no custom bot, no webhook plumbing.
Dual-Token Auth
Bot token (xoxb-) for posting, channel ops, and DMs; user token (xoxp-) unlocks workspace search. Proper OAuth scope separation, JSON-first output on every command, and --quiet mode for clean exit-code automation.
Agent Workflows
Real use cases — what your agent can run autonomously today.
Channel Digest — Summarize and Post Back
“Read the last 50 messages in #sales, summarize what happened today, and post the digest back to the channel.”
Agent pulls channel history, generates a summary, and posts it as a new message. A daily standup digest with zero human in the loop — the kind of thing a single prompt now runs on a schedule.
slack channels list --prettyResolve the channel name to its ID
slack channels history C0123ABCDEF --limit 50 --prettyPull the last 50 messages as JSON
slack messages post C0123ABCDEF "📋 Daily digest: 3 deals advanced, 2 blockers raised, 1 demo booked."Post the agent-generated summary back to the channel
Onboarding — Welcome a New Hire via DM
“Jane just joined. Find her in Slack by email and send her a welcome DM with the onboarding checklist.”
Agent resolves the user by email, opens a direct message channel, and sends a personalized welcome. Email in, DM out — no manual user-ID hunting, no copy-paste between tabs.
slack users lookup jane@acme.comResolve the email to a Slack user ID
slack dms open U07ABCDEF12Open (or reuse) the DM channel for that user
slack dms send U07ABCDEF12 "👋 Welcome to the team, Jane! Here's your day-one checklist…"Send the welcome message straight to her DMs
Inbound Triage — Search, React, Reply in Thread
“Find every message mentioning "refund" today, mark them seen, and reply in-thread that support is on it.”
Agent searches the workspace, acknowledges each hit with a reaction, and replies inside the thread — keeping the conversation tidy instead of spamming the channel. Search runs on the user token; the rest on the bot token.
slack search messages "refund after:today" --prettyFind every matching message across the workspace
slack messages add-reaction C0123ABCDEF 1716900000.123456 eyesReact 👀 to acknowledge the inbound
slack messages reply C0123ABCDEF 1716900000.123456 "On it — support is reviewing your refund now."Reply inside the existing thread
Announcement — Spin Up a Channel and Broadcast
“Create a #launch-q3 channel, set the topic, and post the kickoff announcement.”
Agent creates the channel, sets its topic, and posts the first message — a full launch space stood up from one prompt. Three API calls, zero clicks, and the channel is ready before the meeting starts.
slack channels create launch-q3Create the new channel and capture its ID
slack channels set-topic C0NEWCHAN01 "Q3 product launch — owners, dates, and assets"Set the channel topic for context
slack messages post C0NEWCHAN01 "🚀 Q3 launch is live. Kickoff doc in the canvas, owners tagged below."Post the kickoff announcement
GTM Alert Loop — Pipe CRM Events into Slack
“When a new lead books a call, post it to #revenue and DM the owning rep.”
Wired into your OpenClaw GTM agent, slack-agent-cli becomes the notification layer for the whole stack. A booked call from Calendly fans out to a channel post and a direct ping to the rep — one connected loop across Clay, Instantly, and Slack.
slack messages post C0REVENUE01 "💸 New booked call: Jane Doe @ Acme — Enterprise, $75K. Owner: @brandon"Broadcast the booking to the revenue channel
slack users lookup brandon@topoffunnel.comResolve the owning rep to a user ID
slack dms send U07OWNER001 "You've got a discovery call with Jane Doe (Acme). Prep doc attached."DM the rep directly with the context
Quick Start
1Install
npm install -g slack-agent-cli
slack --version
# Or run without installing
npx slack-agent-cli channels list --pretty2Authenticate
Slack uses two tokens: a bot token (xoxb-) for posting, channels, and DMs, and a user token (xoxp-) that unlocks workspace search.
# Environment variables (recommended)
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_USER_TOKEN="xoxp-your-user-token" # only needed for search
slack workspace bot
# Or pass them per-command
slack channels list --bot-token xoxb-... --pretty3First commands
# Confirm the bot identity and workspace
slack workspace bot
slack workspace team --pretty
# List channels and read recent history
slack channels list --pretty
slack channels history C0123ABCDEF --limit 20 --pretty
# Post a message and DM a user by email
slack messages post C0123ABCDEF "Hello from the agent 👋"
slack users lookup jane@acme.comCommands Reference
28 commands across 6 groups. Default output is JSON; add --pretty for human-readable, or --quiet for exit-code-only automation.
channels8 commandschannels listList every channel the bot can access — public and privatechannels infoRetrieve full details for a single channel by IDchannels createCreate a new channel by namechannels archiveArchive a channel when it's donechannels joinAdd the bot to a channelchannels leaveRemove the bot from a channelchannels set-topicSet or update a channel's topicchannels historyFetch message history with --limit Nmessages7 commandsmessages postSend a message to a channelmessages replyReply inside a thread by parent timestampmessages updateEdit an existing message by timestampmessages deleteRemove a message by timestampmessages add-reactionAdd an emoji reaction to a messagemessages remove-reactionRemove an emoji reactionmessages get-reactionsRead the full reaction set on a messagedms4 commandsdms sendSend a direct message to a userdms openOpen (or reuse) a DM conversation with a userdms listList the bot's active DM conversationsdms historyFetch the history of a DM conversationsearch3 commandssearch messagesSearch message content across the workspace (user token)search filesSearch uploaded files across the workspacesearch allCombined message + file search in one queryusers4 commandsusers listList all workspace membersusers lookupFind a user by email addressusers infoGet a user's full profileusers presenceCheck whether a user is onlineworkspace2 commandsworkspace teamDisplay workspace / team metadataworkspace botGet the authenticated bot identitySearch commands require a user token (xoxp-) with the search:read scope. Every command is also registered as an MCP tool — 29 in total.
MCP Server Setup
Add slack-agent-cli as an MCP server to give Claude or Cursor full Slack access — all 29 tools available natively, no custom Slack app required.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["slack-agent-cli", "mcp"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token",
"SLACK_USER_TOKEN": "xoxp-your-user-token"
}
}
}
}Claude Code (CLI)
claude mcp add slack -- npx slack-agent-cli mcpMake sure SLACK_BOT_TOKEN (and SLACK_USER_TOKEN for search) are set in your environment before running Claude Code.
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json in your project:
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["slack-agent-cli", "mcp"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-bot-token",
"SLACK_USER_TOKEN": "xoxp-your-user-token"
}
}
}
}Want us to build this into your stack?
We set up slack-agent-cli as part of your OpenClaw agent infrastructure — wired to your pipeline alerts, channel digests, and team workflows. Slack becomes the live notification layer your agent drives end to end.