Labsco
woyaxnini logo

mcp-max-messenger

โ˜… 6

from woyaxnini

mcp-max-messenger

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

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

Available Tools (21)

Messages

ToolDescription
get_messagesRead messages from a chat (by chat_id or message_ids)
send_messageSend a message with text, HTML/Markdown, inline keyboard, media attachments
edit_messageEdit message text and attachments
delete_messageDelete a message
pin_messagePin a message in a chat
unpin_messageUnpin the currently pinned message

Media

ToolDescription
send_mediaUpload and send photo, video, audio, or file by URL
send_actionShow typing indicator, "sending photo/video/audio/file", mark as read

Chats

ToolDescription
get_bot_infoBot info: name, ID, username, description
get_chatsList all group chats the bot participates in
get_chatFull chat details: participants, pinned message, owner
edit_chatRename chat, change description or icon

Members

ToolDescription
get_chat_membersList chat members with roles
get_adminsList chat administrators with permissions
set_adminGrant admin rights to a member
remove_adminRevoke admin rights
add_membersAdd users to a group chat
remove_memberRemove a user from a group chat

Events

ToolDescription
get_updatesIncoming events: messages, button presses, new dialogs (long polling)
answer_callbackRespond 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.


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.