How to Connect Openclaw to Mattermost: Step-by-Step Guide
Quick Start
Integrating Openclaw with Mattermost lets your AI agent respond to messages in your team chat. This guide walks you through installing the plugin and configuring authentication in under 5 minutes.
If you're exploring other messaging platforms, check out our guides on Slack Integration or Discord Setup for alternative options.
Install the Mattermost Plugin
Mattermost support ships as a plugin and is not bundled with the core Openclaw installation. Install it via the CLI:
openclaw plugins install @openclaw/mattermost Note: If you are running Openclaw from a local git repository, use openclaw plugins install ./extensions/mattermost instead.
Configure Authentication
Option A: Configuration File (Recommended)
Add the mattermost block to your ~/.openclaw/openclaw.json file:
{ "channels": { "mattermost": { "enabled": true, "botToken": "your-mm-bot-token", "baseUrl": "https://chat.example.com", "dmPolicy": "pairing" } } } Option B: Environment Variables
Alternatively, if you prefer using environment variables on your gateway host:
export MATTERMOST_BOT_TOKEN="your-mm-bot-token" export MATTERMOST_URL="https://chat.example.com" Getting Your Mattermost Bot Token
- Go to Main Menu → Integrations → Bot Accounts
- Click Add Bot Account
- Name your bot (e.g., openclaw-bot)
- Copy the generated token immediately (it won't be shown again)
- Ensure the bot has permissions to post in your target channels
Test Your Setup
Restart your Openclaw gateway to apply the configuration:
openclaw gateway restart Send a direct message to your bot in Mattermost:
You: @openclaw-bot hello Bot: Hello! I'm your Openclaw assistant. How can I help you today?
Troubleshooting & Best Practices
- Connection refused: Verify your baseUrl includes https:// and is reachable from the gateway
- 401 Unauthorized: Regenerate the bot token and update your config
- Bot not responding: Check that the bot is a member of the channel and has posting permissions
- Use pairing for dmPolicy to require users to explicitly start conversations with the bot
- Consider setting up a dedicated service account for production deployments
Your Mattermost workspace is now AI-enabled. The bot will respond to mentions and direct messages according to your configured policies.