list_channels
List Channels
List all Mattermost channels the authenticated user is a member of.
team_idcategoryinclude_dminclude_muted
io.github.toffguy77Published by GitHub account toffguy77v1.1.0Updated Nov 3, 2026
Mattermost: read unreads, mentions, channels and threads; opt-in posting, edits, reactions
Mattermost's local MCP server; no sign-in required; STDIO; 15 tools.
No AI overview yet: these facts come from the registry entry and the server itself.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
A Model Context Protocol server for Mattermost. It lets an AI agent (Claude, Cursor, VS Code, any MCP client) catch up on your unreads and mentions, read channels, threads and DMs, and search. If you switch write mode on, the agent can also post, reply, send DMs, edit its own messages and react.
MATTERMOST_ENABLE_WRITE=1. Even then, the agent can only edit posts
written by your own account.mattermost-mcp-server login: sign in once in a browser window
and the server picks up the session cookies itself, and picks them up again
when they expire.Claude Code
Claude Desktop (claude_desktop_config.json), Cursor
(~/.cursor/mcp.json) and other clients that use mcpServers:
VS Code (.vscode/mcp.json):
Then try asking: "What did I miss in Mattermost today?" or "Summarize the thread about the release in #engineering."
To let the agent post, add "MATTERMOST_ENABLE_WRITE": "1" to env (see
Write mode).
Every tool carries MCP annotations (readOnlyHint, destructiveHint,
idempotentHint), so clients can auto-approve reads and ask before writes.
Nothing can delete posts, change channels or perform admin actions.
Write mode is off unless MATTERMOST_ENABLE_WRITE is 1, true, yes or
on. When it is off:
The one server-side effect of read-only mode is the same as in any
Mattermost client: get_direct_messages with someone you have never
messaged creates the (empty) DM channel between you.
When write mode is on, update_post checks the post's author and refuses
any post that is not yours, even if your account has permission to edit
other people's posts. Posts are written as the authenticated user (or bot),
so consider a dedicated bot account for agents that post on their own.
Choosing the auth mode. If MATTERMOST_AUTH_MODE is unset, the first
credential source that has any credential decides. The sources are checked
in order: env, then cookie host, then the saved login session, then
keychain. MATTERMOST_ACCESS_TOKEN in
that source means token mode. MATTERMOST_TOKEN alone means cookie mode. A
lower-priority source never overrides a higher one.
No personal access tokens on your server? Sign in once the way you always do (password, SSO, MFA), and the server uses your session:
A browser window opens at your server's login page and closes by itself as
soon as you are signed in. Any installed Chrome, Chromium, Edge or Brave
works; set MATTERMOST_BROWSER to use a specific one. The session cookies
are checked against the server and saved to
~/.config/mattermost-mcp/session.env (mode 0600). From then on the server
needs no credentials in its configuration at all:
Other ways to sign in:
When the session expires. Sessions expire after the time your admin
configured. Run login again; running servers pick the new session up on
their next call, without a restart. With MATTERMOST_AUTO_LOGIN=1 in the
server's env, the server opens the sign-in window itself when it gets a
401. The browser profile remembers your identity provider, so with SSO this
often completes without typing anything. Several running servers share one
window.
The sign-in browser uses its own profile in
~/.config/mattermost-mcp/browser-profile, separate from your everyday
browser. On macOS and Linux the server talks to it over a private pipe, not
a network port.
To use session cookies directly, without login: log in to Mattermost in a
browser, open DevTools → Application → Cookies, and copy MMAUTHTOKEN,
MMCSRF and (optionally) MMUSERID into MATTERMOST_TOKEN,
MATTERMOST_CSRF and MATTERMOST_USER_ID. This is also the way to go when a
reverse proxy strips the Authorization header.
Session cookies expire. When they do, tool calls fail with a 401 error. Put
fresh cookies wherever the server reads them from, then restart it, because
env is read only once. If something rotates cookies for you, describe it in
MATTERMOST_AUTH_HELP so the agent knows what to do.
The server resolves each field separately. The first source that has a value wins:
Environment variables, as above.
Cookie host (off by default). A plain KEY=VALUE file with the same
variable names, kept on another machine and read over ssh. Use this when
one machine rotates the credential and others just consume it. The result
is cached locally. On a 401 the server pulls the file again and retries
once. ssh runs with BatchMode=yes, so a locked key fails fast instead of
hanging the MCP handshake, and the reason goes to stderr. The file may
only supply MATTERMOST_URL, MATTERMOST_ACCESS_TOKEN,
MATTERMOST_TOKEN, MATTERMOST_CSRF and MATTERMOST_USER_ID. Nothing
else is read from it, not even the auth or write mode.
Saved session from mattermost-mcp-server login. It is used only as
a whole (URL, cookies and CSRF together), only in cookie mode, and only
when it belongs to the same server as any MATTERMOST_URL you set.
OS keychain: accounts url, access_token, token, csrf and
user_id under the service MATTERMOST_KEYCHAIN_SERVICE.
Mattermost rejected the access token (401): the token was revoked
or mistyped. Create a new one, or check whether your account is still
allowed to use personal access tokens.Mattermost rejected the session cookies (401): the browser session
expired. Run mattermost-mcp-server login again (or set
MATTERMOST_AUTO_LOGIN=1). If you set the cookies by hand, copy fresh ones
and restart the server.No Chromium-family browser found: install Chrome, Chromium, Edge or
Brave, point MATTERMOST_BROWSER at one, or use login --password or
login --from-firefox.Write tools in cookie mode need the MMCSRF cookie: set
MATTERMOST_CSRF. Mattermost requires it for any change made with cookie
auth.write mode is disabled: set MATTERMOST_ENABLE_WRITE=1 and restart
the client.HTTPS_PROXY/ALL_PROXY, including SOCKS. If that proxy should not be
used for Mattermost, set MATTERMOST_TRUST_ENV=0.PATH. Use the full path to uvx (which uvx) as command.Run your local checkout from a client with
uv run --project /path/to/mattermost-mcp mattermost-mcp.
python -m mattermost_mcp works too. The tests never touch the network or
ssh: HTTP is mocked with respx. See CONTRIBUTING.md,
CHANGELOG.md and SECURITY.md.
MIT
Source: README.md at commit 66f7765
List Channels
List all Mattermost channels the authenticated user is a member of.
team_idcategoryinclude_dminclude_mutedGet Channel Posts
Get recent posts from a Mattermost channel, newest first.
limitsincebeforechannel_idrequiredGet Thread
Get a post and all its replies.
post_idrequiredSearch Posts
Full-text search across Mattermost posts, newest first. Supports Mattermost search syntax (from:username, in:channel-name, before:/after:/on:YYYY-MM-DD, "exact phrase", -excluded). By default skips channels the user has muted in the sidebar — pass include_muted=True to widen the search.
limitqueryrequiredcategorychannel_idinclude_mutedGet Direct Messages
Get direct message history with a specific user, newest first.
limitsincebeforeusernamerequiredGet Mentions
Get posts that mention the authenticated user, newest first. Mentions in muted channels are included by default — mute hides unread badges, not @-mentions. Pass include_muted=False to exclude them.
limitsinceinclude_mutedGet Unread
Get unread counts and mention badges per channel. By default skips channels muted in the sidebar (same behavior as the client unread badge). Pass include_muted=True to see every unread.
categoryinclude_mutedGet User
Get a Mattermost user's profile by username.
usernamerequiredGet Me
Get the authenticated user and what this server is allowed to do. Returns {id, username, first_name, last_name, email, status, nickname, position, auth_mode, write_enabled}. auth_mode is "token" or "cookie"; write_enabled tells whether posting/editing tools are available.
Takes no parameters.
List Teams
List the teams the authenticated user belongs to. Returns list of {id, name, display_name}.
Takes no parameters.
Get Post
Get a single post by ID.
post_idrequiredGet Channel
Look up a channel by ID, or by its name (the URL slug, e.g. "town-square"). Pass channel_id, or name. With name alone, searches the channels you are a member of; add team_id or team_name to look up any channel in a team. Returns {id, name, display_name, type, team_id, header, purpose}.
nameteam_idteam_namechannel_idSearch Users
Find users by username, full name, nickname or email prefix.
termrequiredlimitGet Pinned Posts
Get the posts pinned in a channel.
channel_idrequiredGet File Info
Get metadata of a file attached to a post (see a post's file_ids). The file content is not downloaded.
file_idrequired90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
claude mcp add mattermost \ -e MATTERMOST_URL=https://mattermost.example.com \ -e MATTERMOST_ACCESS_TOKEN=your-token \ -- uvx mattermost-mcp-server{ "mcpServers": { "mattermost": { "command": "uvx", "args": ["mattermost-mcp-server"], "env": { "MATTERMOST_URL": "https://mattermost.example.com", "MATTERMOST_ACCESS_TOKEN": "your-token" } } }}{ "inputs": [ { "type": "promptString", "id": "mm-token", "description": "Mattermost access token", "password": true } ], "servers": { "mattermost": { "command": "uvx", "args": ["mattermost-mcp-server"], "env": { "MATTERMOST_URL": "https://mattermost.example.com", "MATTERMOST_ACCESS_TOKEN": "${input:mm-token}" } } }}uvx mattermost-mcp-server login --url https://mattermost.example.comclaude mcp add mattermost -- uvx mattermost-mcp-servermattermost-mcp-server login --password # username/email + password (+ MFA code); the password is not storedmattermost-mcp-server login --from-firefox # reuse the session of a Firefox where you are signed inmattermost-mcp-server status # which server, user and credential source is in usemattermost-mcp-server logout # revoke and delete the saved session (--forget-browser: also the browser profile)# macOSsecurity add-generic-password -s mattermost-mcp -a url -w https://mattermost.example.comsecurity add-generic-password -s mattermost-mcp -a access_token -w <personal access token># Linux (pass)pass insert mattermost-mcp/urlpass insert mattermost-mcp/access_tokengit clone https://github.com/toffguy77/mattermost-mcp.gitcd mattermost-mcpuv syncuv run pytestuv run ruff check