Skip to content

Slack Team Bot with MCP Tools

This playbook builds a shared Slack bot that answers when mentioned in allow-listed channels, calls a custom team MCP tool plus Read/Grep, and can post proactively with SlackSendMessage.

A DevOps engineer running a shared team bot.

A Slack Socket Mode bot, mention-triggered in allowed channels, with a custom MCP tool plus Read/Grep and the SlackSendMessage tool for proactive posts.

The Slack section runs in Socket Mode (effective botToken and appToken values are required); Slack’s app_mention event handles real mentions, the adapter discovers its own bot user ID/username, and the bot only responds in allowedChannelIds. Put MONO_AGENT_SLACK_BOT_TOKEN and MONO_AGENT_SLACK_APP_TOKEN in .env; the source config omits credentials. The built-in @agent /model / @agent /effort thread controls and workspace-registered /<bot>-model / /<bot>-effort channel controls automatically expose runtime.model plus any configured fallbacks, with no bot-ID or Slack-specific model config. This agent opts into a specific tool allowlist instead of the allow-all default, so the built-ins it uses and SlackSendMessage are named explicitly; deployTool comes from the declared MCP server. concurrency bounds in-flight work app-wide.

{
"runtime": {
"model": "anthropic:claude-sonnet-4-6"
},
"slack": {
"enabled": true,
"allowedChannelIds": ["C012345"]
},
"tools": {
"allowedTools": ["Read", "Grep", "SlackSendMessage", "deployTool"],
"mcpConfigPath": "./mcp.json"
},
"concurrency": {
"maxConcurrentRuns": 4,
"maxPendingRuns": 8
}
}

Secrets can also come from the environment: MONO_AGENT_SLACK_BOT_TOKEN and MONO_AGENT_SLACK_APP_TOKEN. The unset mention-text policy keeps one authenticated readable @name marker in the current turn; set slack.stripMentionText: true only when legacy full stripping is required.

  1. Create a Slack app with Socket Mode (app token connections:write), a bot token (chat:write plus commands for slash controls, users:read so the agent can address teammates by name, and channels:history / groups:history so a mention inside a thread arrives with that thread behind it), and Interactivity & Shortcuts enabled so runtime selectors can deliver block_actions over Socket Mode. Register /<bot-username>-model and /<bot-username>-effort; Socket Mode needs no Request URL.
  2. mono-agent init --model anthropic:claude-sonnet-4-6
  3. Write mcp.json with the team’s stdio MCP server; deployTool becomes available from the server declaration (MCP tools aren’t gated by tools.allowedTools). This playbook keeps a specific allowlist, so it lists deployTool for readability, but the entry is not what enables it.
  4. Set a specific tools.allowedTools (the built-ins you want plus SlackSendMessage) and add the slack section; set concurrency bounds (note: per-channel scope). Or drop tools.allowedTools entirely to keep the allow-all default.
  5. mono-agent validate, then mono-agent start (confirm Slack is running with both tokens).
  6. Mention the bot in an allowed channel and confirm a 👀 reaction, then a final reply. If a tool runs, confirm the final reply is a new message and the temporary activity message is removed.

For real-turn cache measurements and tool-definition changes, enable providers.piNative.promptCacheDiagnostics and use the offline prompt-cache artifact reader.