Skip to main content
Glama
mcp-max-messenger

mcp-max-messenger

by woyaxnini

mcp-max-messenger

npm version License: MIT + Commons Clause

The first MCP server for MAX Messenger β€” Russia's national messenger by VK (75M+ users).

Connect AI clients (Claude Desktop, Cursor, n8n, and any MCP-compatible app) to MAX: send and read messages, manage chats and members, send media, handle button presses, format with HTML/Markdown β€” all through the open Model Context Protocol standard.

21 tools with full coverage of MAX Bot API.


Why MAX?

  • πŸ‡·πŸ‡Ί National messenger mandated for pre-installation on all smartphones in Russia (September 2025)

  • πŸ“± 75M+ registered users

  • 🏒 Recommended by the Ministry of Digital Development for government agencies and large enterprises

  • πŸ€– Full Bot API with official SDKs: TypeScript, Python, Go, Java, PHP


Related MCP server: time-messenger-mcp-server

Quick Start

Prerequisites

  • Node.js 18+

  • A MAX bot token (create a bot at max.ru)

Claude Desktop / Cursor (stdio mode)

Add to your Claude Desktop config:

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "max-messenger": {
      "command": "npx",
      "args": ["-y", "@woyax/mcp-max-messenger"],
      "env": {
        "MAX_TOKEN": "YOUR_BOT_TOKEN"
      }
    }
  }
}

Restart Claude Desktop. The MAX tools will appear automatically.

Remote / Hosted mode (HTTP)

MAX_TOKEN=YOUR_BOT_TOKEN MCP_TRANSPORT=http MCP_PORT=3000 npx @woyax/mcp-max-messenger

Connect any MCP client to http://your-server:3000/mcp.


Available Tools (21)

Messages

Tool

Description

get_messages

Read messages from a chat (by chat_id or message_ids)

send_message

Send a message with text, HTML/Markdown, inline keyboard, media attachments

edit_message

Edit message text and attachments

delete_message

Delete a message

pin_message

Pin a message in a chat

unpin_message

Unpin the currently pinned message

Media

Tool

Description

send_media

Upload and send photo, video, audio, or file by URL

send_action

Show typing indicator, "sending photo/video/audio/file", mark as read

Chats

Tool

Description

get_bot_info

Bot info: name, ID, username, description

get_chats

List all group chats the bot participates in

get_chat

Full chat details: participants, pinned message, owner

edit_chat

Rename chat, change description or icon

Members

Tool

Description

get_chat_members

List chat members with roles

get_admins

List chat administrators with permissions

set_admin

Grant admin rights to a member

remove_admin

Revoke admin rights

add_members

Add users to a group chat

remove_member

Remove a user from a group chat

Events

Tool

Description

get_updates

Incoming events: messages, button presses, new dialogs (long polling)

answer_callback

Respond to inline button press: show notification or update message

Buttons (via send_message attachments)

5 button types supported: callback, link, message, request_contact, request_geo_location.


Usage Examples

Once connected to Claude Desktop, use natural language:

"Send a message to chat 123456789: 'The meeting starts in 10 minutes'"

"Send an approval request with Approve/Reject buttons to the team chat"

"Show me the last 10 messages from the announcements chat"

"Send this photo to the chat: https://example.com/image.jpg"

"Who are the members of the sales group? Make Alex an admin."

"Check for new incoming messages and button presses"


Configuration

Environment Variables

Variable

Required

Default

Description

MAX_TOKEN

βœ…

β€”

Your MAX bot token

MCP_TRANSPORT

❌

stdio

Transport: stdio or http

MCP_PORT

❌

3000

Port for HTTP mode

Command-line Flags

# Local stdio mode (default)
npx @woyax/mcp-max-messenger

# Remote HTTP mode
npx @woyax/mcp-max-messenger --transport http --port 3000

Architecture

Two independent layers β€” tools work identically in both modes:

