Back to MCP directory
publicPublicdnsLocal runtime

mattermost-mcp

Mattermost MCP服务器是一个连接Claude等MCP客户端与Mattermost工作区的API服务,提供频道监控、消息管理和用户查询等功能。

article

README

🚀 Mattermost 机器人控制器协议(MCP)服务器

Mattermost 机器人控制器协议(MCP)服务器为 Mattermost 系统提供了强大的机器人控制功能,可帮助用户更高效地管理和监控 Mattermost 平台,提升工作效率和管理便捷性。

🚀 快速开始

若你想快速搭建并使用 Mattermost 机器人控制器协议(MCP)服务器,可按照以下步骤操作。

📦 安装指南

安装步骤

  1. 下载代码仓库
    git clone https://github.com/mattermost/mattermost-mcp.git
    cd mattermost-mcp
    
  2. 安装依赖项
    npm install
    
  3. 构建项目
    npm run build
    

配置说明

创建一个 config.json 文件,内容如下:

{
  "mattermostUrl": "https://your-mattermost-instance.com",
  "teamId": "your-team-id",
  "port": 3456,
  "webRoot": "/path/to/webroot"
}

💻 使用示例

基础用法

启动服务器

在项目根目录运行:

node build/index.js

配置示例

示例1:基本配置

将以下内容添加到 config.json

{
  "mattermostUrl": "https://my-mattermost-server.com",
  "teamId": "T1234567890"
}
示例2:完整配置
{
  "mattermostUrl": "https://my-mattermost-server.com",
  "teamId": "T1234567890",
  "port": 3456,
  "webRoot": "/var/www/mattermost-web"
}

高级用法

使用Claude Desktop

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "mattermost": {
      "command": "node",
      "args": [
        "/path/to/mattermost-mcp/build/index.js"
      ]
    }
  }
}

📚 详细文档

故障排除

常见问题

  1. 权限错误
    • 确认个人访问令牌有正确的权限。
    • 确保令牌正确配置在 config.json 中。
    • 验证Mattermost URL和团队ID是否准确。
  2. 网络问题
    • 检查网络连接,确保可以访问Mattermost服务器。
    • 查看浏览器开发者工具中的控制台错误信息。

HTTP端点

执行监控

通过以下URL触发监控流程:

curl http://localhost:3456/run-monitoring

查询状态

获取服务器和监控状态信息:

curl http://localhost:3456/status

工具脚本

run-monitoring-http.sh

使用此脚本通过HTTP端点触发监控:

./run-monitoring-http.sh

特点:

  • 不会重启服务器。
  • 与计划任务无冲突。
  • 支持从任何终端运行。

查看频道消息

显示指定频道的最新消息:

node view-channel-messages.js <channel-name>
node view-channel-messages.js <channel-name> <message-count>

示例:

node view-channel-messages.js general 10

分析频道消息

提供频道消息的详细统计信息:

node analyze-channel.js <channel-name>
node analyze-channel.js <channel-name> <message-count>

示例:

node analyze-channel.js announcements

获取帮助

显示可用命令和用法说明:

node utils/help.js

📄 许可证

本项目遵循MIT许可证

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client