list_channels
List Channels
List all Mattermost channels the authenticated user is a member of.
team_idcategoryinclude_dminclude_muted
io.github.toffguy77由 GitHub 帳號 toffguy77 發布v1.1.0更新於 Nov 3, 2026
Mattermost:讀取未讀訊息、提及、頻道和討論串;可選擇開啟發帖、編輯和表情回應
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
Mattermost: read unreads, mentions, channels and threads; opt-in posting, edits, reactions
Mattermost 的本機 MCP 服務;無需登入;STDIO;15 個工具。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
參照 儲存庫 中的啟動說明。
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
來源:README.md,提交 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_id必填Get Thread
Get a post and all its replies.
post_id必填Search 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.
limitquery必填categorychannel_idinclude_mutedGet Direct Messages
Get direct message history with a specific user, newest first.
limitsincebeforeusername必填Get 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.
username必填Get 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.
無需輸入參數。
List Teams
List the teams the authenticated user belongs to. Returns list of {id, name, display_name}.
無需輸入參數。
Get Post
Get a single post by ID.
post_id必填Get 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.
term必填limitGet Pinned Posts
Get the posts pinned in a channel.
channel_id必填Get File Info
Get metadata of a file attached to a post (see a post's file_ids). The file content is not downloaded.
file_id必填已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
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