Get the FREE Ultimate OpenClaw Setup Guide →

mattermost -host

A Mattermost integration that connects to Model Context Protocol (MCP) servers, leveraging a LangGraph-based Agent.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jagan-shanmugam-mattermost-mcp-host uvx mattermost-mcp-host \
  --env COMMAND_PREFIX="#" \
  --env MATTERMOST_URL="https://your-mattermost-url" \
  --env TAVILY_API_KEY="optional-key-if-needed" \
  --env DEFAULT_PROVIDER="azure" \
  --env MATTERMOST_TOKEN="your-bot-token" \
  --env AZURE_OPENAI_API_KEY="your-azure-api-key" \
  --env MATTERMOST_TEAM_NAME="your-team-name" \
  --env AZURE_OPENAI_ENDPOINT="your-azure-endpoint" \
  --env AZURE_OPENAI_DEPLOYMENT="your-deployment-name" \
  --env MATTERMOST_CHANNEL_NAME="your-channel-name"

How to use

This MCP server enables a Mattermost integration that connects to multiple MCP servers and exposes their tools to an AI agent powered by LangGraph. The agent can understand user requests in natural language, orchestrate tool usage across connected MCP servers, and maintain context within Mattermost threads. Users can invoke direct commands with the configured prefix to list servers, view available tools, or call a specific tool on a chosen MCP server. Tools are automatically discovered from connected MCP servers and converted into LangChain-compatible tools for seamless agent execution. You can also issue direct prompts to the agent to leverage these tools in a coherent, thread-aware conversation.

How to install

{"Prerequisites","- Python 3.13.1+","- uv package manager","- Mattermost server and bot account with API token","- Access to an LLM API (Azure OpenAI by default)","","1) Clone the repository","bash","git clone <repository-url>","cd mattermost-mcp-host","","","2) Install uv and set up the environment","bash","# Install uv if you don't have it yet","# curl -LsSf https://astral.sh/uv/install.sh | sh","","# Activate a virtual environment","source .venv/bin/activate","","# Install the package with uv","uv sync","","# To install dev dependencies","uv sync --dev --all-extras","","","3) Configure environment variables","bash","Copy the example env and fill in values, or create a .env in the project root:","","MATTERMOST_URL=\"https://your-mattermost-url\"","MATTERMOST_TOKEN=\"your-bot-token\"","MATTERMOST_TEAM_NAME=\"your-team-name\"","MATTERMOST_CHANNEL_NAME=\"your-channel-name\"","DEFAULT_PROVIDER=\"azure\"","AZURE_OPENAI_ENDPOINT=\"your-azure-endpoint\"","AZURE_OPENAI_API_KEY=\"your-azure-api-key\"","AZURE_OPENAI_DEPLOYMENT=\"your-deployment-name\"","COMMAND_PREFIX=\"#\"","TAVILY_API_KEY=\"optional\"","","","4) Configure MCP servers","Edit src/mattermost_mcp_host/mcp-servers.json to define MCP servers you want to connect to. See mcp-servers-example.json for the schema.","","5) Start the integration","bash","mattermost-mcp-host",""}

Additional notes

{"The package uses uv to install and run the MCP-host wrapper. If you prefer Docker, you can adapt the command to run in a container.","If you see connectivity issues, verify Mattermost bot permissions, channel names, and that MCP servers are reachable.","Enable logging for MCP connections to diagnose tool discovery problems, and ensure required environment variables are defined (LLM provider, API keys, and MCP server endpoints).","When using the direct command interface, you can list servers with #servers, list tools with #<server> tools, and call tools with #<server> call <tool> <json-args>."}

Related MCP Servers

Sponsor this space

Reach thousands of developers