Open Source·AI Agent Infrastructure

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.

View on GitHubInstall from npm
28
Commands
6
Command Groups
29
MCP Tools
OpenClaw
OpenClaw
CLI / MCP
Slack
28 commands · 6 command groups · 29 MCP tools · zero webhooks

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.com to 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.

01
slack channels list --pretty

Resolve the channel name to its ID

02
slack channels history C0123ABCDEF --limit 50 --pretty

Pull the last 50 messages as JSON

03
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.

01
slack users lookup jane@acme.com

Resolve the email to a Slack user ID

02
slack dms open U07ABCDEF12

Open (or reuse) the DM channel for that user

03
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.

01
slack search messages "refund after:today" --pretty

Find every matching message across the workspace

02
slack messages add-reaction C0123ABCDEF 1716900000.123456 eyes

React 👀 to acknowledge the inbound

03
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.

01
slack channels create launch-q3

Create the new channel and capture its ID

02
slack channels set-topic C0NEWCHAN01 "Q3 product launch — owners, dates, and assets"

Set the channel topic for context

03
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.

01
slack messages post C0REVENUE01 "💸 New booked call: Jane Doe @ Acme — Enterprise, $75K. Owner: @brandon"

Broadcast the booking to the revenue channel

02
slack users lookup brandon@topoffunnel.com

Resolve the owning rep to a user ID

03
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

terminal
npm install -g slack-agent-cli
slack --version

# Or run without installing
npx slack-agent-cli channels list --pretty

2Authenticate

Slack uses two tokens: a bot token (xoxb-) for posting, channels, and DMs, and a user token (xoxp-) that unlocks workspace search.

terminal
# 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-... --pretty

3First commands

terminal
# 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.com

Commands Reference

28 commands across 6 groups. Default output is JSON; add --pretty for human-readable, or --quiet for exit-code-only automation.

channels8 commands
channels listList every channel the bot can access — public and private
channels infoRetrieve full details for a single channel by ID
channels createCreate a new channel by name
channels archiveArchive a channel when it's done
channels joinAdd the bot to a channel
channels leaveRemove the bot from a channel
channels set-topicSet or update a channel's topic
channels historyFetch message history with --limit N
messages7 commands
messages postSend a message to a channel
messages replyReply inside a thread by parent timestamp
messages updateEdit an existing message by timestamp
messages deleteRemove a message by timestamp
messages add-reactionAdd an emoji reaction to a message
messages remove-reactionRemove an emoji reaction
messages get-reactionsRead the full reaction set on a message
dms4 commands
dms sendSend a direct message to a user
dms openOpen (or reuse) a DM conversation with a user
dms listList the bot's active DM conversations
dms historyFetch the history of a DM conversation
search3 commands
search messagesSearch message content across the workspace (user token)
search filesSearch uploaded files across the workspace
search allCombined message + file search in one query
users4 commands
users listList all workspace members
users lookupFind a user by email address
users infoGet a user's full profile
users presenceCheck whether a user is online
workspace2 commands
workspace teamDisplay workspace / team metadata
workspace botGet the authenticated bot identity

Search 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:

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)

terminal
claude mcp add slack -- npx slack-agent-cli mcp

Make 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:

.cursor/mcp.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"
      }
    }
  }
}
OpenClaw

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.

🔔 Alert routing — agent posts pipeline events and inbound replies to the right channels
🤖 Agent integration — slack-agent-cli wired into your OpenClaw GTM agent as MCP tools
🔄 Full-stack automation — n8n + slack-agent-cli + Clay + Instantly in one connected loop
Star on GitHub