Summary
Mattermost team chat from any AI agent, self-hosted or Cloud: teams, channels, messages and threads, message and file search, users, pinned posts, reactions and file descriptions. Sends messages, replies in threads, edits posts and reacts in the name of a bot or user account; deleting is switched off.
Guided setup
Connect Mattermost to Gemini in 2 minutes
Start a free trial on AnythingMCP Cloud, connect Mattermost in the guided setup, then add your MCP URL to Gemini. No code and no server to run.
No credit card · 7-day trial · Self-host alternative available
Try asking
Example prompts for Mattermost
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Mattermost, enter your Mattermost address and a bot or personal access token, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Mattermost + Gemini
Mattermost team chat from any AI agent, self-hosted or Cloud: teams, channels, messages and threads, message and file search, users, pinned posts, reactions and file descriptions. Sends messages, replies in threads, edits posts and reacts in the name of a bot or user account; deleting is switched off.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
MATTERMOST_URL, MATTERMOST_TOKEN
Step 1 — Get credentials
Setting up takes about 5 minutes.
MATTERMOST_URL: the address you open Mattermost at, without a trailing slash and without/api/v4, e.g.https://chat.example.comorhttps://yourcompany.cloud.mattermost.com.- Choose the account the connector acts as:
- Bot account (recommended for a shared assistant): a system admin opens System Console, Integrations, Bot Accounts (enable bot account creation there first), then Integrations, Bot Accounts, Add Bot Account in a team's menu, and copies the token shown once. Add the bot to every team and channel it should read or post in.
- Personal access token (acts as you): a system admin enables System Console, Integrations, Integration Management, Enable Personal Access Tokens and allows them for your user (System Console, Users, your user, Manage Roles). Then open Profile, Security, Personal Access Tokens, Create Token and copy the Access Token (not the Token ID); it is shown once.
- Paste the token into
MATTERMOST_TOKEN. It is sent asAuthorization: Bearer <token>and does not expire unless the server sets an expiry or it is revoked.
Where Mattermost runs
- Self-hosted AnythingMCP: a Mattermost server on a private network (
http://10.0.0.5:8065, an internal host name) is blocked by the outbound SSRF guard by default; an administrator must allow the host through theSSRF_ALLOWED_HOSTSenvironment variable or the allowlist in the admin settings. - AnythingMCP Cloud: Cloud can only reach a server that is public over HTTPS. A private address is refused.
Where to start
mattermost_get_mefor the account's own id, thenmattermost_list_my_teamsfor team ids andmattermost_list_my_channelsfor the channels of a team (public, private, direct and group messages).- Read:
mattermost_list_channel_posts,mattermost_get_thread,mattermost_get_post,mattermost_list_pinned_posts. Search:mattermost_search_postsandmattermost_search_files. - Find a channel:
mattermost_search_channels,mattermost_get_channel_by_name,mattermost_list_public_channels; details withmattermost_get_channel,mattermost_get_channel_statsandmattermost_list_channel_members. - People:
mattermost_search_users,mattermost_get_user,mattermost_get_user_by_username,mattermost_list_users,mattermost_list_team_members. Teams:mattermost_list_teams,mattermost_get_team,mattermost_get_team_by_name. - Threads the account follows:
mattermost_list_followed_threads. Reactions:mattermost_list_post_reactions. Files:mattermost_list_post_filesandmattermost_get_file_info(descriptions only, never the content).
Writing
mattermost_create_postsends a message at once; withroot_idit replies in a thread. For a direct message callmattermost_create_direct_channelfirst and post to the channel id it returns. Say where the message goes and what it says before sending, unless the user already dictated both.mattermost_update_postedits a post or pins it.mattermost_add_reactionadds an emoji reaction.- Switched off at install:
mattermost_delete_postandmattermost_remove_reaction. Channels, teams and users cannot be created, changed or removed through this connector, and files cannot be uploaded.
Reading the data
- Ids are 26 lower-case letters and digits. Posts carry
user_idandchannel_id, not names: resolve them withmattermost_get_userandmattermost_get_channel. - Post lists come as
order(ids, newest first) andposts(a map from id to post). A post with aroot_idis a reply; its thread ismattermost_get_threadwith any id of the thread. - Times are Unix epoch milliseconds in UTC.
delete_at0 means not deleted. - Channel
type: O public, P private, D direct message, G group message. Thenameof a team or channel is the handle in its URL;display_nameis what people see. - The account only sees channels it is a member of (plus public channels of its teams). A 403 on a channel usually means the bot or user has not been added to it.
Limits and errors: lists return 60 items per page (at most 200); pages start at 0. A server with rate limiting on answers 429 and sends X-Ratelimit-Reset (seconds to wait); the default is 10 requests per second. 401: the token is wrong or revoked, or personal access tokens were switched off. 403: the account lacks the permission. 404: the id does not exist, or MATTERMOST_URL is wrong or already ends in /api/v4. Search needs at least one term and finds only what the account may read.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Gemini
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell) —anythingmcpshould show as connected. - Start prompting — Gemini CLI can now call the
Mattermosttools.
Available tools
| Tool | What it does |
|---|---|
mattermost_get_me | Get the account this connector acts as (the owner of the token or the bot): id, username, email, first_name, last_name, nickname, roles… |
mattermost_list_users | List users, optionally only the members of one team or channel. Each user has id, username, first_name, last_name, nickname, email (when… |
mattermost_search_users | Find users by a term matched against username, full name, nickname and email. Returns the matching users with id, username, first_name… |
mattermost_get_user | Get one user by id: username, first_name, last_name, nickname, email (when visible), position, roles, locale, timezone and delete_at. Use… |
mattermost_get_user_by_username | Get one user by username (the handle after the @ sign, without the @): id, first_name, last_name, nickname, email (when visible), position… |
mattermost_list_my_teams | List the teams this account belongs to: id, name (the URL handle), display_name, description, type (O for open, I for invite only) and… |
mattermost_list_teams | List the teams of the server that this account may see: its own teams plus teams open to join (all teams for a system admin). Each team has… |
mattermost_get_team | Get one team by id: name, display_name, description, type, company_name, allowed_domains, allow_open_invite, create_at and delete_at |
mattermost_get_team_by_name | Get one team by its name, the handle in the team URL (for https://chat.example.com/engineering/channels/town-square the name is… |
mattermost_list_team_members | List the members of a team: user_id, roles, scheme_admin (team admin), scheme_guest and delete_at per member. Names are not included… |
mattermost_list_my_channels | List every channel of one team that this account is a member of, including private channels, direct messages (type D) and group messages… |
mattermost_list_public_channels | List the public channels of a team, whether or not this account has joined them: id, name, display_name, header, purpose and last_post_at.… |
mattermost_search_channels | Find channels of a team by a term matched against the channel name, display name and purpose. Returns public channels and the private… |
mattermost_get_channel | Get one channel by id: team_id, name, display_name, type, header, purpose, creator_id, create_at, last_post_at and total_msg_count |
mattermost_get_channel_by_name | Get one channel by its name, the handle in the channel URL (for https://chat.example.com/engineering/channels/release-notes the name is… |
mattermost_list_channel_members | List the members of a channel: user_id, roles, last_viewed_at, msg_count and mention_count per member. Names are not included: resolve user… |
mattermost_get_channel_stats | Get the size of a channel: member_count, guest_count, pinnedpost_count and files_count |
mattermost_create_direct_channel | Open the direct message channel between two users (it is created when it does not exist yet) and return it with its id. To send someone a… |
mattermost_list_channel_posts | Read the messages of a channel, newest first. Returns order (post ids, newest first) and posts (a map from id to post with id, user_id… |
mattermost_get_post | Get one post by id: channel_id, user_id, message, create_at, update_at, edit_at, root_id (set when it is a reply), reply_count, file_ids… |
mattermost_get_thread | Get a whole thread: the root post and every reply. Works with the id of any post in the thread. Returns order (post ids) and posts (a map… |
mattermost_list_pinned_posts | List the posts pinned in a channel, as order and posts like mattermost_list_channel_posts. Pinned posts usually hold the rules, links and… |
mattermost_search_posts | Search the messages of one team that this account can read. Returns order, posts (a map from id to post) and matches. The terms accept… |
mattermost_create_post | Send a message to a channel, or reply in a thread when root_id is given. The message is posted at once in the name of the connector's… |
mattermost_update_post | Edit the text of an existing post or pin and unpin it. Only the fields given are changed. Editing another person's post needs the matching… |
mattermost_delete_post | Delete a post. Installed switched off: the message disappears for everyone, and deleting the first post of a thread removes its replies… |
mattermost_list_followed_threads | List the threads this account follows in a team (needs collapsed reply threads on the server). Returns total, total_unread_threads… |
mattermost_list_post_reactions | List the emoji reactions on a post: user_id, emoji_name and create_at per reaction. An empty answer means nobody reacted |
mattermost_add_reaction | React to a post with an emoji in the name of the connector's account, for example to acknowledge a request. Returns the reaction. A… |
mattermost_remove_reaction | Remove one of this account's own emoji reactions from a post. Installed switched off like every delete |
mattermost_list_post_files | List the files attached to a post: id, name, extension, size in bytes, mime_type, create_at and, for images, width and height. Only the… |
mattermost_get_file_info | Get the description of one uploaded file: name, extension, size in bytes, mime_type, the post and channel it belongs to, the uploader… |
mattermost_search_files | Search the files shared in one team by file name, extension and, when the server extracts it, file content. Returns order and file_infos (a… |
Example prompts
- "Summarise what happened in the town-square channel today."
- "Search all posts about the release freeze from the last week."
- "Who are the members of the incident-response channel?"
- "Reply in the thread about the outage that the fix is deployed."
- "Show the pinned posts of the support channel."
FAQ
Which token do I use? A bot account token (recommended for a shared assistant; a system admin enables bot accounts first) or a personal access token, which acts as you. Copy the Access Token, not the Token ID. Add a bot to every team and channel it should read or post in. On AnythingMCP Cloud the server must be public over HTTPS; a self-hosted AnythingMCP can reach a private server once an administrator allows the host.
What does it cover? Teams, channels, messages and threads, message and file search, users, pinned posts, reactions and the description of attached files (never their content). It sends messages, replies in threads, edits and pins posts and adds reactions. Channels, teams and users cannot be created, changed or removed, and files cannot be uploaded.
Which tools install switched off? mattermost_delete_post and mattermost_remove_reaction. Switch them on on the connector page only if the AI should use them.
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
Was this guide helpful?