src/
β”œβ”€β”€ core/               # Business logic β€” shared between modes
β”‚   β”œβ”€β”€ max-client.ts   # MAX API HTTP client
β”‚   β”œβ”€β”€ types.ts        # TypeScript types for MAX API
β”‚   └── tools/
β”‚       β”œβ”€β”€ bot.ts      # get_bot_info
β”‚       β”œβ”€β”€ chats.ts    # get_chats, get_chat, edit_chat, send_action
β”‚       β”œβ”€β”€ messages.ts # send/get/edit/delete/pin/unpin, send_media
β”‚       β”œβ”€β”€ members.ts  # get_chat_members, get_admins, set/remove_admin, add/remove_members
β”‚       └── updates.ts  # get_updates, answer_callback
β”œβ”€β”€ transports/         # Transport layer β€” selected at runtime
β”‚   β”œβ”€β”€ stdio.ts        # Local mode (Claude Desktop, Cursor)
β”‚   └── http.ts         # Remote mode (Streamable HTTP)
└── index.ts            # Entry point: transport selection

MAX API Notes

  • Authorization: Token passed as Authorization: <token> β€” no Bearer prefix

  • Base URL: https://platform-api.max.ru

  • Rate limit: 30 requests/second

  • Group chats: GET /chats returns group chats only

  • Personal dialogs: Accessible via get_updates β€” use the returned chat_id with all standard tools

  • Media upload: Two-step process (upload β†’ send). Audio/video tokens come from the upload step, not the file transfer

  • HTTP transport: Uses Streamable HTTP (SSE deprecated since MCP SDK 1.10.0)

Known MAX API Issues

  • remove_admin may return success: true without actually revoking rights β€” confirmed bug on MAX side

  • open_app button type returns "Field 'webApp' cannot be null" β€” MAX API bug

  • add_members may fail with add.participant.privacy if the user has privacy mode enabled


Roadmap

  • HTTP mode testing on VPS with n8n integration

  • Hosted MCP service (connect by URL, no local install)

  • Webhook support for real-time event handling

  • answer_callback testing via n8n webhook workflow



Author & Support

Built by Oleg Alekseev β€” ERP/AI integration architect.

Need help integrating AI agents with your ERP, CRM, or MAX? Custom MCP servers, n8n workflows, AI automation β€” contact me.


License

MIT + Commons Clause Β© Oleg Alekseev

Free to use for personal and corporate purposes. Selling as a hosted service requires author's permission. See LICENSE for details.

Available Tools

21 tools
add_membersAdd MembersC

Add one or more users to a group chat. The bot must be an admin of the chat. Provide user_ids to add.

Inputs: chat_id (required), user_ids (required).

answer_callbackAnswer CallbackA

Respond to an inline button click (callback event from get_updates). You can update the original message text and/or show a notification popup to the user. Must be called within 30 seconds of the button press.

Inputs: callback_id (required), user_id (required), notification, message_text, +1 more.

delete_messageDelete MessageB

Delete a message sent by the bot. Requires the message_id.

Inputs: message_id (required).

edit_chatEdit ChatA

Rename a chat, change its description, or update its icon. The bot must be an admin of the chat.

Inputs: chat_id (required), title, description, icon, +1 more.

edit_messageEdit MessageB

Edit the text of an existing message sent by the bot. Optionally update attachments (inline keyboard buttons). Requires the message_id.

Inputs: message_id (required), text (required), format, attachments.

get_adminsGet AdminsA

Get the list of administrators in a group chat. Returns user_id, name, username, and permissions for each admin.

Inputs: chat_id (required).

get_bot_infoGet Bot InfoA

Get information about the MAX bot: name, username, user_id, description. Use this to verify the bot is connected and working.

Inputs: no named parameters.

get_chatGet ChatB

Get full details of a specific chat by its ID: title, description, participant count, icon, pinned message, link.

Inputs: chat_id (required).

get_chat_membersGet Chat MembersA

Get the list of participants in a group chat. Returns user_id, name, username for each member.

Inputs: chat_id (required), count, marker.

get_chatsGet ChatsA

Get the list of all group chats where the bot is a participant. Returns chat_id, title, type, participant count, and last activity time. Use chat_id from results to read or send messages. NOTE: Only group chats are returned. Personal dialogs (type: dialog) are NOT included here β€” use get_updates to discover their chat_id.

Inputs: count, marker.

get_messageGet MessageA

Get a single message by its ID. Returns full message details including text, sender, attachments.

Inputs: message_id (required).

