A Model Context Protocol (MCP) server that enables LLMs to interact with Mezon channels, allowing them to send and read messages through Mezon's API. Using this server, LLMs like Claude can directly interact with Mezon channels while maintaining user control and security.
- Send messages to Mezon channels
- Read recent messages from channels
- Automatic clan and channel discovery
- Support for both channel names and IDs
- Proper error handling and validation
- Node.js 16.x or higher
- A Mezon bot token
- The bot must be invited to your clan with proper permissions:
- Read Messages/View Channels
- Send Messages
- Read Message History
- Clone this repository:
git clone git@github.com:nccasia/mezon-mcp.git
cd mezon-mcp
- Install dependencies:
npm install
- Create a
.env
file in the root directory with your Mezon bot token:
MEZON_TOKEN=your_bot_token_here
- Build the server:
npm run build
-
Open your Claude for Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the Mezon MCP server configuration:
{
"mcpServers": {
"mezon": {
"command": "node",
"args": ["path/to/mezon-mcp/build/index.js"],
"env": {
"MEZON_TOKEN": "your_bot_token_here"
}
}
}
}
- Restart Claude for Desktop
Sends a message to a specified Mezon channel.
Parameters:
clan
(optional): Clan ID (required if bot is in multiple clans)channel
: Channel name (e.g., "general") or IDmessage
: Message content to send
Example:
{
"channel": "general",
"message": "Hello from MCP!"
}
Reads recent messages from a specified Mezon channel.
Parameters:
clan
(optional): clan ID (required if bot is in multiple clans)channel
: Channel name (e.g., "general") or IDlimit
(optional): Number of messages to fetch (default: 50, max: 100)
Example:
{
"channel": "general",
"limit": 10
}
- Install development dependencies:
npm install --save-dev typescript @types/node
- Start the server in development mode:
npm run dev
You can test the server using the MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.js
Here are some example interactions you can try with Claude after setting up the Mezon MCP server:
- "Can you read the last 5 messages from the general channel?"
- "Please send a message to the announcements channel saying 'Meeting starts in 10 minutes'"
- "What were the most recent messages in the development channel about the latest release?"
Claude will use the appropriate tools to interact with Mezon while asking for your approval before sending any messages.
- The bot requires proper Mezon permissions to function
- All message sending operations require explicit user approval
- Environment variables should be properly secured
- Token should never be committed to version control
- Channel access is limited to channels the bot has been given access to
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the GitHub Issues section
- Consult the MCP documentation at https://modelcontextprotocol.io
- Open a new issue with detailed reproduction steps