Skip to main content

Slack Connector

The Slack connector enables AxonFlow agents to send messages, manage channels, and search message history with full policy enforcement, PII protection, and audit logging.

Overview

PropertyValue
Typeslack
EditionEnterprise
Auth MethodsBot Token (OAuth 2.0), User Token
Capabilitiesexecute, query, send_message, channels, users, search

Use Cases

  • Send incident alerts to operations channels from monitoring agents
  • Post deployment notifications and status updates
  • Search message history for context in support workflows
  • Escalate customer issues to the appropriate team channel

Prerequisites

  • AxonFlow Enterprise license (requires Enterprise Edition)
  • Slack workspace with admin access to install apps
  • Slack App created at api.slack.com/apps
  • Bot Token with required OAuth scopes

Slack App Setup

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch and select your workspace
  3. Under OAuth & Permissions, add the following Bot Token Scopes:
    • chat:write - Send messages
    • channels:read - List public channels
    • channels:history - Read public channel history
    • groups:read - List private channels the bot is in
    • users:read - List workspace users
    • search:read - Search messages (requires User Token)
  4. Click Install to Workspace and authorize the app
  5. Copy the Bot User OAuth Token (starts with xoxb-)

Configuration

Environment Variables

# Required
MCP_slack_BOT_TOKEN="xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx"

# Optional
MCP_slack_DEFAULT_CHANNEL="#general"
MCP_slack_TIMEOUT="15s"
MCP_slack_MAX_RETRIES="3"
MCP_slack_USER_TOKEN="xoxp-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx" # For search operations

Configuration Options

OptionTypeRequiredDefaultDescription
bot_tokenstringYes-Slack Bot User OAuth Token (xoxb-...)
user_tokenstringNo-Slack User Token (xoxp-...) for search operations
default_channelstringNo-Default channel for messages (e.g., #general)
timeoutstringNo15sRequest timeout
max_retriesintegerNo3Maximum retry attempts

Connector Config (Customer Portal)

{
"name": "slack-notifications",
"type": "slack",
"options": {
"default_channel": "#alerts",
"timeout": 15,
"max_retries": 3
},
"credentials": {
"bot_token": "xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx"
}
}

Installation

Install the Slack connector via the connector marketplace API:

curl -X POST http://localhost:8081/api/v1/connectors/slack/install \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"name": "slack-notifications",
"config": {
"bot_token": "xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx",
"default_channel": "#alerts"
}
}'

Operations

Send a Message

curl -X POST https://your-axonflow.example.com/mcp/tools/execute \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"connector": "slack-notifications",
"action": "send_message",
"parameters": {
"channel": "#incidents",
"text": "Production Alert: API error rate exceeded 5% threshold. Current rate: 7.2%. Dashboard: https://monitoring.example.com/api-health"
}
}'

Response:

{
"success": true,
"rows_affected": 1,
"message": "Message sent to #incidents (ts=1733654400.123456)",
"duration_ms": 85,
"connector": "slack-notifications"
}

Send a Block Kit Message

curl -X POST https://your-axonflow.example.com/mcp/tools/execute \
-d '{
"connector": "slack-notifications",
"action": "send_message",
"parameters": {
"channel": "#deployments",
"text": "Deployment v2.1.0 completed",
"blocks": [
{
"type": "header",
"text": {"type": "plain_text", "text": "Deployment Complete"}
},
{
"type": "section",
"fields": [
{"type": "mrkdwn", "text": "*Service:*\nAPI Gateway"},
{"type": "mrkdwn", "text": "*Version:*\nv2.1.0"},
{"type": "mrkdwn", "text": "*Environment:*\nProduction"},
{"type": "mrkdwn", "text": "*Status:*\nHealthy"}
]
}
]
}
}'

List Channels

curl -X POST https://your-axonflow.example.com/mcp/resources/query \
-d '{
"connector": "slack-notifications",
"statement": "channels.list",
"parameters": {
"types": "public_channel",
"limit": 50
}
}'

Response:

{
"success": true,
"rows": [
{
"id": "C01ABCDEF",
"name": "general",
"is_channel": true,
"num_members": 150
},
{
"id": "C02GHIJKL",
"name": "incidents",
"is_channel": true,
"num_members": 25
}
],
"row_count": 2,
"duration_ms": 60,
"connector": "slack-notifications"
}

Search Messages

curl -X POST https://your-axonflow.example.com/mcp/resources/query \
-d '{
"connector": "slack-notifications",
"statement": "messages.search",
"parameters": {
"query": "deployment failed in:#incidents after:2025-12-01",
"count": 10,
"sort": "timestamp"
}
}'

Supported Operations

OperationDescription
send_messageSend a text or Block Kit message to a channel or user
channels.listList public and private channels the bot can access
users.listList workspace users
messages.searchSearch message history (requires User Token with search:read scope)

Limitations

  • Rate limits: Slack enforces rate limits (approximately 1 message per second per channel for chat.write). The connector handles 429 responses with the Retry-After header.
  • Bot visibility: The bot can only access channels it has been invited to. Use /invite @your-bot in each channel.
  • Search scope: Message search requires a User Token (xoxp-) with search:read scope. Bot tokens cannot search.
  • Message length: Messages are limited to 40,000 characters. Block Kit payloads are limited to 50 blocks.
  • File uploads: File upload operations are not currently supported through this connector. Use Slack's native file upload API directly.

Troubleshooting

Message Not Delivered (channel_not_found)

  • Verify the channel name or ID is correct
  • Ensure the bot has been invited to the channel (use /invite @your-bot-name in Slack)
  • For private channels: the bot must be explicitly added as a member
  • Check that the channel has not been archived

Authentication Failed (invalid_auth)

  • Verify the Bot Token starts with xoxb- and has not been revoked
  • Check that the Slack App is still installed to the workspace
  • Regenerate the token if the app was reinstalled

Missing Permissions (missing_scope)

  • Check the required OAuth scopes in the Slack App settings
  • After adding new scopes, the app must be reinstalled to the workspace
  • Verify the correct token type is being used (Bot Token vs. User Token)

Health Check

curl https://your-axonflow.example.com/mcp/connectors/slack-notifications/health

Response:

{
"healthy": true,
"latency_ms": 45,
"details": {
"team": "Your Workspace",
"bot_user": "axonflow-bot",
"auth_type": "bot_token"
}
}