#How to integrate openclaw with mattermost
1 messages · Page 1 of 1 (latest)
Mattermost support is a downloadable/bundled channel plugin. Quick path:
- Install/ensure the plugin is available:
openclaw plugins install @openclaw/mattermost
Current packaged releases may already bundle it, but that command is fine for older/custom installs.
-
In Mattermost, create a bot account and copy its bot token.
-
Add Mattermost to your OpenClaw config:
{
channels: {
mattermost: {
enabled: true,
botToken: "mm-token",
baseUrl: "https://chat.example.com",
dmPolicy: "pairing"
}
}
}
You can also use env vars for the default account:
MATTERMOST_BOT_TOKEN=...
MATTERMOST_URL=https://chat.example.com
- Restart the gateway, then test:
openclaw gateway restart
openclaw status --deep
- For DMs, default
dmPolicy: "pairing"means first-time users get a pairing code. Approve with:
openclaw pairing list mattermost
openclaw pairing approve mattermost <CODE>
For channels/groups, default is allowlist + mention-gated. If you want it available in channels, configure groupPolicy, groupAllowFrom, or per-channel groups rules.
Docs: https://docs.openclaw.ai/channels/mattermost
If it errors, paste openclaw --version plus openclaw status --all and I’ll help debug it.
is there a prompt i can give to my openclaw agent to do this by his self
Yep — give your local OpenClaw agent something like this. Don’t paste the bot token in Discord/public chat; give it locally in your private OpenClaw session.
Help me set up the Mattermost channel for OpenClaw.
First, check my OpenClaw version with `openclaw --version` and inspect the local docs for Mattermost before changing anything.
My Mattermost base URL is: https://YOUR-MATTERMOST-HOST
My Mattermost bot token is available as MATTERMOST_BOT_TOKEN in my shell, or ask me for it privately if missing.
Please:
1. Verify whether the Mattermost plugin is installed; install `@openclaw/mattermost` if needed.
2. Update my OpenClaw config to enable Mattermost with:
- enabled: true
- baseUrl: my Mattermost URL
- botToken from env/private input
- dmPolicy: "pairing"
3. Do not print the token in logs or replies.
4. Restart the OpenClaw gateway safely.
5. Run `openclaw status --deep` and tell me whether Mattermost is connected.
6. If pairing is needed, show me the exact `openclaw pairing list mattermost` / `openclaw pairing approve mattermost <CODE>` steps.
Use the official docs as reference: https://docs.openclaw.ai/channels/mattermost
If your agent has config-edit tools enabled, that should be enough. If it’s running in a restricted mode, it may only be able to tell you what to change rather than editing/restarting itself.
Yeah — don’t fix this by stuffing more personal identity into SOUL.md. The root issue is that USER.md is loaded into the agent workspace every session, and it means “context about the owner / primary user”, not “the person currently messaging me”. If one shared Mattermost bot is used by multiple people, a personal USER.md will leak into how it talks to everyone.
Best fixes, in order:
- For a shared/team Mattermost agent: make
USER.mdneutral or remove personal details from it.
ExampleUSER.md:
# USER.md
This is a shared Mattermost assistant used by multiple people.
Do not assume the current speaker is the workspace owner.
Use inbound channel metadata / sender name when available to address the person.
Never say private owner facts as if they belong to the current user.
Then put owner-only/private notes somewhere the shared agent does not load, or keep them out of the shared workspace entirely.
- Add a hard rule in
AGENTS.mdorSOUL.md— I’d put it in AGENTS.md because it’s an operating rule:
## Multi-user channel rule
This agent is used by multiple Mattermost users.
USER.md describes the workspace owner/admin, not necessarily the current speaker.
Before referring to the user by name or personal details, use the inbound sender metadata from the current message.
If sender identity is unclear, use neutral wording and ask.
Do not reveal or attribute owner/private profile details to other users.
- If each person needs their own private assistant identity/memory, use multi-agent routing instead: create one agent/workspace per person, each with its own
USER.md, then bind each Mattermost DM/user/channel to the rightagentId. That’s the clean isolation model: separate workspace, auth/session store, memories, and persona.
Docs:
- Workspace files: https://docs.openclaw.ai/concepts/agent-workspace
- Multi-agent routing: https://docs.openclaw.ai/concepts/multi-agent
- Mattermost channel: https://docs.openclaw.ai/channels/mattermost
Short version: for a shared Mattermost bot, make USER.md describe the deployment, not you personally. For per-person personal assistants, use separate agents/workspaces.
i want each person to have an entry in USER.md or just have a .md file for them self. since i want one agent that will tell the difference to multiple ppl
You can do that, but I would not put each person directly in USER.md as if they’re all “the user”. That file is loaded as global context, so models can blur it.
Better pattern for one shared agent that recognizes multiple people:
- Keep
USER.mdneutral: “this is a shared Mattermost assistant” - Create a separate people registry, keyed by stable Mattermost user IDs
- Add an
AGENTS.mdrule telling the agent to identify the sender by ID before using personal context
Example workspace layout:
~/.openclaw/workspace/
AGENTS.md
USER.md
SOUL.md
people/
README.md
mattermost-u123abc.md
mattermost-u456def.md
Example USER.md:
# USER.md
This is a shared Mattermost assistant used by multiple people.
The current speaker is determined from inbound sender metadata, not from this file.
Do not assume any personal profile belongs to the current speaker unless their stable Mattermost user ID matches a profile in people/.
Example people/README.md:
# People registry
Profiles are keyed by stable Mattermost user ID, not display name.
- u123abc → people/mattermost-u123abc.md
- u456def → people/mattermost-u456def.md
Example people/mattermost-u123abc.md:
# Person profile: Alex
Mattermost user ID: u123abc
Preferred name: Alex
Preferences:
- Likes short answers
- Uses Ubuntu
Notes:
- Only use these facts when the inbound sender ID is u123abc.
Then add this to AGENTS.md:
## Multi-user Mattermost identity rule
This is one shared agent serving multiple Mattermost users.
Never assume USER.md describes the current speaker.
For every Mattermost message:
1. Identify the sender using stable inbound sender metadata, preferably Mattermost user ID.
2. Check people/README.md for a matching profile file.
3. Only use a person’s profile when the stable sender ID matches that profile.
4. If there is no matching profile, treat them as a new/unknown user and ask what name/preferences to remember.
5. Never attribute one person’s private facts to another person.
6. Display names and usernames are mutable; do not use them as the primary identity key.
Important caveat: this gives you recognition, not full privacy isolation. One shared agent still has shared workspace/session/memory risk. If people need genuinely private memories, use multi-agent routing. But for “same bot, knows who is talking”, the people/ registry pattern is the clean way.
after this do i restart openclaw?
If you only changed USER.md, AGENTS.md, SOUL.md, or added people/*.md: usually no full OpenClaw restart is needed — new agent sessions will load the updated workspace files.
But for your case, I’d do one of these:
- Best quick fix: start a fresh chat/session with the agent after editing, so it doesn’t keep old “you are the owner” context in the existing session.
- Safe reset: restart the gateway if you want to be sure everything reloads:
openclaw gateway restart
If you changed ~/.openclaw/openclaw.json config, channel bindings, agents, or Mattermost settings, then yes: restart the gateway.
So: markdown-only = fresh session is usually enough; config/routing changes = restart.
You can, but you don’t have to.
I’d put the strict identity rule in AGENTS.md, not SOUL.md, because this is an operating/safety rule, not personality.
Use SOUL.md only for a short tone reminder like:
## Shared assistant identity
You are a shared Mattermost assistant. Be friendly and personal, but do not assume the current speaker is the workspace owner. Respect each user’s separate identity and privacy.
Put the important rule in AGENTS.md:
## Multi-user identity rule
This agent is used by multiple Mattermost users.
USER.md describes the deployment/admin, not necessarily the current speaker.
Before using names, preferences, or personal facts, identify the sender by stable Mattermost user ID and match it to a profile in people/.