Mattermost MCP Server
Provides tools for interacting with Mattermost workspaces, including channel management, posting messages, replying to threads, adding reactions, retrieving channel history and thread replies, user management, and topic monitoring.
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 ServerGet the latest 20 messages from the town-square 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.
Mattermost MCP Server
MCP Server for the Mattermost API, enabling Claude and other MCP clients to interact with Mattermost workspaces.
Quick Start
Using npx (recommended)
npx @conarti/mattermost-mcp --helpUsing environment variables
MATTERMOST_URL=https://your-mattermost.com/api/v4 \
MATTERMOST_TOKEN=your-token \
MATTERMOST_TEAM_ID=your-team-id \
npx @conarti/mattermost-mcpUsing CLI arguments
npx @conarti/mattermost-mcp \
--url https://your-mattermost.com/api/v4 \
--token your-token \
--team-id your-team-idInstallation
Option 1: npx (no installation needed)
npx @conarti/mattermost-mcpOption 2: Global installation
npm install -g @conarti/mattermost-mcp
mattermost-mcp --helpOption 3: Clone and build
git clone https://github.com/conarti/mattermost-mcp.git
cd mattermost-mcp
npm install
npm run build
npm startConfiguration
The server supports multiple configuration methods with the following priority (highest to lowest):
CLI arguments (
--url,--token,--team-id)Environment variables (
MATTERMOST_URL,MATTERMOST_TOKEN,MATTERMOST_TEAM_ID)config.local.json (for local overrides, gitignored)
config.json (default configuration)
CLI Arguments
Argument | Description |
| Mattermost API URL (e.g., https://mattermost.example.com/api/v4) |
| Mattermost personal access token |
| Mattermost team ID |
| Run topic monitoring immediately on startup |
| Exit after running monitoring (use with --run-monitoring) |
| Show help message |
Environment Variables
Variable | Description |
| Mattermost API URL |
| Mattermost personal access token |
| Mattermost team ID |
Configuration File
Create config.local.json (gitignored) or use config.json:
{
"mattermostUrl": "https://your-mattermost-instance.com/api/v4",
"token": "your-personal-access-token",
"teamId": "your-team-id",
"monitoring": {
"enabled": false,
"schedule": "*/15 * * * *",
"channels": ["town-square", "off-topic"],
"topics": ["tv series", "champions league"],
"messageLimit": 50
}
}Claude Code Integration
Add to your Claude Code MCP settings (~/.claude/claude_desktop_config.json or via claude mcp add):
{
"mcpServers": {
"mattermost": {
"command": "npx",
"args": ["-y", "@conarti/mattermost-mcp@latest"],
"env": {
"MATTERMOST_URL": "https://your-mattermost.com/api/v4",
"MATTERMOST_TOKEN": "your-token",
"MATTERMOST_TEAM_ID": "your-team-id"
}
}
}
}Or using a config file:
{
"mcpServers": {
"mattermost": {
"command": "node",
"args": ["/path/to/mattermost-mcp/build/index.js"]
}
}
}Features
Channel Tools
Tool | Description |
| List channels in the workspace (public, private, and DMs) |
| Get messages from a channel with filtering options |
mattermost_list_channels Options
limit(default: 100): Maximum number of channels to returnpage(default: 0): Page number for paginationinclude_private(default: false): If true, returns all channels including private channels and direct messages (DMs)
mattermost_get_channel_history Options
channel_id(required): The ID of the channellimit: Number of messages to retrieve. If not specified or 0, returns ALL messagespage(default: 0): Page number for pagination (only used when limit > 0)since_date: ISO 8601 date to get messages after (e.g., "2025-01-15")before_date: ISO 8601 date to get messages before. Use withsince_datefor date rangesbefore_post_id: Get messages before this post ID (cursor pagination)after_post_id: Get messages after this post ID (cursor pagination)
Examples:
// Get ALL messages from a channel
{ "channel_id": "abc123" }
// Get last 50 messages
{ "channel_id": "abc123", "limit": 50 }
// Get all messages from December 18, 2025
{ "channel_id": "abc123", "since_date": "2025-12-18", "before_date": "2025-12-19" }
// Get messages from a specific date onwards
{ "channel_id": "abc123", "since_date": "2025-12-15" }Message Tools
Tool | Description |
| Post a new message to a channel |
| Reply to a specific message thread |
| Add an emoji reaction to a message |
| Get all replies in a thread |
User Tools
Tool | Description |
| Get a list of users in the workspace |
| Get detailed profile information for a user |
Monitoring Tools
Tool | Description |
| Trigger topic monitoring immediately |
Topic Monitoring
The server includes a topic monitoring system that can:
Monitor specified channels for messages containing topics of interest
Run on a configurable schedule (using cron syntax)
Send notifications when relevant topics are discussed
Configuration
{
"monitoring": {
"enabled": true,
"schedule": "*/15 * * * *",
"channels": ["general", "random"],
"topics": ["important", "urgent"],
"messageLimit": 50,
"notificationChannelId": "optional-channel-id",
"userId": "optional-user-id"
}
}Running Monitoring Manually
# Run monitoring and continue server
mattermost-mcp --run-monitoring
# Run monitoring and exit (useful for cron jobs)
mattermost-mcp --run-monitoring --exit-after-monitoringGetting Your Credentials
Mattermost URL
Your Mattermost API URL is typically: https://your-mattermost-domain.com/api/v4
Personal Access Token
Go to Account Settings > Security > Personal Access Tokens
Click Create Token
Give it a description and create
Copy the token (it won't be shown again)
Team ID
Go to your team in Mattermost
Open browser developer tools (F12)
Go to Network tab
Refresh the page
Look for API calls containing
teams/— the ID is in the URL
Or use the Mattermost API:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-mattermost.com/api/v4/teamsTroubleshooting
Missing Configuration Error
Missing required configuration:
- mattermostUrl (--url or MATTERMOST_URL)
- token (--token or MATTERMOST_TOKEN)
- teamId (--team-id or MATTERMOST_TEAM_ID)Make sure you've provided all required configuration via CLI arguments, environment variables, or config file.
Permission Errors
Verify that:
Your personal access token has the necessary permissions
The token is correctly set
The Mattermost URL and team ID are correct
License
MIT License
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/conarti/mattermost-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server