name: mx-im description: Safely search MX users or groups and send Midea MX / 美信 IM messages from Codex. Use when the user asks to notify someone, send a message to a person or group, use a configured group alias, @ users, @ all, or send MX file/image messages. Read lookups need no extra authorization; every live send needs explicit user authorization for that exact target and message.
MX IM
Use this skill for MX / 美信 write-side interactions: user lookup, group lookup, group alias resolution, text sends, file/image sends, @user, and @all.
Rules
- Never print or persist raw tokens.
- Read-only lookups do not require extra authorization.
- Every live send requires explicit user authorization for the exact target and message in the current conversation.
- Prefer
scripts/mx_safe_send.pyfor normal text sends. It dry-runs by default. - Live text sends require both
--sendand--confirm-user-authorized. - Use original
scripts/im_send.pyonly for file, image, @user, @all, or push fields; it also requires--confirm-user-authorized. - Do not read MX SQLite databases or local message cache files.
Auth
Send scripts resolve auth in this order:
MX_OC_TOKEN.OPENCLAW_MX_SERVER_PORT+OPENCLAW_MX_SERVER_SECRETfrom the current env.- The MX OpenClaw LaunchAgent plist
ai.midea-openclaw.gateway-stable.plist, thenGET /oc-tokenwithx-server-secretto exchange a fresh OC token. Search order includes:OPENCLAW_MX_LAUNCHD_PLIST, MX's nested profile path~/Library/Application Support/mx/openclaw-home/<user>/Library/LaunchAgents/, all MXopenclaw-home/*/Library/LaunchAgents/profiles, and standard~/Library/LaunchAgents/. - Runtime MCP config
mcporter.json. /tmp/ua_token.txt.- UA authorization flow only when explicitly running
ua_login.pyor when the originalim_send.pyneeds a final fallback.
Never print or store the raw OC token or server secret in skill docs, repo files, logs, or memory.
To diagnose local MX/OpenClaw token discovery without exposing the token:
python3 scripts/get_mx_oc_token.py
Only use --print or --export when intentionally setting a local shell env.
Target Resolution
- If the user gives a uid or groupId, use it directly.
- If the user gives a group alias, resolve it first:
python3 scripts/group_alias.py "<别名>" - If only a person name, employee id, or email prefix is given:
python3 scripts/user_search.py --keyword "<姓名/工号/邮箱前缀>" - If only a group name is given:
python3 scripts/group_search.py --keyword "<群名关键字>" --limit 5
Alias data is local-only at references/group-aliases.local.json; do not sync
it to repos.
Text Send
Dry-run first:
python3 scripts/mx_safe_send.py \
--from-id "<sender_uid>" \
--to-id "<receiver_uid_or_group_id>" \
--session-type p2p \
--body "message text"
After explicit authorization:
python3 scripts/mx_safe_send.py \
--from-id "<sender_uid>" \
--to-id "<receiver_uid_or_group_id>" \
--session-type p2p \
--body "message text" \
--send \
--confirm-user-authorized
For detailed original script behavior, read only the relevant file in
references/: mx-ua-auth.md, im-send.md, user-search.md,
or group-search.md.