zalo-mcp
Provides tools for interacting with Zalo Official Account (OA) and Zalo Notification Service (ZNS) APIs, including sending messages and templates, managing followers and CRM tags, reading conversations, uploading media, managing articles, and sending or checking ZNS notifications.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@zalo-mcp send a Zalo text message to user 123456 saying my order has shipped"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
zalo-mcp
A production-ready Model Context Protocol (MCP) server for Zalo Official Account (OA) and Zalo Notification Service (ZNS). Built in TypeScript with strict Zod validation, automatic OAuth v4 token refresh, retry resilience, MCP resources, and prompt templates.
Features
28 MCP Tools covering the full Zalo OA v2/v3 & ZNS lifecycle:
OA & Auth: Get OA profile, refresh OAuth v4 access tokens (plus automatic single-flight refresh on
-216expiry)Messaging (v3.0): Send text, image, file, interactive list/button templates, transaction notifications, and promotion messages
Followers & CRM Tags: List followers, inspect follower profiles, update follower CRM info, create/list/assign/remove tags
Conversations: List recent chats and read message history with any user
Media Upload: Upload local images, documents/files, and GIFs via
multipart/form-dataArticles: List, inspect, create, and delete OA articles
ZNS (Business API): Send template notifications, list templates, inspect template schemas, and check delivery status
3 Live MCP Resources:
zalo://oa/profile,zalo://oa/tags,zalo://zns/templates2 Built-in Prompts:
zalo_draft_customer_reply,zalo_zns_campaign_checkResilient HTTP Client: Automatic OAuth v4 token refresh with single-flight locking, 5xx retry with backoff, and configurable request timeouts
Related MCP server: LINE OA MCP Ultimate
Quick Start
1. Prerequisites
Node.js >= 20
A Zalo Official Account (OA) access token (and optionally OAuth v4 refresh credentials from the Zalo Developers Console)
2. Install & Build
git clone https://github.com/nhminhhh/zalo-mcp.git
cd zalo-mcp
npm install
npm run build3. Configure Your MCP Client
Claude Desktop / Cursor / Antigravity (mcp_config.json)
{
"mcpServers": {
"zalo": {
"command": "node",
"args": ["/absolute/path/to/zalo-mcp/dist/index.js"],
"env": {
"ZALO_OA_ACCESS_TOKEN": "your_oa_access_token",
"ZALO_OA_REFRESH_TOKEN": "your_oa_refresh_token",
"ZALO_APP_ID": "your_zalo_app_id",
"ZALO_APP_SECRET": "your_zalo_app_secret"
}
}
}
}Tip: If you provide
ZALO_OA_REFRESH_TOKEN,ZALO_APP_ID, andZALO_APP_SECRET,zalo-mcpwill automatically refresh expired access tokens (error: -216) without manual intervention.
Environment Variables
Variable | Required | Default | Description |
| Yes* | — | Zalo OA v2/v3 & ZNS access token |
| Optional | — | OAuth v4 refresh token for auto-renewal |
| Optional | — | Zalo App ID (required for OAuth v4 refresh) |
| Optional | — | Zalo App Secret (required for OAuth v4 refresh) |
| Optional |
| OA API base URL |
| Optional |
| ZNS Business API base URL |
| Optional |
| OAuth v4 base URL |
| Optional |
| HTTP request timeout in milliseconds |
*ZALO_OA_ACCESS_TOKEN can be omitted if all three OAuth v4 refresh variables are provided.
Complete Tool Reference
OA & Authentication
Tool | Description |
| Get Official Account profile metadata |
| Manually refresh OAuth v4 access token |
Messaging (OA v3.0)
Tool | Description |
| Send a CS text message (supports |
| Send an image via |
| Send a file attachment using |
| Send interactive |
| Send transaction notification (order, billing, booking, etc.) |
| Send promotional message to followers |
Followers & Tags
Tool | Description |
| List followers with pagination and optional |
| Get detailed follower profile by |
| Update follower CRM info (name, phone, address, city/district) |
| List all tags configured on the OA |
| Assign a tag to a follower |
| Remove a tag from a follower |
| Delete a tag from the OA |
Conversations
Tool | Description |
| List recent OA conversations |
| Get message history with a specific |
Media Upload
Tool | Description |
| Upload a local image (JPG/PNG) to get |
| Upload a local file (PDF/DOC/DOCX) to get |
| Upload a local GIF to get |
Articles
Tool | Description |
| List normal or video articles |
| Get full article details by |
| Create a new OA article |
| Delete an article by |
Zalo Notification Service (ZNS)
Tool | Description |
| Send ZNS template message to |
| List ZNS templates with status filtering |
| Inspect ZNS template parameters and pricing |
| Check ZNS message delivery status |
Development & Testing
# Typecheck
npm run typecheck
# Run unit & MCP InMemoryTransport integration tests
npm test
# Build dist/
npm run build
# CLI help & version
node dist/index.js --help
node dist/index.js --versionLicense
Available Tools
28 toolszalo_create_articleC
Create a new normal article on the Zalo Official Account.
Inputs: title (required), author (required), description (required), body_paragraphs (required), +3 more.
zalo_get_article_detailB
Get full details of a Zalo OA article by its article ID.
Inputs: id (required).
zalo_get_articlesB
List articles published or drafted on the Zalo Official Account.
Inputs: type, limit, offset.
zalo_get_conversationB
Retrieve message history between the Zalo Official Account and a specific user.
Inputs: user_id (required), count, offset.
zalo_get_follower_profileB
Get detailed profile information for a Zalo OA follower by user_id.
Inputs: user_id (required).
zalo_get_followersA
List followers of the Zalo Official Account with pagination and optional tag filtering.
Inputs: count, offset, tag_name.
zalo_get_oa_infoB
Retrieve profile information for the authenticated Zalo Official Account (OA), including OA ID, name, verification status, category, and follower count.
Inputs: no named parameters.
zalo_list_recent_chatsC
List recent conversations on the Zalo Official Account.
Inputs: count, offset.
zalo_list_tagsB
List all follower tags configured in the Zalo Official Account.
Inputs: no named parameters.
zalo_refresh_tokenA
Refresh the Zalo OA access token using OAuth v4. Uses ZALO_OA_REFRESH_TOKEN by default or an optional refresh_token override.
Inputs: refresh_token.
zalo_remove_articleC
Delete an article from the Zalo Official Account by ID.
Inputs: id (required).
zalo_remove_tagB
Delete a tag completely from the Zalo Official Account.
Inputs: tag_name (required).
zalo_send_file_messageA
Send a file attachment message to a Zalo user using a file token from zalo_upload_file.
Inputs: user_id (required), file_token (required).
zalo_send_image_messageB
Send an image message to a Zalo user using either an uploaded attachment_id or a public image URL.
Inputs: user_id (required), text, image_url, attachment_id.
zalo_send_promotion_messageC
Send a promotional message to a follower via OA v3.0.
Inputs: user_id (required), elements (required), buttons, attachment_id.
zalo_send_template_messageC
Send a structured interactive list or button template message to a Zalo user.
Inputs: user_id (required), template_type (required), text, buttons, +1 more.
zalo_send_text_messageC
Send a customer service (CS) text message to a Zalo user via Official Account v3.0.
Inputs: text (required), user_id (required), quote_message_id.
zalo_send_transaction_messageB
Send an official transaction notification message (order, billing, shipping, etc.) via OA v3.0.
Inputs: user_id (required), elements (required), template_type (required), buttons, +1 more.
zalo_tag_followerC
Assign a tag to a Zalo OA follower.
Inputs: user_id (required), tag_name (required).
zalo_untag_followerC
Remove a tag from a Zalo OA follower.
Inputs: user_id (required), tag_name (required).
zalo_update_follower_infoC
Update CRM/contact metadata for a Zalo OA follower (name, phone, address, city, district).
Inputs: user_id (required), name, phone, address, +2 more.
zalo_upload_fileB
Upload a local document/file (PDF, DOC, DOCX, max 5MB) to Zalo OA and receive a file token.
Inputs: file_path (required).
zalo_upload_gifA
Upload a local GIF file (max 5MB) to Zalo OA and receive an attachment_id.
Inputs: file_path (required).
zalo_upload_imageA
Upload a local image file (JPG/PNG, max 1MB) to Zalo OA and receive an attachment_id.
Inputs: file_path (required).
zalo_zns_get_message_statusB
Check delivery status of a previously sent ZNS message.
Inputs: phone (required), message_id (required).
zalo_zns_get_template_infoB
Get detailed schema, required parameters, and pricing for a specific ZNS template.
Inputs: template_id (required).
zalo_zns_list_templatesA
List available Zalo Notification Service (ZNS) templates with pagination and status filtering.
Inputs: limit, offset, status.
zalo_zns_send_messageC
Send a Zalo Notification Service (ZNS) template message to a recipient phone number (format: 84xxxxxxxxx).
Inputs: phone (required), template_id (required), template_data (required), mode, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Most tools map to a distinct resource and action, such as articles, followers, tags, chats, uploads, and OA info. The main ambiguity is among the six send_* OA message tools and ZNS vs OA template messaging, where an agent must read descriptions to choose correctly.
All names are snake_case with a zalo_ prefix and generally follow verb_noun order. Minor deviations include collection retrieval using both get_* (get_followers, get_articles) and list_* (list_tags, list_recent_chats), plus the zalo_zns_ sub-prefix.
28 tools is above the comfortable range and creates noticeable selection overhead for an agent. The set is logically grouped by OA subdomain, so most tools earn their place, but the raw count is still heavy.
The surface covers article creation/listing/detail/deletion, ZNS messaging, CS messaging, follower management, tags, chats, uploads, and token refresh. Minor gaps remain: no article update/edit operation and no tag creation endpoint, though agents can work around these.
Maintenance
Related MCP Connectors
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Manage your WAIA Connect account (official WhatsApp Cloud API + Coexistence) from your AI.
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Official WhatsApp Business API (Meta Cloud API) for your own CRM or SaaS, from WasapFlow, a Meta Tech Provider. Your AI can search the Bridge docs, list connected numbers, create Embedded Signup links so clients connect their own WhatsApp (Coexistence supported), send text and template messages, list templates, check and retry failed webhooks, see usage and open support tickets. Docs tools work without a key; account tools use the x-partner-key header.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to operate LINE Official Accounts through natural language, including messaging, rich menus and messages, coupons, audiences, insights, webhooks, LIFF, multi-OA management, and LINE Shopping workflows. It provides pre-flight validation, quota safety, Thai-localized templates, and zero-setup rich image handling for real-world OA operations.206 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate one or many LINE Official Accounts through natural language — sending broadcasts, Flex/Rich/card messages, building rich menus, coupons, audiences, insights, and LINE Shopping operations, with pre-flight quota checks and quiet-hour guardrails.206 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to run one or many LINE Official Accounts by natural conversation, covering broadcasts, Flex and tappable Rich Messages, rich menus, coupons, audiences, insights, webhooks, LIFF apps, and LINE Shopping through 51 tools. It handles image hosting, pre-flight quota validation, quiet-hour warnings, and Thai-localized templates, so routine account operations and storefront management happen without leaving the AI host.206 npmMIT
- AlicenseNot gradedqualityAmaintenanceLets AI agents run one or many LINE Official Accounts through natural conversation, covering broadcasts, Flex and tappable Rich Messages, Thai-ready rich menus, coupons, audiences, insights, and LINE Shopping via 51 tools. It adds pre-flight quota and quiet-hour guardrails, multi-OA switching and fan-out, and delivers assets like images and rich-menu graphics without external hosting or setup.206 npmMIT