Channel: Mattermost
Mattermost is a self-hosted team messaging platform. The adapter connects your agent as a bot account and supports posts, reactions, and slash commands.
Community adapter
This adapter is maintained by the community: chat-adapter-mattermost.
Before you start
- In Mattermost System Console → Integrations, create a Bot Account.
- Copy the Access Token generated for the bot.
- Note your Mattermost server URL (e.g.
https://mattermost.example.com). - You need a
PUBLIC_URLreachable by the Mattermost server for interactive button callbacks.
Example prompts
Connect the support-agent to Mattermost.
Add Mattermost to my ops agent.
What happens
The widget asks for credentials:
name type SUPPORT_AGENT_MATTERMOST_BASE_URLtext SUPPORT_AGENT_MATTERMOST_BOT_TOKENpassword Shmastra wires the adapter:
tsimport { Agent } from '@mastra/core/agent' import { createMattermostAdapter } from 'chat-adapter-mattermost' import { createAgentChannels } from '../shmastra' export const supportAgent = new Agent({ id: 'support-agent', channels: createAgentChannels({ adapters: { mattermost: createMattermostAdapter(), }, }), })The widget prints the callback URL to register in Mattermost System Console → Integrations → Interactive Dialogs:
{PUBLIC_URL}/api/agents/support-agent/channels/mattermost/webhookInvite the bot to a channel and mention it — the agent replies.
Tips
- Slash commands — register a slash command in Mattermost pointing to the same webhook URL to trigger the agent without an @-mention.
- Self-signed TLS — if your Mattermost instance uses a self-signed cert, set
NODE_TLS_REJECT_UNAUTHORIZED=0in the agent's environment (dev only).