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
| Property | Value |
|---|---|
| Type | slack |
| Edition | Enterprise |
| Auth Methods | Bot Token (OAuth 2.0), User Token |
| Capabilities | execute, 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
- Go to api.slack.com/apps and click Create New App
- Choose From scratch and select your workspace
- Under OAuth & Permissions, add the following Bot Token Scopes:
chat:write- Send messageschannels:read- List public channelschannels:history- Read public channel historygroups:read- List private channels the bot is inusers:read- List workspace userssearch:read- Search messages (requires User Token)
- Click Install to Workspace and authorize the app
- 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
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
bot_token | string | Yes | - | Slack Bot User OAuth Token (xoxb-...) |
user_token | string | No | - | Slack User Token (xoxp-...) for search operations |
default_channel | string | No | - | Default channel for messages (e.g., #general) |
timeout | string | No | 15s | Request timeout |
max_retries | integer | No | 3 | Maximum 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
| Operation | Description |
|---|---|
send_message | Send a text or Block Kit message to a channel or user |
channels.list | List public and private channels the bot can access |
users.list | List workspace users |
messages.search | Search 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 theRetry-Afterheader. - Bot visibility: The bot can only access channels it has been invited to. Use
/invite @your-botin each channel. - Search scope: Message search requires a User Token (
xoxp-) withsearch:readscope. 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-namein 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"
}
}
