MCP Server for the Mattermost API, enabling Claude and other MCP clients to interact with Mattermost workspaces. The server supports multiple configuration methods with the following priority (highest to lowest): 1. CLI arguments (--url, --token, --team-id) 2. Environment variables (MATTERMOSTURL, MATTERMOSTTOKEN, MATTERMOSTTEAMID) 3. config.local.json (for local overrides, gitignored) 4. config.j
Add this skill
npx mdskills install conarti/mattermost-mcpComprehensive Mattermost integration with extensive tools, clear setup, and monitoring features
1# Mattermost MCP Server23MCP Server for the Mattermost API, enabling Claude and other MCP clients to interact with Mattermost workspaces.45## Quick Start67### Using npx (recommended)89```bash10npx @conarti/mattermost-mcp --help11```1213### Using environment variables1415```bash16MATTERMOST_URL=https://your-mattermost.com/api/v4 \17MATTERMOST_TOKEN=your-token \18MATTERMOST_TEAM_ID=your-team-id \19npx @conarti/mattermost-mcp20```2122### Using CLI arguments2324```bash25npx @conarti/mattermost-mcp \26 --url https://your-mattermost.com/api/v4 \27 --token your-token \28 --team-id your-team-id29```3031## Installation3233### Option 1: npx (no installation needed)3435```bash36npx @conarti/mattermost-mcp37```3839### Option 2: Global installation4041```bash42npm install -g @conarti/mattermost-mcp43mattermost-mcp --help44```4546### Option 3: Clone and build4748```bash49git clone https://github.com/conarti/mattermost-mcp.git50cd mattermost-mcp51npm install52npm run build53npm start54```5556## Configuration5758The server supports multiple configuration methods with the following priority (highest to lowest):59601. **CLI arguments** (`--url`, `--token`, `--team-id`)612. **Environment variables** (`MATTERMOST_URL`, `MATTERMOST_TOKEN`, `MATTERMOST_TEAM_ID`)623. **config.local.json** (for local overrides, gitignored)634. **config.json** (default configuration)6465### CLI Arguments6667| Argument | Description |68|----------|-------------|69| `--url <url>` | Mattermost API URL (e.g., https://mattermost.example.com/api/v4) |70| `--token <token>` | Mattermost personal access token |71| `--team-id <id>` | Mattermost team ID |72| `--run-monitoring` | Run topic monitoring immediately on startup |73| `--exit-after-monitoring` | Exit after running monitoring (use with --run-monitoring) |74| `--help` | Show help message |7576### Environment Variables7778| Variable | Description |79|----------|-------------|80| `MATTERMOST_URL` | Mattermost API URL |81| `MATTERMOST_TOKEN` | Mattermost personal access token |82| `MATTERMOST_TEAM_ID` | Mattermost team ID |8384### Configuration File8586Create `config.local.json` (gitignored) or use `config.json`:8788```json89{90 "mattermostUrl": "https://your-mattermost-instance.com/api/v4",91 "token": "your-personal-access-token",92 "teamId": "your-team-id",93 "monitoring": {94 "enabled": false,95 "schedule": "*/15 * * * *",96 "channels": ["town-square", "off-topic"],97 "topics": ["tv series", "champions league"],98 "messageLimit": 5099 }100}101```102103## Claude Code Integration104105Add to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json` or via `claude mcp add`):106107```json108{109 "mcpServers": {110 "mattermost": {111 "command": "npx",112 "args": ["-y", "@conarti/mattermost-mcp@latest"],113 "env": {114 "MATTERMOST_URL": "https://your-mattermost.com/api/v4",115 "MATTERMOST_TOKEN": "your-token",116 "MATTERMOST_TEAM_ID": "your-team-id"117 }118 }119 }120}121```122123Or using a config file:124125```json126{127 "mcpServers": {128 "mattermost": {129 "command": "node",130 "args": ["/path/to/mattermost-mcp/build/index.js"]131 }132 }133}134```135136## Features137138### Channel Tools139140| Tool | Description |141|------|-------------|142| `mattermost_list_channels` | List channels in the workspace (public, private, and DMs) |143| `mattermost_get_channel_history` | Get messages from a channel with filtering options |144145#### `mattermost_list_channels` Options146147- `limit` (default: 100): Maximum number of channels to return148- `page` (default: 0): Page number for pagination149- `include_private` (default: false): If true, returns all channels including private channels and direct messages (DMs)150151#### `mattermost_get_channel_history` Options152153- `channel_id` (required): The ID of the channel154- `limit`: Number of messages to retrieve. **If not specified or 0, returns ALL messages**155- `page` (default: 0): Page number for pagination (only used when limit > 0)156- `since_date`: ISO 8601 date to get messages after (e.g., "2025-01-15")157- `before_date`: ISO 8601 date to get messages before. Use with `since_date` for date ranges158- `before_post_id`: Get messages before this post ID (cursor pagination)159- `after_post_id`: Get messages after this post ID (cursor pagination)160161**Examples:**162163```javascript164// Get ALL messages from a channel165{ "channel_id": "abc123" }166167// Get last 50 messages168{ "channel_id": "abc123", "limit": 50 }169170// Get all messages from December 18, 2025171{ "channel_id": "abc123", "since_date": "2025-12-18", "before_date": "2025-12-19" }172173// Get messages from a specific date onwards174{ "channel_id": "abc123", "since_date": "2025-12-15" }175```176177### Message Tools178179| Tool | Description |180|------|-------------|181| `mattermost_post_message` | Post a new message to a channel |182| `mattermost_reply_to_thread` | Reply to a specific message thread |183| `mattermost_add_reaction` | Add an emoji reaction to a message |184| `mattermost_get_thread_replies` | Get all replies in a thread |185186### User Tools187188| Tool | Description |189|------|-------------|190| `mattermost_get_users` | Get a list of users in the workspace |191| `mattermost_get_user_profile` | Get detailed profile information for a user |192193### Monitoring Tools194195| Tool | Description |196|------|-------------|197| `mattermost_run_monitoring` | Trigger topic monitoring immediately |198199## Topic Monitoring200201The server includes a topic monitoring system that can:202- Monitor specified channels for messages containing topics of interest203- Run on a configurable schedule (using cron syntax)204- Send notifications when relevant topics are discussed205206### Configuration207208```json209{210 "monitoring": {211 "enabled": true,212 "schedule": "*/15 * * * *",213 "channels": ["general", "random"],214 "topics": ["important", "urgent"],215 "messageLimit": 50,216 "notificationChannelId": "optional-channel-id",217 "userId": "optional-user-id"218 }219}220```221222### Running Monitoring Manually223224```bash225# Run monitoring and continue server226mattermost-mcp --run-monitoring227228# Run monitoring and exit (useful for cron jobs)229mattermost-mcp --run-monitoring --exit-after-monitoring230```231232## Getting Your Credentials233234### Mattermost URL235Your Mattermost API URL is typically: `https://your-mattermost-domain.com/api/v4`236237### Personal Access Token2381. Go to **Account Settings** > **Security** > **Personal Access Tokens**2392. Click **Create Token**2403. Give it a description and create2414. Copy the token (it won't be shown again)242243### Team ID2441. Go to your team in Mattermost2452. Open browser developer tools (F12)2463. Go to **Network** tab2474. Refresh the page2485. Look for API calls containing `teams/` — the ID is in the URL249250Or use the Mattermost API:251```bash252curl -H "Authorization: Bearer YOUR_TOKEN" \253 https://your-mattermost.com/api/v4/teams254```255256## Troubleshooting257258### Missing Configuration Error259260```261Missing required configuration:262 - mattermostUrl (--url or MATTERMOST_URL)263 - token (--token or MATTERMOST_TOKEN)264 - teamId (--team-id or MATTERMOST_TEAM_ID)265```266267Make sure you've provided all required configuration via CLI arguments, environment variables, or config file.268269### Permission Errors270271Verify that:2721. Your personal access token has the necessary permissions2732. The token is correctly set2743. The Mattermost URL and team ID are correct275276## License277278MIT License279
Full transparency — inspect the skill content before installing.