mcp-server-mattermost
Let AI assistants read, search, and post in your Mattermost workspace
39 tools · Channels · Messages · Reactions · Threads · Files · Users
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
Channels — list, create, join, manage channels and DMs Messages — send, search, edit, delete with rich attachments Reactions & Threads — emoji reactions, pins, full thread history Users & Teams — lookup, search, status Files — upload, metadata, download links Bookmarks — save links and files in channels (Entry+ edition)
Once configured, you can ask your AI assistant:
Note: Requires Entry, Professional, Enterprise, or Enterprise Advanced edition (not available in Team Edition). Minimum version: v10.1.
{
"mcpServers": {
"mattermost": {
"command": "uvx",
"args": ["mcp-server-mattermost"],
"env": {
"MATTERMOST_URL": "https://your-server.com",
"MATTERMOST_TOKEN": "your-token"
}
}
}
}
Full setup guide — Claude Desktop, Cursor, Claude Code, Opencode, Docker, pip
For client_token and oauth_proxy modes — including Mattermost OAuth App
registration, all MATTERMOST_OAUTH_* settings, and MCP client connection — see
Authentication.
docker run -i --rm \
-e MATTERMOST_URL=https://your-mattermost.com \
-e MATTERMOST_TOKEN=your-token \
legard/mcp-server-mattermost
{
"mcpServers": {
"mattermost": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MATTERMOST_URL=https://your-mattermost.com",
"-e", "MATTERMOST_TOKEN=your-token",
"legard/mcp-server-mattermost"
]
}
}
}
For networked HTTP use per-client auth. static_token over HTTP serves an unauthenticated endpoint acting
with the shared token (the server starts but logs a loud warning) — see
Authentication → HTTP transport.
docker run -d -p 8000:8000 \
-e MCP_TRANSPORT=http \
-e MCP_HOST=0.0.0.0 \
-e MATTERMOST_AUTH_MODE=client_token \
-e MATTERMOST_URL=https://your-mattermost.com \
-e MATTERMOST_HTTP_HOST_ORIGIN_PROTECTION=auto \
-e MATTERMOST_HTTP_ALLOWED_HOSTS=mcp.example.com \
legard/mcp-server-mattermost
client_token means each MCP client authenticates with its own Mattermost token, sent as
Authorization: Bearer <token> — a client configured without one gets 401. The two
MATTERMOST_HTTP_* variables turn on Host/Origin (DNS-rebinding) protection, which is off by
default; see HTTP transport security.
Health check: curl http://localhost:8000/health
Register a Mattermost OAuth 2.0 Application first:
Then run the MCP server:
docker run -d -p 8000:8000 \
-e MCP_TRANSPORT=http \
-e MCP_HOST=0.0.0.0 \
-e MATTERMOST_AUTH_MODE=oauth_proxy \
-e MATTERMOST_URL=https://mattermost.internal \
-e MATTERMOST_OAUTH_MATTERMOST_PUBLIC_URL=https://mattermost.example.com \
-e MATTERMOST_OAUTH_MCP_PUBLIC_URL=https://mcp.example.com \
-e MATTERMOST_OAUTH_CLIENT_ID=your-mattermost-oauth-app-id \
-e MATTERMOST_OAUTH_CLIENT_TYPE=confidential \
-e MATTERMOST_OAUTH_CLIENT_SECRET=your-mattermost-oauth-app-secret \
legard/mcp-server-mattermost
If your Mattermost login uses Keycloak SSO, users authenticate through Keycloak inside the Mattermost OAuth login flow. The MCP server does not need a Keycloak client.
Connect Claude Code with Dynamic Client Registration:
claude mcp add --transport http mattermost https://mcp.example.com/mcp
Do not pass --client-id for this server; the MCP client registers with the MCP server,
and the MCP server uses the fixed Mattermost OAuth App upstream.
# Clone and install
git clone https://github.com/cloud-ru-tech/mcp-server-mattermost
cd mcp-server-mattermost
uv sync --dev
# Run unit tests
uv run pytest
# Run integration tests (requires Docker or external Mattermost)
uv run pytest tests/integration -v
# Type checking
uv run mypy src/
# Linting
uv run ruff check src/ tests/
# Run locally
MATTERMOST_URL=https://... MATTERMOST_TOKEN=... uv run mcp-server-mattermost
Integration tests run against a real Mattermost server via Docker (Testcontainers) or external server.
# With Docker (Testcontainers) — automatic setup
uv run pytest tests/integration -v
# Against external Mattermost server
export MATTERMOST_URL=https://your-server.com
export MATTERMOST_TOKEN=your-bot-token
uv run pytest tests/integration -v
# Run specific test module
uv run pytest tests/integration/test_channels.py -v
Integration tests are excluded from the default pytest run. Unit tests run with:
uv run pytest # Unit tests only
Use the MCP Inspector to debug:
npx @modelcontextprotocol/inspector uvx mcp-server-mattermost
Contributions welcome! See CONTRIBUTING.md for guidelines.
MIT — see LICENSE for details.
Built with FastMCP · Mattermost API v4
MCP server for Mattermost — let Claude, Cursor, and other AI assistants work with channels, messages, and files
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
MCP Server Mattermost 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 MCP server for Mattermost — let Claude, Cursor, and other AI assistants work with channels, messages, and files