Skip to main content

English | Tiếng Việt

zalo-bot-mcp

Talk to your AI agent from a Zalo group.

PyPI Python versions MIT Early development

An MCP channel server for the Zalo Bot API. Messages sent to your Zalo bot arrive in an MCP client session; the session replies through a tool call.

Early. The server is on PyPI and has been exercised against a real bot, but the MCP channel it targets is still an experimental Claude Code capability.

How it works

Zalo group  ──mention──▶  getUpdates  ──▶  gate  ──▶  MCP session
                                            │              │
                                       (not allowed)    reply tool
                                            │              │
                                          dropped  ◀───────┘
                                                      sendMessage

The server polls Zalo with getUpdates, so it needs no public URL, no webhook endpoint, and no tunnel. It runs on a laptop behind NAT.

Every inbound message passes the gate before anything else sees it. The gate is the only door.

Access control

Direct messages follow one of three policies:

Policy Unknown sender gets
pairing A short-lived code you approve out of band
allowlist Nothing. The message is dropped silently
disabled Nothing. All DMs are dropped

Groups must be configured by ID. Adding the bot to a group does not enable it. You can also restrict which members are allowed to trigger it.

Two rules the code enforces:

  1. No Zalo message can change the access config. A message asking to be added to the allowlist is exactly what an injection attack looks like, so approvals happen outside the channel.
  2. The server refuses to start if the allowlist contains a wildcard. It is easy to widen an allowlist during testing and forget to narrow it again.

Being on the allowlist means you can talk to the bot. It does not grant authority to act on anything.

Zalo platform constraints

These come from the Zalo Bot API itself, and they shape what any Zalo bot can do. Zalo owns these rules and changes them without notice, so treat https://bot.zapps.me/ as the source of truth and this section as a summary that may be out of date:

  • Groups are mention-gated. A bot receives a group message only when it is mentioned or when someone replies to one of its messages. It cannot watch a conversation passively.
  • Messages cap at 2000 characters. Longer replies get split across several messages.
  • No offset cursor. getUpdates takes only timeout, so deduplication happens by message_id rather than by advancing a cursor.
  • No message editing. Replies cannot be updated in place, so progress on a long task arrives as new messages.
  • No reactions. The API has no reaction endpoint, so a bot cannot acknowledge a message with an emoji. It can send a typing indicator (sendChatAction) and stickers.
  • Free-plan quotas. Zalo's Basic (free) plan allows 3 bots per account, 50 users per bot, 3 group chats (marked beta), and 3,000 outbound messages per month. A paid Pro plan exists. Current plans and quotas: https://bot.zapps.me/.

Install

Two ways in, both need uv: as a Claude Code plugin (/plugin marketplace add trongnguyenbinh/zalo-bot-mcp, then /plugin install zalo@zalo-bot-mcp), or as a Python package registered in your .mcp.json. Either way, Claude Code must then be started with the channel flag or messages never reach the session.

The full walkthrough, from creating the bot on Zalo to the first replied message, plus all /zalo:* skills and the zalo-bot-mcp-admin CLI, lives in docs/getting-started.md (bản tiếng Việt: docs/getting-started.vi.md).

About that channel flag

The flag is --dangerously-load-development-channels, and the word in the middle is not decoration. Claude Code's plain --channels flag only accepts plugins on an approved-channels allowlist that ships inside Claude Code, and rejects raw server: entries outright. zalo is not on that allowlist, so the development flag is the only way to run this today.

Anthropic's own wording is that the flag is for local channel development and not for running channels you downloaded off the internet. You would be downloading this one off the internet. That is worth saying out loud rather than burying: you are handing a messaging app a path into a session that can read your files and run commands, using an escape hatch built for people debugging their own code.

The mitigations are the gate, the fact that no Zalo message can change who is allowed through, and that every line of both is in this repo. Read src/zalo_bot_mcp/gate.py and SECURITY.md before you decide, not after.

Development

git clone https://github.com/trongnguyenbinh/zalo-bot-mcp.git
cd zalo-bot-mcp
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

Runtime dependencies are httpx and mcp. Nothing else. The Zalo endpoints are called directly, so the whole API surface stays readable in one file.

Not affiliated with Zalo

This is a personal, unofficial project. It is not built, endorsed, reviewed, or supported by Zalo, VNG Corporation, or any of their affiliates. "Zalo" is their trademark, used here only to say which service this talks to.

It calls the public Zalo Bot API the same way any third-party bot does. Your bot, your token, your account, your responsibility: read Zalo's own terms before pointing this at anything that matters, and expect the API to change without warning.

It is published under the MIT license, which means it comes with no warranty and no liability. If something breaks in your setup, you own the breakage.

License

MIT

Metadata

Release files for zalo-bot-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zalo-bot-mcp 0.1.1
File Size Uploaded
zalo_bot_mcp-0.1.1.tar.gz 179.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zalo-bot-mcp 0.1.1
File Interpreter ABI Platform
zalo_bot_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 208.0 kB

Release files / zalo_bot_mcp-0.1.1.tar.gz

Download URL zalo_bot_mcp-0.1.1.tar.gz
Size 179.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aaf8f7b9728600187c1fe516d7c871f04db1b984b62d1ccc419a5bdeed599312
BLAKE2b-256 checksum
How to use checksums
0bfb9916e353dc2694960cdd7aa8977fa34991a2f9755d4868e681a26ac9b61a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / zalo_bot_mcp-0.1.1-py3-none-any.whl

Download URL zalo_bot_mcp-0.1.1-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
948ce89200fc25e7623c1990d6c727f627aa94fbe60798b437c46a5fde2b4d3f
BLAKE2b-256 checksum
How to use checksums
62bf25d5bde52fc56fa699abd22945490a551f3451a4252265e8417b35c14149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page