OpenClaw Mattermost Channel
Connect OpenClaw to Mattermost, the open-source enterprise messaging platform, enabling your AI assistant to participate in direct messages, group channels, and team conversations. The integration uses bot token authentication and WebSocket events for real-time bidirectional communication, with flexible chat modes and granular access control policies.
Mattermost Supported Features
Text Messages
Supported
Media & Files
Supported
Reactions
Supported
Threads
Supported
Voice Messages
Not Supported
Group Chat
Supported
Mattermost Prerequisites
- A Mattermost server (self-hosted or cloud) with admin access to create bot accounts
- A Bot Account with a bot token created in Mattermost System Console
- The Mattermost server base URL accessible from the OpenClaw Gateway
- OpenClaw Gateway installed and running
- The Mattermost plugin installed via 'openclaw plugins install @openclaw/mattermost'
Mattermost Quick Setup
Install the Mattermost plugin
Run 'openclaw plugins install @openclaw/mattermost' to add Mattermost support to your Gateway.
Create a Bot Account in Mattermost
Go to Mattermost System Console > Integrations > Bot Accounts. Click 'Add Bot Account', set a display name and description, and copy the generated bot token. Make sure 'Enable Bot Account Creation' is set to true in System Console > Integrations > Integration Management.
Configure and launch
Add the Mattermost channel configuration to ~/.openclaw/openclaw.json with your botToken, baseUrl, and desired policies. Start the Gateway with 'openclaw start'. Send a direct message to the bot or @mention it in a channel to verify the connection.
Mattermost Configuration Example
{
"channels": {
"mattermost": {
"enabled": true,
"botToken": "your-bot-token",
"baseUrl": "https://mattermost.example.com",
"dmPolicy": "pairing",
"chatmode": "oncall"
}
}
}Mattermost Deep Dive
Architecture Overview
Creating a Bot Account
{
"channels": {
"mattermost": {
"botToken": "your-bot-token",
"baseUrl": "https://mattermost.example.com"
}
}
}Chat Modes
{
"channels": {
"mattermost": {
"chatmode": "onchar",
"oncharPrefixes": ["!", "/ai"]
}
}
}DM Policies
{
"channels": {
"mattermost": {
"dmPolicy": "pairing",
"allowFrom": ["user-id-1", "user-id-2"]
}
}
}Group and Channel Policies
{
"channels": {
"mattermost": {
"groupPolicy": "allowlist",
"groupAllowFrom": ["channel-id-1", "channel-id-2"]
}
}
}Multi-Account Setup
{
"channels": {
"mattermost": {
"accounts": {
"production": {
"botToken": "prod-bot-token",
"baseUrl": "https://mattermost.company.com",
"chatmode": "oncall",
"dmPolicy": "pairing",
"allowFrom": ["user-1", "user-2"]
},
"dev-team": {
"botToken": "dev-bot-token",
"baseUrl": "https://mm-dev.company.com",
"chatmode": "onmessage",
"dmPolicy": "open"
}
}
}
}
}Outbound Messaging
{
"action": "mattermost",
"params": {
"message": "Daily standup reminder: please post your updates!",
"to": "channel:abc123def456"
}
}Rich Message Features
Rate Limits and Best Practices
Mattermost Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the Mattermost channel |
| botToken | string | "" | Bot token from Mattermost System Console > Bot Accounts |
| baseUrl | string | "" | Full URL of your Mattermost server (e.g., https://mattermost.example.com) |
| chatmode | string | "oncall" | Chat trigger mode: 'oncall' (mention), 'onmessage' (all), or 'onchar' (prefix) |
| oncharPrefixes | string[] | [] | Prefix characters that trigger the bot when chatmode is 'onchar' |
| dmPolicy | string | "pairing" | DM access policy: 'pairing' (allowlist only) or 'open' (any user) |
| allowFrom | string[] | [] | Mattermost user IDs allowed to DM the bot (used with dmPolicy: pairing) |
| groupPolicy | string | "allowlist" | Group channel policy: 'allowlist' (specified channels only) or 'open' (any channel) |
| groupAllowFrom | string[] | [] | Mattermost channel IDs where the bot is allowed to respond (used with groupPolicy: allowlist) |
| requireMention | boolean | true | Legacy setting — prefer using chatmode: 'oncall' instead |
| accounts.<id>.botToken | string | "" | Bot token for a specific account in multi-account mode |
| accounts.<id>.baseUrl | string | "" | Mattermost server URL for a specific account |
| accounts.<id>.chatmode | string | "oncall" | Chat trigger mode for a specific account |
| accounts.<id>.dmPolicy | string | "pairing" | DM access policy for a specific account |
Enable or disable the Mattermost channel
Bot token from Mattermost System Console > Bot Accounts
Full URL of your Mattermost server (e.g., https://mattermost.example.com)
Chat trigger mode: 'oncall' (mention), 'onmessage' (all), or 'onchar' (prefix)
Prefix characters that trigger the bot when chatmode is 'onchar'
DM access policy: 'pairing' (allowlist only) or 'open' (any user)
Mattermost user IDs allowed to DM the bot (used with dmPolicy: pairing)
Group channel policy: 'allowlist' (specified channels only) or 'open' (any channel)
Mattermost channel IDs where the bot is allowed to respond (used with groupPolicy: allowlist)
Legacy setting — prefer using chatmode: 'oncall' instead
Bot token for a specific account in multi-account mode
Mattermost server URL for a specific account
Chat trigger mode for a specific account
DM access policy for a specific account
Mattermost Frequently Asked Questions
Mattermost Troubleshooting
The chat mode or access policy may be filtering out the messages.
The baseUrl is incorrect, the bot token is invalid, or the server is unreachable.
The bot is not a member of the target channel.
The Mattermost server's file upload settings may restrict file types or sizes.
The bot is making too many API requests in a short period.