Mattermost Team Collaboration MCP Server and Agent for Agentic AI!
Project description
Mattermost MCP
Mattermost enterprise messaging collaboration server. Built with the highest architectural standards, incorporating dynamic facades, custom API routing, and FastMCP tool decoration.
Table of Contents
- Overview
- Features
- Installation
- Usage
- Configuration
- MCP Tools
- Architecture
- Deployment
- Contributing
- License
Overview
Mattermost MCP provides a high-performance, model-optimized interface to Mattermost capabilities. It isolates the model from underlying API transport complexity, ensuring safe, idempotent, and highly traceable system interactions.
Features
- Dynamic Facade Orchestration: Integrates multi-inheritance clients cleanly under a single facade.
- Battle-Tested Resilience: Out-of-the-box credential authentication, connection polling, and request retry strategies.
- FastMCP Declarative Tools: Fast, native schema registration with full inline validation.
- Complete Test Intent Diversity: Deep, automated unit, integration, and mock tests ensuring high code coverage.
⚙️ Dynamic Tool Selection & Visibility
This MCP server supports dynamic toolset selection and visibility filtering at runtime. This allows you to restrict the set of exposed tools in order to prevent blowing up the LLM's context window.
You can configure tool filtering via multiple input channels:
- CLI Arguments: Pass
--toolsor--toolsets(or their disabled counterparts--disabled-toolsand--disabled-toolsets) during startup. - Environment Variables: Define standard environment variables:
MCP_ENABLED_TOOLS/MCP_DISABLED_TOOLSMCP_ENABLED_TAGS/MCP_DISABLED_TAGS
- HTTP SSE Request Headers: Pass custom headers during transport initialization:
x-mcp-enabled-tools/x-mcp-disabled-toolsx-mcp-enabled-tags/x-mcp-disabled-tags
- HTTP SSE Request Query Parameters: Append query parameters directly to your transport connection URL:
?tools=tool1,tool2?tags=tag1
When query strings or parameters are supplied, an LLM-free Knowledge Graph resolution layer (using DynamicToolOrchestrator) matches query intents against known tool tags, names, or descriptions, with safe fallback and automated 24-hour background cache refreshing.
Installation
Install in editable mode directly inside your active workspace:
pip install -e .[all]
Or via the uv tool:
uv pip install -e .
Usage
You can launch the FastMCP server in stdio mode via Python module execution:
import asyncio
from mattermost_mcp.mcp_server import get_mcp_instance
async def main():
mcp = get_mcp_instance()
# Execute stdio loop or launch server
print("MCP Server ready.")
if __name__ == "__main__":
asyncio.run(main())
For direct shell launch, execute:
python -m mattermost_mcp.mcp_server
Configuration
The package is fully configurable via the environment variables listed below:
| Variable | Description | Default | Required |
|---|---|---|---|
MATTERMOST_URL |
Mattermost Server API v4 endpoint URL | http://localhost:8065 |
Yes |
MATTERMOST_TOKEN |
Personal Access Token or Bot Token | mattermost_api_access_token |
Yes |
A local template is supplied inside .env.example. Copy this file as .env and fill out your specific service endpoint parameters before starting execution.
MCP Tools
The following declarative FastMCP tools are registered and available to upstream AI agents:
| Tool Name | Description | Parameters |
|---|---|---|
get_me |
Get information about the connected bot user | None |
get_teams |
List teams that the connected bot is a member of | None |
get_channels |
List channels in a team | team_id: str |
create_post |
Create a new post/message in a channel | channel_id: str, message: str, root_id: str = None |
See docs/overview.md or docs/concepts.md for deeper operational examples.
Architecture
This package uses the standardized Agent-Utilities dynamic facade architecture:
graph TD
User([User Agent]) --> Server[FastMCP Server]
Server --> Facade[Api Dynamic Facade]
Facade --> ClientBase[ApiClientBase]
Facade --> Auth[Credentials Auth Handler]
ClientBase --> Service([External Service API])
Deployment
Bare-Metal (Standard pip)
- Set up your Python virtual environment (>= 3.10).
- Install the package:
pip install .[all] - Export credentials:
export MATTERMOST_URL="http://localhost:8065"
- Run:
python -m mattermost_mcp.mcp_server
Container (Docker Compose)
A standard compose structure is provided inside the docker/ folder. Build and deploy:
docker compose -f docker/compose.yml up --build -d
Contributing
Please audit all code changes against ecosystem guidelines in CONTRIBUTING.md if available, and run:
pre-commit run --all-files
License
This project is licensed under the MIT License. See the LICENSE file for complete details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mattermost_mcp-0.20.0.tar.gz.
File metadata
- Download URL: mattermost_mcp-0.20.0.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
793b7918d670f8331188ef350e98405a378110a6f4febb703c3f8f8f356d8dea
|
|
| MD5 |
645850c87ed813f4b6b6272d9d22400c
|
|
| BLAKE2b-256 |
9dae0f1446126339ade269da98bb6943b375fe584cd944f3011b2eba24497d4b
|
File details
Details for the file mattermost_mcp-0.20.0-py3-none-any.whl.
File metadata
- Download URL: mattermost_mcp-0.20.0-py3-none-any.whl
- Upload date:
- Size: 109.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6b87cda29b393d23c39288404b0471bccde058b6744569884489e6c25e2960a
|
|
| MD5 |
29a0c5e303f789306a48cd183a158de1
|
|
| BLAKE2b-256 |
30b612816eaddcbcb6966873d7bbf1507520ceef40a5af519c495dd0038527e3
|