MCP Server Mattermost 标志

MCP Server Mattermost

组织
cloud-ru-tech

MCP server for Mattermost — let Claude, Cursor, and other AI assistants work with channels, messages, and files

发布者cloud-ru-tech
代码仓库mcp-server-mattermost
语言Python
复刻数
11
星标数
48
可用工具
0
传输类型stdio, streamable-http
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    MCP Server Mattermost 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 48 个星标和 11 个复刻。

mcp-server-mattermost

Let AI assistants read, search, and post in your Mattermost workspace

39 tools · Channels · Messages · Reactions · Threads · Files · Users

MCP Server PyPI version Docker Pulls Tests Python 3.10+ License: MIT Docs

Features

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)

Example Queries

Once configured, you can ask your AI assistant:

  • "List all channels and find where the deployment discussion is happening"
  • "What did I miss in #engineering since yesterday morning?"
  • "Show me my unread channels and summarize the threads I was mentioned in"
  • "Send a build status alert to #engineering with a red attachment"
  • "Search for messages about the outage last week and summarize"
  • "Summarize this thread and post the key decisions"
  • "Find who worked on the authentication bug last week"
  • "Upload the report.pdf to #general and share the link"

Available Tools

ToolDescriptionKey Parameters
list_public_channelsList public channels in a teamteam_id ✓
list_my_channelsList your channels with unread countsteam_id ✓, only_unread
get_channelGet channel details by IDchannel_id ✓
get_channel_by_nameGet channel by nameteam_id, channel_name ✓
create_channelCreate a new channelteam_id, name, display_name ✓
join_channelJoin a public channelchannel_id ✓
leave_channelLeave a channelchannel_id ✓
mark_channel_viewedMark a channel as viewed (reset unread counters)channel_id ✓
get_channel_membersList channel memberschannel_id ✓
add_user_to_channelAdd user to channelchannel_id, user_id ✓
create_direct_channelCreate DM channeluser_id_1, user_id_2 ✓
ToolDescriptionKey Parameters
post_messageSend a message to a channelchannel_id, message ✓, attachments
get_channel_messagesGet messages: recent, unread window, or since timestampchannel_id ✓, unread_only, since
search_messagesSearch messages by termteam_id, terms ✓
update_messageEdit a messagepost_id, message ✓, attachments
delete_messageDelete a messagepost_id ✓
ToolDescriptionKey Parameters
add_reactionAdd emoji reactionpost_id, emoji_name ✓
remove_reactionRemove emoji reactionpost_id, emoji_name ✓
get_reactionsGet all reactions on a postpost_id ✓
pin_messagePin a messagepost_id ✓
unpin_messageUnpin a messagepost_id ✓
get_threadGet thread messagespost_id ✓
ToolDescriptionKey Parameters
get_meGet current user info—
get_userGet user by IDuser_id ✓
get_user_by_usernameGet user by usernameusername ✓
search_usersSearch usersterm ✓
get_user_statusGet online statususer_id ✓
ToolDescriptionKey Parameters
list_teamsList your teams—
get_teamGet team detailsteam_id ✓
get_team_membersList team membersteam_id ✓
ToolDescriptionKey Parameters
upload_fileUpload a filechannel_id, file_path ✓
get_file_infoGet file metadatafile_id ✓
get_file_linkGet download linkfile_id ✓
download_fileSave a file attachment locallyfile_id, destination_dir ✓

Note: Requires Entry, Professional, Enterprise, or Enterprise Advanced edition (not available in Team Edition). Minimum version: v10.1.

ToolDescriptionKey Parameters
list_bookmarksList channel bookmarkschannel_id ✓
create_bookmarkCreate link or file bookmarkchannel_id, display_name, bookmark_type ✓
update_bookmarkUpdate bookmark propertieschannel_id, bookmark_id ✓
delete_bookmarkDelete a bookmarkchannel_id, bookmark_id ✓
update_bookmark_sort_orderReorder bookmarkchannel_id, bookmark_id, new_sort_order ✓

Quick Start

  1. Get a Mattermost bot token
  2. Add to your MCP client config:
json
{
  "mcpServers": {
    "mattermost": {
      "command": "uvx",
      "args": ["mcp-server-mattermost"],
      "env": {
        "MATTERMOST_URL": "https://your-server.com",
        "MATTERMOST_TOKEN": "your-token"
      }
    }
  }
}
  1. Restart your client

Full setup guide — Claude Desktop, Cursor, Claude Code, Opencode, Docker, pip

Configuration

VariableRequiredDefaultDescription
MATTERMOST_URLYes—Mattermost server URL
MATTERMOST_AUTH_MODENostatic_tokenAuth mode: static_token, client_token, or oauth_proxy
MATTERMOST_TOKENConditional—Bot or personal token. Required for static_token.
MATTERMOST_TIMEOUTNo30Request timeout in seconds
MATTERMOST_MAX_RETRIESNo3Max retry attempts
MATTERMOST_VERIFY_SSLNotrueVerify SSL certificates
MATTERMOST_MAX_CONNECTIONSNo100Max HTTP connections in the shared pool
MATTERMOST_MAX_KEEPALIVE_CONNECTIONSNo20Max idle keepalive connections, clamped to max connections
MATTERMOST_KEEPALIVE_EXPIRYNo30.0Idle keepalive connection lifetime in seconds
MATTERMOST_EXTRA_CA_CERTSNo—Path to extra PEM CAs appended to the default trust store
MATTERMOST_LOG_LEVELNoINFOLogging level
MATTERMOST_LOG_FORMATNojsonLog output format: json or text
MATTERMOST_API_VERSIONNov4Mattermost API version

