Most MQTT deployments start on Eclipse Mosquitto. It is small, fast and free, and it is usually still running on the same VM years later, with an acl_file nobody fully understands, a password_file that grew one line per device, and a bridge to somewhere that was added during an incident. Moving that to a managed broker is not hard, but it is detailed work, and the details are where devices get stranded.
mosquitto-migration-skills packages that work as two AI agent skills plus a set of tested scripts. Install them in Claude Code (or any agent that reads SKILL.md skills) and the agent can audit your Mosquitto setup, write a migration plan, bridge Mosquitto to ConnectMQ, and move your clients in waves with go/no-go checks and a rollback path. This post explains what the skills do and how a migration runs with them.
What Are Mosquitto Migration Skills?
An agent skill is a folder with a SKILL.md file (instructions and when to use them), reference documents and scripts. The agent loads it when a request matches, so you do not need to paste context or explain MQTT internals. The repository contains two skills:
| Skill | Use it for |
|---|---|
mosquitto-migration-planner |
Audit, sizing, ACL conversion, client ID mapping, a written plan with waves and rollback |
mosquitto-migration-executor |
ConnectMQ verification, Mosquitto bridge, retained copy, validation, client waves, cutover, troubleshooting |
Both skills share a reference file with the facts that drive a migration to ConnectMQ: endpoints and ports, how credentials and client IDs work, the access control model, plan limits and reason codes. The agent plans around those constraints instead of guessing.
What the Planner Skill Does
The planner starts with facts, not assumptions. It asks for mosquitto.conf (following include_dir), the acl_file, the password_file (only usernames are read) and, if you use it, the Dynamic Security plugin JSON. Then it runs the audit script:
python scripts/mosquitto_audit.py --conf /etc/mosquitto/mosquitto.conf --out migration/
The audit sorts every setting into blockers, actions, plan checks and information, each with the ConnectMQ equivalent. Typical findings:
require_certificate trueorpsk_file: blocker. ConnectMQ uses username and password over TLS, so certificate- or PSK-based devices need new credentials.allow_anonymous true: action. Every anonymous client must be found and given credentials.persistent_client_expiration 14d: plan check. ConnectMQ caps session expiry per plan, so devices that sleep for days should use retained "desired state" topics instead of queued commands.message_size_limitandmax_connections: compared with the plan's message size and connection limits.connection ...: existing bridges are listed so they can be re-created or retired.
Next the planner measures the workload from $SYS over at least 24 hours: connected clients, peak clients, subscriptions, retained count and message and byte rates. It uses those numbers to fill a fit check against the ConnectMQ plans. Connections and session minutes are checked separately: 80 always-on devices fit Basic's 100 connections, but use about 3.5 million session minutes a month, which points to Scale.
Converting Mosquitto ACLs to ConnectMQ Rules
ACL conversion is where manual migrations usually go wrong. Mosquitto's acl_file has three kinds of lines (user, topic, pattern), a section for anonymous clients, and a rule that a matching deny always wins. ConnectMQ uses an ordered rule list where the first match decides. The audit script handles the translation:
topic readbecomes asubscriberule,topic writeapublishrule,readwriteanallrule.denyrules are placed first, so the first-match list behaves like Mosquitto's deny precedence.%cand%uinpatternlines become${clientid}and${username}, or are expanded into one rule per client when you pass the client map. This matters because ConnectMQ client IDs carry the issued prefix, and you may want to keep the old IDs in your topic tree.- Anonymous rules and
$SYSrules are skipped and listed in the notes. - Dynamic Security roles are flattened per user, with a warning for ACL types ConnectMQ has no equivalent for.
The result is migration/acl-rules.md: a numbered table you enter in the ConnectMQ console in order. For background on rule design, see MQTT ACL.
Mapping Client IDs and Credentials
On ConnectMQ, credentials are generated in the console and each one comes with an issued client ID. A client connects with that ID or with <ISSUED_ID>_<suffix>. One script turns your old client list into a map:
python scripts/client_id_map.py clients.csv --issued-id c7f3k2 -o migration/client-map.csv
sensor-0042 becomes c7f3k2_sensor-0042. The script flags IDs with spaces, slashes or wildcards, and IDs that differ only by case, before they cause session takeovers in production. The planner also asks how you want to scope credentials (per device, per group or per site), because that decides whether you can revoke a single lost device.
What the Executor Skill Does
The executor takes migration/plan.md and works through it one verified step at a time. It asks before every production change and appends every step to migration/log.md.
1. Verify ConnectMQ
python scripts/verify_connectmq.py --url mqtts://BROKER_HOST:8883 --expect-deny-publish 'secret/x'
The smoke test checks TLS connect, publish and subscribe at QoS 0, 1 and 2, retained delivery, Last Will, persistent sessions and the ACL denies you expect.
2. Bridge Mosquitto to ConnectMQ
Mosquitto bridges natively, so the bridge runs on your existing server. The executor writes a separate conf.d file with TLS verification, the issued client ID, try_private false, notifications false and separate out and in topic lines. Forward topics carry device data to ConnectMQ, reverse topics carry commands back to devices that have not moved yet. They must not overlap, or messages loop between the brokers. More on the options in Mosquitto bridge configuration.
Retained state published before the bridge started is copied once with copy_retained.py, and compare_streams.py subscribes on both brokers to confirm that every topic arrives on both sides with the same counts.
3. Move Clients in Waves
Consumers go first: backends and dashboards read from ConnectMQ while devices still publish to Mosquitto through the bridge. Then come canary devices, followed by growing waves. Before each wave the executor runs a go/no-go checklist. It sizes waves against the plan's connection rate and watches for reason codes such as 0x85 (client ID not allowed), 0x86 (bad credentials) and 0x8A (IP banned after repeated failed logins). Rollback is just the previous client config, because the bridge keeps both brokers in sync.
4. Cut Over and Decommission
When the last wave has soaked, the executor runs a final retained copy, removes the bridge file, watches the Mosquitto log for stragglers and keeps the old server available for the agreed rollback window.
Installing the Skills
In Claude Code:
/plugin marketplace add connectmq/mosquitto-migration-skills
/plugin install mosquitto-migration-skills@connectmq-mosquitto-migration
Or copy the folders from skills/ into ~/.claude/skills/. For Claude.ai, zip a skill folder and upload it. The MQTT scripts need Python 3.9+ and paho-mqtt 2.x; the audit script uses only the standard library.
Then ask in plain language: "Audit /etc/mosquitto and plan a move to ConnectMQ", or "Run wave 2 and check nothing is lost".
When to Use These Skills
They fit teams that have outgrown a single Mosquitto server, want to stop patching and monitoring it, or need a managed MQTT broker with a dashboard, access control and alerts without changing their device code. If you are still deciding, read migrate Mosquitto to a cloud MQTT broker and self-hosted vs managed MQTT broker first.
The skills are part of a collection for six source brokers: HiveMQ, EMQX, VerneMQ, AWS IoT Core and Azure IoT Hub.
Frequently Asked Questions
Do I need Claude Code to use the Mosquitto migration skills?
No. Claude Code installs them as a plugin, but each skill is a plain folder with a SKILL.md, references and Python scripts. Claude.ai accepts the zipped folder, and other agents can load the same files. The scripts also work on their own from a terminal.
Can I keep my Mosquitto usernames, passwords and client IDs?
No. ConnectMQ generates credentials in the console, and client IDs must start with the credential's issued ID. The skills plan this as one config change per client (new host, credentials and client ID together) and generate the client ID map for you.
Will I lose messages during the migration?
Not if you follow the bridge-and-migrate approach the skills use. The bridge forwards device data to ConnectMQ and commands back to Mosquitto while clients move in waves, and compare_streams.py checks both sides before each wave. Retained messages are copied explicitly.
What if my devices use client certificates?
ConnectMQ authenticates with username and password over TLS, so certificate-based devices need a firmware or configuration update to send credentials. The audit marks this as a blocker so it is solved before the first wave, not during it.
Is the code open source?
Yes. The skills and scripts are MIT licensed on GitHub. Issues and pull requests with new Mosquitto options or migration patterns are welcome.



