This Mattermost Model Context Protocol (MCP) server connects to Mattermost API endpoints to retrieve and process data, making it available via multiple transport modes. You can:
Fetch messages from specified or default Mattermost channels
Search messages within channels using customizable queries
Set maximum limits on the number of messages fetched per channel
Use multiple transport modes including stdio, SSE, and HTTP-stream
Establish secure connections via token-based authentication
Connects to Mattermost API endpoints to retrieve and process team and channel information, enabling real-time message monitoring and interaction with specific channels within Mattermost teams.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mattermost MCP Servershow me the latest messages from the dev channel"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-mattermost
This project implements a Model Context Protocol (MCP) server for Mattermost integration. It connects to Mattermost API endpoints to retrieve and process various information, making it available through standard MCP transports.
Features
Secure, token-based connection to Mattermost API endpoints
Supports multiple transport modes:
stdiohttp-streamsse
Search for messages across multiple Mattermost channels
Customizable default channels and message fetch limits
Related MCP server: MCP Boilerplate
Requirements
Node.js >= 22
npm >= 10
Setup
Clone this repository:
git clone https://github.com/kakehashi-inc/mcp-server-mattermost.git
cd mcp-server-mattermostInstall dependencies:
npm installSet up your environment variables:
Required Environment Variables
MATTERMOST_ENDPOINT: Your Mattermost server URLMATTERMOST_TOKEN: Your Mattermost authentication tokenMATTERMOST_TEAM: The name of the team to monitorMATTERMOST_CHANNELS: Comma-separated list of channel names to monitor
Environment Variable Setup Options
Option 1: Direct Environment Variables
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"Option 2: Using .env file (with 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 encryptBuild the server:
npm run buildUsage
The server supports three transport modes: stdio (default), sse, and http-stream.
Standard I/O Transport Mode
# 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 Transport Mode
# Using npm scripts (with dotenvx)
npm run start:sse
# Direct execution
node dist/main.js --transport sseHTTP Transport Mode
# Using npm scripts (with dotenvx)
npm run start:http
# Direct execution
node dist/main.js --transport http-streamClaude Desktop Integration
To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop settings:
Sample Configuration
{
"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"
]
}
}
}Development
npm run dev: Start the server in development mode with hot reloadnpm run lint: Run ESLintnpm run format: Format code using Prettiernpm test: Run testsnpm run inspect: Run MCP inspector
References
License
MIT