get_messagesGet MessagesA

Read messages from a MAX chat. Use either chat_id OR message_ids β€” they are mutually exclusive. With chat_id: returns recent messages from that chat (use count/from/to to filter). With message_ids: returns those specific messages only (do NOT provide chat_id).

Inputs: chat_id, count, from, to, +1 more.

get_updatesGet UpdatesA

Get incoming events: new messages, button clicks, user joins/leaves, etc. This is the ONLY way to get chat_id for personal dialogs (type: dialog). Use the returned marker in the next call to get only new events. Set timeout=0 for instant response, timeout>0 for long polling (waits up to N seconds for new events). Event types: message_created, message_edited, message_removed, message_callback, bot_started, bot_added, bot_removed, user_added, user_removed, message_chat_created. NOTE: Designed for development and manual polling only. For production bots use webhooks (POST /subscriptions) β€” in production the update queue accumulates quickly without continuous processing.

Inputs: limit, timeout, marker, types.

pin_messagePin MessageA

Pin a message in a group chat. The bot must have admin rights in the chat.

Inputs: chat_id (required), message_id (required), notify.

remove_adminRemove AdminA

Revoke admin rights from a chat member. They remain a regular member. The bot must be an admin or owner of the chat. KNOWN MAX API BUG: The API returns success:true but rights may not actually be revoked. This is a confirmed issue on the MAX side β€” only the chat owner can reliably remove admin rights manually in the app.

Inputs: chat_id (required), user_id (required).

remove_memberRemove MemberA

Remove a user from a group chat. The bot must be an admin of the chat. Optionally block the user from rejoining. WARNING: If the user has privacy mode enabled in MAX settings, the bot will not be able to re-add them after removal β€” confirm with the user before proceeding.

Inputs: chat_id (required), user_id (required), block.

send_actionSend ActionA

Show a typing indicator or other status to chat members. Use before sending a message to improve UX. Actions: typing_on, sending_photo, sending_video, sending_audio, sending_file, mark_seen.

Inputs: chat_id (required), action (required).

send_mediaSend MediaA

Upload a file (image/video/audio/file) from a URL and send it as a message. The tool handles the full two-step upload process automatically: 1) get MAX upload URL, 2) upload file, 3) send message with attachment. Provide either chat_id or user_id.

Inputs: file_url (required), type (required), chat_id, user_id, +2 more.

send_messageSend MessageA

Send a text message to a MAX chat or user. Provide either chat_id (group chats/channels) or user_id (direct messages), not both. Supports markdown and HTML formatting. Use attachments to add inline keyboard buttons or media (use tokens from send_media).

Inputs: text (required), chat_id, user_id, format, +3 more.

set_adminSet AdminA

Grant admin rights to a chat member. The bot must be an admin or owner of the chat.

Inputs: chat_id (required), user_id (required).

unpin_messageUnpin MessageA

Unpin the currently pinned message in a group chat. The bot must have admin rights.

Inputs: chat_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 21 tools

    Disambiguation5/5

    Each tool targets a distinct operationβ€”messaging, chat management, admin actions, updates, etc. There is no overlap; even similar tools like get_message vs get_messages are clearly separated by singular vs plural access patterns.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., send_message, get_chats, remove_admin). The convention is uniform across all 21 tools, making it easy to predict tool functions.

    Tool Count5/5

    21 tools is well-scoped for a messaging bot server. It covers essential messaging, chat management, admin functions, updates polling, and media sending without being bloated or insufficient.

    Completeness4/5

    The tool surface covers core CRUD for messages, chat management, and admin roles. Missing are create_chat/delete_chat and webhook setup, but these are not critical for basic bot operations and can be handled externally.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for communication service connectors that currently provides multi-account Telegram integration with granular tool access and security controls. It allows AI models to manage messages, chats, and media across various accounts through a flexible, extensible routing architecture.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server for Max messenger that lets AI assistants send and read messages, manage chats, and interact with the Max platform API.
      MIT
    • F
      license
      A
      quality
      B
      maintenance
      MCP server for Yandex Messenger that enables reading chats, searching, downloading attachments, and sending messages via agent, using a web session with Playwright and a reverse-engineered protocol.
      19
      61 npm
      3
      -