name: mx-message-query description: Query Midea MX / 美信 local message cache through the MX local HTTP query service from Codex. Use when the user asks to read MX sessions, search chat history, search messages globally or inside a group/session, list recent messages, or page message history. This is read-only and does not require send authorization. Never fall back to reading SQLite or app cache files directly.
MX Message Query
Use this skill for read-only MX / 美信 message-cache queries.
Rules
- Read-only queries do not require extra user authorization.
- Do not send messages from this skill.
- Do not read MX SQLite databases, app internals, or cache files directly.
- Use exposed
mx_message_*tools if the current Codex context provides them. - If no tool is exposed, use
scripts/mx_query.py, which calls the MX local HTTP query service only. - If the local service rejects auth or cannot be located, report that directly.
Auth
scripts/mx_query.py resolves auth in this order:
MX_MESSAGE_QUERY_BEARER_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. MX_OC_TOKEN.- Runtime MCP config
mcporter.json. /tmp/ua_token.txt.
Never print or store the raw OC token or server secret in skill docs, repo files, logs, or memory.
Commands
List sessions:
python3 scripts/mx_query.py sessions --limit 20 --offset 0
List messages in a session:
python3 scripts/mx_query.py list --sid "<sId>" --page-size 20
Global search:
python3 scripts/mx_query.py search-global --keyword "<关键词>" --limit 20
Session search:
python3 scripts/mx_query.py search-session --sid "<sId>" --keyword "<关键词>" --limit 20
History paging:
python3 scripts/mx_query.py history \
--sid "<sId>" \
--mid "<mid>" \
--timestamp 1704000000000 \
--direction before
By default the script prints compact previews. Use --raw only when the user
needs complete returned JSON.
For the original MX tool contract, read references/original-skill.md.