# Mattermost MCP

> Mattermost (Secure Team Collaboration) MCP gives your AI agent full control over mission-critical team communication. Use it to search across every channel, audit user roles, manage complex message threads, and ensure compliance by programmatically inspecting or modifying chat history.

## Overview
- **Category:** talk-to-me
- **Price:** Free
- **Tags:** team-messaging, channel-management, collaboration, compliance-auditing, workflow-automation, user-management

## Description

Need to keep tabs on what's happening in a highly regulated team environment? This MCP connects your Mattermost instance directly to your AI agent, letting you manage the whole communication lifecycle without ever clicking through the UI. You can send formatted messages that include specific user mentions, or use fuzzy search to track down hidden channels across your entire infrastructure. Beyond simple chat, you can enumerate every active member and check their roles for compliance audits. If a historical conversation is key, this MCP lets you retrieve exact message timelines from any channel. It's all managed through natural conversation via Vinkius—you just tell your agent what data points you need, and it pulls them directly into your workflow.

## Tools

### create_post
Sends a formatted message payload directly into any specified channel.

### delete_post
Removes an explicit text post from the Mattermost chat history.

### get_channel_details
Retrieves deep internal information about a specific chat channel.

### list_team_channels
Finds and extracts the list of public channels within an entire team structure.

### get_channel_posts
Gathers the full, precise timeline matrix of messages from a given channel.

### get_team_members
Lists all currently attached user accounts and their capabilities within a team.

### get_teams
Identifies the main global workspaces or parent teams in your Mattermost setup.

### get_all_users
Provides a full map of every active user and bot ID on the server, ensuring correct mention routing.

### search_channels
Scans the entire database to discover any hidden or public chat channel by name.

### update_post
Changes the content of an existing message while automatically preserving audit timestamps.

## Prompt Examples

**Prompt:** 
```
List all teams available in my Mattermost instance
```

**Response:** 
```
I've retrieved 2 teams: 'Engineering' (ID: team-123) and 'Security-Ops' (ID: team-456). Which one would you like to list the channels for?
```

**Prompt:** 
```
Search for a channel called 'product-alerts' in the Engineering team
```

**Response:** 
```
Searching… I've identified the channel '#product-alerts' (ID: chan-987). It is a public channel used for system notifications. Would you like me to fetch the last 10 posts from this channel?
```

**Prompt:** 
```
Send a post to channel 'chan-987': 'Backend migration complete. @alex please verify metrics.'
```

**Response:** 
```
Post sent successfully to #product-alerts. Your message including the mention for @alex has been dispatched. New Post ID: 'post-13579'. I can monitor for any replies if you'd like.
```

## Capabilities

### Find hidden channels
Scan the entire Mattermost workspace to locate public or private channels by name.

### Retrieve message history
Get a precise chronological list of all posts from a specific channel at any time.

### Manage team members and roles
List active users, verify their system roles, or get the necessary IDs to route mentions correctly.

### Send structured posts
Dispatch a formatted message into any channel, including specific user tags.

### Audit and modify messages
Update existing chat records or delete them entirely, all while retaining crucial audit timestamps for compliance.

## Use Cases

### Investigating a data leak
A security analyst needs to know if a sensitive client name was mentioned in a private chat from three weeks ago. They use the `search_channels` tool, pinpointing the correct team, and then call `get_channel_posts` to pull the exact messages needed for their report.

### Onboarding new global teams
An IT Ops engineer needs to build a system alert that notifies three different department leads. They use `get_all_users` to get every required user ID, then use the `create_post` tool to dispatch a message with all necessary mentions.

### Revising historical technical specs
An engineering lead realizes they need to correct a misstated metric from an old thread. They retrieve the original post using `get_channel_posts`, then use the `update_post` tool to fix the number while keeping the audit trail intact.

### Auditing team access rights
A compliance officer needs proof of who is authorized to communicate with a specific department. They call `get_team_members` to list everyone and verify their current user roles against company policy.

## Benefits

- Track down hidden discussions. Use the `search_channels` tool to find public or private channels by name, no matter how deep they are nested in your infrastructure.
- Maintain a clear record of events. The `get_channel_posts` tool retrieves exact message graphs, giving you full visibility into project status and historical conversations.
- Manage the team structure easily. You can use `get_teams` to list all global workspaces, which is necessary for routing complex organizational queries.
- Ensure compliance always. Use `update_post` to edit chat contents while guaranteeing that audit timestamps are visibly preserved in the record.
- Know exactly who you're talking to. The `get_all_users` tool maps every active human and bot ID, so mentions always route correctly without guessing usernames.

## How It Works

The bottom line is you manage secure team collaboration by directing your agent with conversational commands.

1. Subscribe to this MCP on Vinkius.
2. Provide your Mattermost Host URL and a personal access token.
3. Your AI agent manages the workspace, allowing you to query team data or send messages through natural conversation.

## Frequently Asked Questions

**How does Mattermost MCP handle compliance auditing?**
It maintains a robust audit trail even when messages are changed. The `update_post` tool allows you to edit content while automatically preserving the original audit timestamps, ensuring traceability.

**Can I find channels that aren't visible in my team?**
Yes. You can use the `search_channels` tool to aggressively scan the database for any hidden or public channel name across your entire Mattermost instance, regardless of visibility settings.

**Does Mattermost MCP let me delete posts completely?**
The `delete_post` tool allows you to remove explicit text posts from the chat. This action is irreversible and designed for programmatically clearing records when needed.

**How do I make sure mentions work correctly?**
You should use the `get_all_users` tool first. It provides a complete map of all active human and bot identities, guaranteeing your agent routes mentions accurately via their unique ID.

**What is the difference between get_teams and list_team_channels?**
Use `get_teams` to identify the global parent workspaces. Then, use `list_team_channels` on those teams to find all the specific public channels within them.