mcp服务器mattermost
该项目为Mattermost集成实现了一个模型上下文协议(MCP)服务器。它连接到Mattermostneneneba API端点以检索和处理各种信息,使其可以通过标准MCP传输使用。
特性
- 与Mattermostneneneba API端点的基于令牌的安全连接
- 支持多种运输方式:
- stdio - http-stream - sse
- 在多个Mattermost频道中搜索消息
- 可自定义的默认频道和消息获取限制
需求
- Node.js>=22
- npm>=10
设置
- 克隆此存储库:
git clone https://github.com/kakehashi-inc/mcp-server-mattermost.git
cd mcp-server-mattermost- 安装依赖项:
npm install- 设置环境变量:
所需的环境变量
MATTERMOST_ENDPOINT:您的Mattermost服务器URLMATTERMOST_TOKEN:您的Mattermost身份验证令牌MATTERMOST_TEAM:要监控的团队名称MATTERMOST_CHANNELS:要监视的以逗号分隔的频道名称列表
环境变量设置选项
选项1:直接环境变量
export MATTERMOST_ENDPOINT="https://your-mattermost-server.com"
export MATTERMOST_TOKEN="your-token-here"
export MATTERMOST_TEAM="your-team-name"
export MATTERMOST_CHANNELS="general,random,dev"选项2:使用.env文件(与dotenvx一起)
# Install dotenvx (optional)
npm install -g @dotenvx/dotenvx
# Create .env file
cp .env.example .env
# Edit .env file with your values
# Encrypt your .env file (recommended for production)
dotenvx encrypt- 构建服务器:
npm run build用法
服务器支持三种传输模式:stdio(默认)、sse和http流。
标准I/O传输模式
# Using npm scripts (with dotenvx)
npm run start:stdio
# Direct execution
node dist/main.js --transport stdio
# Using npx
npx mcp-server-mattermost --transport stdioSSE运输方式
# Using npm scripts (with dotenvx)
npm run start:sse
# Direct execution
node dist/main.js --transport sseHTTP传输模式
# Using npm scripts (with dotenvx)
npm run start:http
# Direct execution
node dist/main.js --transport http-streamClaude桌面集成
要将此MCP服务器与Claude Desktop一起使用,请将以下配置添加到您的Claude Desktop设置中:
示例配置
{
"mcpServers": {
"mattermost": {
"command": "npx",
"args": [
"-y",
"mcp-server-mattermost@latest",
"--transport", "stdio",
"--endpoint", "https://your-mattermost-server/api/v4",
"--token", "your_personal_access_token",
"--team", "your_team_name",
"--channels", "town-square,general,your_channel_name"
]
}
}
}发展
npm run dev:以热重新加载的开发模式启动服务器npm run lint:运行ESLintnpm run format:使用Prettier格式化代码npm test:运行测试npm run inspect:运行MCP检查器
参考文献
许可证
麻省理工学院