For client_token and oauth_proxy modes — including Mattermost OAuth App registration, all MATTERMOST_OAUTH_* settings, and MCP client connection — see Authentication.

Docker

Stdio mode (default)

bash
docker run -i --rm \
  -e MATTERMOST_URL=https://your-mattermost.com \
  -e MATTERMOST_TOKEN=your-token \
  legard/mcp-server-mattermost
json
{
  "mcpServers": {
    "mattermost": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MATTERMOST_URL=https://your-mattermost.com",
        "-e", "MATTERMOST_TOKEN=your-token",
        "legard/mcp-server-mattermost"
      ]
    }
  }
}

HTTP mode (production)

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.

bash
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

HTTP mode with Mattermost OAuth proxy

Register a Mattermost OAuth 2.0 Application first:

Mattermost fieldProduction value
Is TrustedYes
Is Public ClientNo
Callback URLshttps://mcp.example.com/oauth/callback/mm

Then run the MCP server:

bash
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:

bash
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.

Environment Variables (Docker)

VariableDefaultDescription
MCP_TRANSPORTstdioTransport: stdio or http
MCP_HOST127.0.0.1HTTP bind host (use 0.0.0.0 in Docker)
MCP_PORT8000HTTP port

Documentation

📖 mcp-server-mattermost.readthedocs.io

Development

bash
# 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

Integration tests run against a real Mattermost server via Docker (Testcontainers) or external server.

bash
# 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:

bash
uv run pytest  # Unit tests only

Debugging

Use the MCP Inspector to debug:

bash
npx @modelcontextprotocol/inspector uvx mcp-server-mattermost

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

License

MIT — see LICENSE for details.


Built with FastMCP · Mattermost API v4

安装

TypingMind
{
  "mcpServers": {
    "mcp-server-mattermost": {
      "command": "uvx",
      "args": [
        "mcp-server-mattermost"
      ]
    }
  }
}

将 MCP Server Mattermost MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP Server Mattermost 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 您可以在自己的设备上本地运行 MCP,也可以通过 URL 连接远程 MCP 服务器。

方式 1:使用本地连接器

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 MCP Server Mattermost 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP Server Mattermost MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcp-server-mattermost": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP Server Mattermost MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP Server Mattermost MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Server Mattermost 帮我完成这项任务吗?
MCP Server Mattermost
当然,我看过了。
以下是我使用 MCP Server Mattermost 得到的结果。

方式 2:添加 MCP 服务器 URL

如果 MCP Server Mattermost 已托管在远程服务器上,或您的团队希望让多个用户共用一个连接器,请选择此方式。

1

打开 MCP 连接器

在 TypingMind 中,前往“插件”,打开“MCP 连接器”,然后选择“添加 URL”。

  1. 在您的浏览器中打开 TypingMind。
  2. 进入“插件”。
  3. 打开“MCP 连接器”。
  4. 点击“添加 URL”。
TypingMind 的“添加自定义 MCP 服务器 URL”表单
2

粘贴服务器 URL

在“服务器 URL”字段中输入 提供商提供的 MCP 服务器 URL。根据服务器要求,添加连接名称、描述、图标、自定义 HTTP 请求头或 OAuth 客户端设置。

  1. 将 提供商提供的 MCP 服务器 URL 粘贴到“服务器 URL”字段中。
  2. 为 MCP Server Mattermost 输入连接名称。
  3. 您可以添加描述和图标,以便更容易识别此连接。
  4. 如果服务器需要身份验证,请添加自定义 HTTP 请求头或 OAuth 客户端信息。
3

创建连接

点击“创建连接”,然后返回插件列表,确认新的 MCP 连接处于可用状态。

  1. 点击“创建连接”。
  2. 返回 MCP 连接器列表。
  3. 确认列表中的 MCP Server Mattermost 连接显示为可用状态。
  4. 如果连接未立即出现,请刷新插件列表。
4

切换模型,无需重新连接

使用您偏好的模型开始聊天,在“插件”中启用 MCP Server Mattermost 工具,并根据需要随时切换到其他模型。该 MCP 连接在 TypingMind 工作区中仍然可用。

  1. 在 TypingMind 中开始新聊天。
  2. 选择您想使用的 AI 模型。
  3. 在“插件”中启用 MCP Server Mattermost 工具。
  4. 需要时,请让模型使用该工具。
  5. 切换到其他 AI 模型,继续使用同一个 MCP 连接。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Server Mattermost 帮我完成这项任务吗?
MCP Server Mattermost
当然,我看过了。
以下是我使用 MCP Server Mattermost 得到的结果。

常见问题

MCP Server Mattermost MCP 服务器有什么用途?

MCP Server Mattermost 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP Server Mattermost MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 MCP Server Mattermost。

为什么在 TypingMind 中使用 MCP Server Mattermost MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 MCP Server Mattermost 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP Server Mattermost MCP 连接到 TypingMind?

在 TypingMind 中,您可以使用本地 MCP 连接器或添加远程 MCP 服务器的 URL 来连接 MCP Server Mattermost。当服务器需要访问您设备上的文件、应用或私有资源时,请使用本地连接器;如果 MCP 服务器部署在远端,请使用服务器 URL。

MCP Server Mattermost MCP 在 TypingMind 中提供哪些工具?

MCP Server Mattermost 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP Server Mattermost MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 MCP Server Mattermost 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