Sponsored by Deepsite.site

Mattermost Mcp

Created By
conarti13 hours ago
MCP Server for Mattermost API. Enables Claude and other MCP clients to interact with Mattermost workspaces - list channels, read/post messages, manage threads, reactions, and monitor topics. Supports flexible configuration via CLI args, environment variables, or config files.
Content

Mattermost MCP Server

MCP Server for the Mattermost API, enabling Claude and other MCP clients to interact with Mattermost workspaces.

Quick Start

npx @conarti/mattermost-mcp --help

Using environment variables

MATTERMOST_URL=https://your-mattermost.com/api/v4 \
MATTERMOST_TOKEN=your-token \
MATTERMOST_TEAM_ID=your-team-id \
npx @conarti/mattermost-mcp

Using CLI arguments

npx @conarti/mattermost-mcp \
  --url https://your-mattermost.com/api/v4 \
  --token your-token \
  --team-id your-team-id

Installation

Option 1: npx (no installation needed)

npx @conarti/mattermost-mcp

Option 2: Global installation

npm install -g @conarti/mattermost-mcp
mattermost-mcp --help

Option 3: Clone and build

git clone https://github.com/conarti/mattermost-mcp.git
cd mattermost-mcp
npm install
npm run build
npm start

Configuration

The server supports multiple configuration methods with the following priority (highest to lowest):

  1. CLI arguments (--url, --token, --team-id)
  2. Environment variables (MATTERMOST_URL, MATTERMOST_TOKEN, MATTERMOST_TEAM_ID)
  3. config.local.json (for local overrides, gitignored)
  4. config.json (default configuration)

CLI Arguments

ArgumentDescription
--url <url>Mattermost API URL (e.g., https://mattermost.example.com/api/v4)
--token <token>Mattermost personal access token
--team-id <id>Mattermost team ID
--run-monitoringRun topic monitoring immediately on startup
--exit-after-monitoringExit after running monitoring (use with --run-monitoring)
--helpShow help message

Environment Variables

VariableDescription
MATTERMOST_URLMattermost API URL
MATTERMOST_TOKENMattermost personal access token
MATTERMOST_TEAM_IDMattermost 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"],
      "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

ToolDescription
mattermost_list_channelsList public channels in the workspace
mattermost_get_channel_historyGet messages from a channel with filtering options

mattermost_get_channel_history Options

  • channel_id (required): The ID of the channel
  • limit (default: 30): Number of messages to retrieve
  • page (default: 0): Page number for pagination
  • since_date: ISO 8601 date to get messages after (e.g., "2025-01-15" or "2025-01-15T10:00:00Z")
  • before_post_id: Get messages before this post ID (cursor pagination)
  • after_post_id: Get messages after this post ID (cursor pagination)
  • get_all (default: false): Fetch all messages automatically (ignores limit/page)

Message Tools

ToolDescription
mattermost_post_messagePost a new message to a channel
mattermost_reply_to_threadReply to a specific message thread
mattermost_add_reactionAdd an emoji reaction to a message
mattermost_get_thread_repliesGet all replies in a thread

User Tools

ToolDescription
mattermost_get_usersGet a list of users in the workspace
mattermost_get_user_profileGet detailed profile information for a user

Monitoring Tools

ToolDescription
mattermost_run_monitoringTrigger 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-monitoring

Getting Your Credentials

Mattermost URL

Your Mattermost API URL is typically: https://your-mattermost-domain.com/api/v4

Personal Access Token

  1. Go to Account Settings > Security > Personal Access Tokens
  2. Click Create Token
  3. Give it a description and create
  4. Copy the token (it won't be shown again)

Team ID

  1. Go to your team in Mattermost
  2. Open browser developer tools (F12)
  3. Go to Network tab
  4. Refresh the page
  5. 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/teams

Troubleshooting

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:

  1. Your personal access token has the necessary permissions
  2. The token is correctly set
  3. The Mattermost URL and team ID are correct

License

MIT License

Server Config

{
  "mcpServers": {
    "mattermost": {
      "command": "npx",
      "args": [
        "-y",
        "@conarti/mattermost-mcp"
      ],
      "env": {
        "MATTERMOST_URL": "https://your-mattermost.com/api/v4",
        "MATTERMOST_TOKEN": "your-token",
        "MATTERMOST_TEAM_ID": "your-team-id"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Tavily Mcp
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors