Mattermost
このコンテンツはまだ日本語訳がありません。
Mattermost (plugin)
Section titled “Mattermost (plugin)”Status: supported via plugin (bot token + WebSocket events). Channels, groups, and DMs are supported. Mattermost is a self-hostable team messaging platform; see the official site at mattermost.com for product details and downloads.
Plugin required
Section titled “Plugin required”Mattermost ships as a plugin and is not bundled with the core install.
Install via CLI (npm registry):
coderclaw plugins install @coderclaw/mattermostLocal checkout (when running from a git repo):
coderclaw plugins install ./extensions/mattermostIf you choose Mattermost during configure/onboarding and a git checkout is detected, CoderClaw will offer the local install path automatically.
Details: Plugins
Quick setup
Section titled “Quick setup”- Install the Mattermost plugin.
- Create a Mattermost bot account and copy the bot token.
- Copy the Mattermost base URL (e.g.,
https://chat.example.com). - Configure CoderClaw and start the gateway.
Minimal config:
{ channels: { mattermost: { enabled: true, botToken: "mm-token", baseUrl: "https://chat.example.com", dmPolicy: "pairing", }, },}Environment variables (default account)
Section titled “Environment variables (default account)”Set these on the gateway host if you prefer env vars:
MATTERMOST_BOT_TOKEN=...MATTERMOST_URL=https://chat.example.com
Env vars apply only to the default account (default). Other accounts must use config values.
Chat modes
Section titled “Chat modes”Mattermost responds to DMs automatically. Channel behavior is controlled by chatmode:
oncall(default): respond only when @mentioned in channels.onmessage: respond to every channel message.onchar: respond when a message starts with a trigger prefix.
Config example:
{ channels: { mattermost: { chatmode: "onchar", oncharPrefixes: [">", "!"], }, },}Notes:
oncharstill responds to explicit @mentions.channels.mattermost.requireMentionis honored for legacy configs butchatmodeis preferred.
Access control (DMs)
Section titled “Access control (DMs)”- Default:
channels.mattermost.dmPolicy = "pairing"(unknown senders get a pairing code). - Approve via:
coderclaw pairing list mattermostcoderclaw pairing approve mattermost <CODE>
- Public DMs:
channels.mattermost.dmPolicy="open"pluschannels.mattermost.allowFrom=["*"].
Channels (groups)
Section titled “Channels (groups)”- Default:
channels.mattermost.groupPolicy = "allowlist"(mention-gated). - Allowlist senders with
channels.mattermost.groupAllowFrom(user IDs or@username). - Open channels:
channels.mattermost.groupPolicy="open"(mention-gated).
Targets for outbound delivery
Section titled “Targets for outbound delivery”Use these target formats with coderclaw message send or cron/webhooks:
channel:<id>for a channeluser:<id>for a DM@usernamefor a DM (resolved via the Mattermost API)
Bare IDs are treated as channels.
Reactions (message tool)
Section titled “Reactions (message tool)”- Use
message action=reactwithchannel=mattermost. messageIdis the Mattermost post id.emojiaccepts names likethumbsupor:+1:(colons are optional).- Set
remove=true(boolean) to remove a reaction. - Reaction add/remove events are forwarded as system events to the routed agent session.
Examples:
message action=react channel=mattermost target=channel:<channelId> messageId=<postId> emoji=thumbsupmessage action=react channel=mattermost target=channel:<channelId> messageId=<postId> emoji=thumbsup remove=trueConfig:
channels.mattermost.actions.reactions: enable/disable reaction actions (default true).- Per-account override:
channels.mattermost.accounts.<id>.actions.reactions.
Multi-account
Section titled “Multi-account”Mattermost supports multiple accounts under channels.mattermost.accounts:
{ channels: { mattermost: { accounts: { default: { name: "Primary", botToken: "mm-token", baseUrl: "https://chat.example.com" }, alerts: { name: "Alerts", botToken: "mm-token-2", baseUrl: "https://alerts.example.com" }, }, }, },}Troubleshooting
Section titled “Troubleshooting”- No replies in channels: ensure the bot is in the channel and mention it (oncall), use a trigger prefix (onchar), or set
chatmode: "onmessage". - Auth errors: check the bot token, base URL, and whether the account is enabled.
- Multi-account issues: env vars only apply to the
defaultaccount.