[{"data":1,"prerenderedAt":1307},["Reactive",2],{"VEb9Nnn1YX":3,"agent":26},{"items":4,"meta":23},[5,8,11,14,17,20],{"title":6,"titleUrl":7},"如何在 Python3 中使用 MQTT 客户端库 Paho Client","how-to-use-mqtt-in-python",{"title":9,"titleUrl":10},"MQTT服务器（MQTT Broker）：工作原理与快速入门指南","the-ultimate-guide-to-mqtt-broker-comparison",{"title":12,"titleUrl":13},"MQTT QoS 0、1、2 解析：快速入门指南","introduction-to-mqtt-qos",{"title":15,"titleUrl":16},"在 ESP32 上使用 MQTT：入门指南","esp32-connects-to-the-free-public-mqtt-broker",{"title":18,"titleUrl":19},"MQTT 主题与通配符（Topics & Wildcards）入门手册","advanced-features-of-mqtt-topics",{"title":21,"titleUrl":22},"车联网 CAN Bus 协议介绍与数据实时流处理","can-bus-how-it-works-pros-and-cons",{"count":24,"limit":24,"page":25},6,1,{"_path":27,"_dir":28,"_draft":29,"_partial":29,"_locale":30,"title":31,"description":32,"body":33,"_type":1302,"_id":1303,"_source":1304,"_file":1305,"_extension":1306},"/zh/agent","zh",false,"","MQTTX Agent","MQTTX Agent 是内置于桌面客户端的 AI Agent，用于通过自然语言操作 MQTTX。按本文配置模型服务商、提供连接上下文，再执行 MQTT 任务并检查结果。",{"type":34,"children":35,"toc":1274},"root",[36,44,49,54,63,69,145,150,152,298,304,321,341,346,358,399,404,410,415,451,456,462,475,480,493,498,503,508,541,546,551,592,603,615,620,639,645,650,662,678,690,695,700,705,707,811,848,856,890,895,900,905,913,918,924,929,944,949,954,959,976,981,986,1009,1014,1019,1032,1050,1063,1069,1081,1093,1098,1103,1108,1151,1156,1161,1166,1172,1191,1243,1262],{"type":37,"tag":38,"props":39,"children":41},"element","h1",{"id":40},"mqttx-agent",[42],{"type":43,"value":31},"text",{"type":37,"tag":45,"props":46,"children":47},"p",{},[48],{"type":43,"value":32},{"type":37,"tag":45,"props":50,"children":51},{},[52],{"type":43,"value":53},"先完成服务商和权限设置，再按任务示例管理连接与消息、使用已提供的 MQTT 协议与设备交互、排查流量，或准备代码和消息处理逻辑。继续同一任务时，保留当前对话中的工具结果作为上下文。",{"type":37,"tag":45,"props":55,"children":56},{},[57],{"type":37,"tag":58,"props":59,"children":62},"img",{"alt":60,"src":61},"MQTTX Agent 面板","https://mqttx.app/images/mqttx-agent.png",[],{"type":37,"tag":64,"props":65,"children":67},"h2",{"id":66},"配置模型服务商",[68],{"type":43,"value":66},{"type":37,"tag":70,"props":71,"children":72},"ol",{},[73,94,120,140],{"type":37,"tag":74,"props":75,"children":76},"li",{},[77,79,85,87,92],{"type":43,"value":78},"打开 ",{"type":37,"tag":80,"props":81,"children":82},"strong",{},[83],{"type":43,"value":84},"设置 → MQTTX Agent",{"type":43,"value":86},"，开启 ",{"type":37,"tag":80,"props":88,"children":89},{},[90],{"type":43,"value":91},"启用 MQTTX Agent",{"type":43,"value":93},"。",{"type":37,"tag":74,"props":95,"children":96},{},[97,99,104,106,111,113,118],{"type":43,"value":98},"填写服务商的 ",{"type":37,"tag":80,"props":100,"children":101},{},[102],{"type":43,"value":103},"API Host",{"type":43,"value":105},"、",{"type":37,"tag":80,"props":107,"children":108},{},[109],{"type":43,"value":110},"API Key",{"type":43,"value":112}," 和 ",{"type":37,"tag":80,"props":114,"children":115},{},[116],{"type":43,"value":117},"模型",{"type":43,"value":119},"。执行 MQTTX 操作需要选择支持工具调用的模型。",{"type":37,"tag":74,"props":121,"children":122},{},[123,125,132,134,138],{"type":43,"value":124},"通过左侧栏的星形按钮打开 Agent。使用 ",{"type":37,"tag":126,"props":127,"children":129},"code",{"className":128},[],[130],{"type":43,"value":131},"Cmd/Ctrl + J",{"type":43,"value":133},"，或连接页、脚本页的 ",{"type":37,"tag":80,"props":135,"children":136},{},[137],{"type":43,"value":31},{"type":43,"value":139}," 按钮，可打开浮窗并同时查看其他页面。",{"type":37,"tag":74,"props":141,"children":142},{},[143],{"type":43,"value":144},"先提交只读请求，例如“列出已有的 MQTTX 连接”，确认回复中出现工具结果。请求失败时，先检查服务商地址、凭据和模型的工具调用支持，再执行具体任务。",{"type":37,"tag":45,"props":146,"children":147},{},[148],{"type":43,"value":149},"以下列出常用 API Host。具体地址和凭据以所用服务商提供的信息为准。",{"type":43,"value":151},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":37,"tag":153,"props":154,"children":155},"table",{},[156,174],{"type":37,"tag":157,"props":158,"children":159},"thead",{},[160],{"type":37,"tag":161,"props":162,"children":163},"tr",{},[164,170],{"type":37,"tag":165,"props":166,"children":167},"th",{},[168],{"type":43,"value":169},"服务商",{"type":37,"tag":165,"props":171,"children":172},{},[173],{"type":43,"value":103},{"type":37,"tag":175,"props":176,"children":177},"tbody",{},[178,196,213,230,247,264,281],{"type":37,"tag":161,"props":179,"children":180},{},[181,187],{"type":37,"tag":182,"props":183,"children":184},"td",{},[185],{"type":43,"value":186},"OpenAI",{"type":37,"tag":182,"props":188,"children":189},{},[190],{"type":37,"tag":126,"props":191,"children":193},{"className":192},[],[194],{"type":43,"value":195},"https://api.openai.com/v1",{"type":37,"tag":161,"props":197,"children":198},{},[199,204],{"type":37,"tag":182,"props":200,"children":201},{},[202],{"type":43,"value":203},"DeepSeek",{"type":37,"tag":182,"props":205,"children":206},{},[207],{"type":37,"tag":126,"props":208,"children":210},{"className":209},[],[211],{"type":43,"value":212},"https://api.deepseek.com/v1",{"type":37,"tag":161,"props":214,"children":215},{},[216,221],{"type":37,"tag":182,"props":217,"children":218},{},[219],{"type":43,"value":220},"Anthropic",{"type":37,"tag":182,"props":222,"children":223},{},[224],{"type":37,"tag":126,"props":225,"children":227},{"className":226},[],[228],{"type":43,"value":229},"https://api.anthropic.com/v1",{"type":37,"tag":161,"props":231,"children":232},{},[233,238],{"type":37,"tag":182,"props":234,"children":235},{},[236],{"type":43,"value":237},"xAI",{"type":37,"tag":182,"props":239,"children":240},{},[241],{"type":37,"tag":126,"props":242,"children":244},{"className":243},[],[245],{"type":43,"value":246},"https://api.x.ai/v1",{"type":37,"tag":161,"props":248,"children":249},{},[250,255],{"type":37,"tag":182,"props":251,"children":252},{},[253],{"type":43,"value":254},"Google",{"type":37,"tag":182,"props":256,"children":257},{},[258],{"type":37,"tag":126,"props":259,"children":261},{"className":260},[],[262],{"type":43,"value":263},"https://generativelanguage.googleapis.com/v1beta",{"type":37,"tag":161,"props":265,"children":266},{},[267,272],{"type":37,"tag":182,"props":268,"children":269},{},[270],{"type":43,"value":271},"SiliconFlow",{"type":37,"tag":182,"props":273,"children":274},{},[275],{"type":37,"tag":126,"props":276,"children":278},{"className":277},[],[279],{"type":43,"value":280},"https://api.siliconflow.cn/v1",{"type":37,"tag":161,"props":282,"children":283},{},[284,289],{"type":37,"tag":182,"props":285,"children":286},{},[287],{"type":43,"value":288},"Azure OpenAI",{"type":37,"tag":182,"props":290,"children":291},{},[292],{"type":37,"tag":126,"props":293,"children":295},{"className":294},[],[296],{"type":43,"value":297},"https://\u003CresourceName>.openai.azure.com",{"type":37,"tag":299,"props":300,"children":302},"h3",{"id":301},"选择使用方式",[303],{"type":43,"value":301},{"type":37,"tag":45,"props":305,"children":306},{},[307,312,314,319],{"type":37,"tag":80,"props":308,"children":309},{},[310],{"type":43,"value":311},"全屏",{"type":43,"value":313},"适合集中处理较长对话，",{"type":37,"tag":80,"props":315,"children":316},{},[317],{"type":43,"value":318},"浮窗",{"type":43,"value":320},"支持同时查看消息、脚本或 Dashboard。全屏对话打开后，保持活动的连接仍可接收并保存消息。",{"type":37,"tag":45,"props":322,"children":323},{},[324,326,332,334,339],{"type":43,"value":325},"拖动浮窗标题栏可移动位置，拖动边缘或角可调整大小，MQTTX 会记住位置和大小。标题栏的展开按钮用于切换到全屏。按 ",{"type":37,"tag":126,"props":327,"children":329},{"className":328},[],[330],{"type":43,"value":331},"Esc",{"type":43,"value":333}," 关闭浮窗；全屏时按 ",{"type":37,"tag":126,"props":335,"children":337},{"className":336},[],[338],{"type":43,"value":331},{"type":43,"value":340}," 返回浮窗。在左侧栏选择其他页面会退出全屏。",{"type":37,"tag":299,"props":342,"children":344},{"id":343},"选择推理强度",[345],{"type":43,"value":343},{"type":37,"tag":45,"props":347,"children":348},{},[349,351,356],{"type":43,"value":350},"在 ",{"type":37,"tag":80,"props":352,"children":353},{},[354],{"type":43,"value":355},"设置 → MQTTX Agent → 推理强度",{"type":43,"value":357}," 中选择模型支持的档位，或在输入框的模型菜单中、模型列表下方直接选择。",{"type":37,"tag":359,"props":360,"children":361},"ul",{},[362,372,382],{"type":37,"tag":74,"props":363,"children":364},{},[365,370],{"type":37,"tag":80,"props":366,"children":367},{},[368],{"type":43,"value":369},"自动",{"type":43,"value":371},"：由服务商决定。",{"type":37,"tag":74,"props":373,"children":374},{},[375,380],{"type":37,"tag":80,"props":376,"children":377},{},[378],{"type":43,"value":379},"关闭",{"type":43,"value":381},"：不使用推理。",{"type":37,"tag":74,"props":383,"children":384},{},[385,390,392,397],{"type":37,"tag":80,"props":386,"children":387},{},[388],{"type":43,"value":389},"低",{"type":43,"value":391},"至",{"type":37,"tag":80,"props":393,"children":394},{},[395],{"type":43,"value":396},"最高",{"type":43,"value":398},"：逐步增加推理强度。",{"type":37,"tag":45,"props":400,"children":401},{},[402],{"type":43,"value":403},"菜单只显示所选模型支持的档位。不支持调节推理强度的模型会隐藏这一项。如果新选择的模型不支持此前选定的档位，MQTTX 会使用最接近的可用档位。当前档位显示在模型名后面。",{"type":37,"tag":64,"props":405,"children":407},{"id":406},"给-agent-提供所需信息",[408],{"type":43,"value":409},"给 Agent 提供所需信息",{"type":37,"tag":299,"props":411,"children":413},{"id":412},"提及连接",[414],{"type":43,"value":412},{"type":37,"tag":45,"props":416,"children":417},{},[418,420,426,428,434,436,442,443,449],{"type":43,"value":419},"在输入框中输入 ",{"type":37,"tag":126,"props":421,"children":423},{"className":422},[],[424],{"type":43,"value":425},"@",{"type":43,"value":427},"，用 ",{"type":37,"tag":126,"props":429,"children":431},{"className":430},[],[432],{"type":43,"value":433},"↑",{"type":43,"value":435}," / ",{"type":37,"tag":126,"props":437,"children":439},{"className":438},[],[440],{"type":43,"value":441},"↓",{"type":43,"value":112},{"type":37,"tag":126,"props":444,"children":446},{"className":445},[],[447],{"type":43,"value":448},"Enter",{"type":43,"value":450}," 选择连接。正在查看的连接排在最前，已连接的条目带有绿点。Agent 会先读取被提及的连接，再处理请求。",{"type":37,"tag":45,"props":452,"children":453},{},[454],{"type":43,"value":455},"提及连接可明确多个设备或 Broker 之间的操作对象。请求中还可包含待检查的主题、Payload 字段或预期结果。",{"type":37,"tag":299,"props":457,"children":459},{"id":458},"选择-skill",[460],{"type":43,"value":461},"选择 Skill",{"type":37,"tag":45,"props":463,"children":464},{},[465,467,473],{"type":43,"value":466},"输入 ",{"type":37,"tag":126,"props":468,"children":470},{"className":469},[],[471],{"type":43,"value":472},"/",{"type":43,"value":474},"，可以选择客户端代码、测试数据、Schema 与编解码、自定义函数、MQTT/EMQX 知识、连接诊断、MQTTX CLI 或 Zero EMQX 等内置 Skill。Skill 为当前任务提供对应的知识与操作指引。",{"type":37,"tag":45,"props":476,"children":477},{},[478],{"type":43,"value":479},"MQTTX CLI Skill 生成可由用户在终端执行的命令。桌面内置的 Agent 不执行 shell 命令。",{"type":37,"tag":45,"props":481,"children":482},{},[483,485,491],{"type":43,"value":484},"生成的代码项目会显示为 ZIP 文件卡片，支持下载或在文件夹中显示。文件保存在应用数据目录下的 ",{"type":37,"tag":126,"props":486,"children":488},{"className":487},[],[489],{"type":43,"value":490},"agent-files",{"type":43,"value":492}," 中，删除会话时会一并删除。",{"type":37,"tag":299,"props":494,"children":496},{"id":495},"添加截图或文件",[497],{"type":43,"value":495},{"type":37,"tag":45,"props":499,"children":500},{},[501],{"type":43,"value":502},"粘贴截图、将文件拖入面板，或点击 📎，为请求补充相关信息。例如，提供需要解码的 Payload，或配置 TLS 连接需要使用的文件。",{"type":37,"tag":45,"props":504,"children":505},{},[506],{"type":43,"value":507},"图片会发送给模型。文本文件以文本形式发送，超过 64 KB 的文件只发送前 64 KB。证书和私钥文件只以路径引用，文件内容不会发送给模型。Agent 可以使用这些路径配置 TLS：",{"type":37,"tag":509,"props":510,"children":511},"blockquote",{},[512],{"type":37,"tag":45,"props":513,"children":514},{},[515,517,523,525,531,533,539],{"type":43,"value":516},"使用 ",{"type":37,"tag":126,"props":518,"children":520},{"className":519},[],[521],{"type":43,"value":522},"ca.crt",{"type":43,"value":524}," 作为 CA、",{"type":37,"tag":126,"props":526,"children":528},{"className":527},[],[529],{"type":43,"value":530},"client.crt",{"type":43,"value":532}," 作为客户端证书、",{"type":37,"tag":126,"props":534,"children":536},{"className":535},[],[537],{"type":43,"value":538},"client.key",{"type":43,"value":540}," 作为私钥，连接到 broker.example.com 的 8883 端口。",{"type":37,"tag":64,"props":542,"children":544},{"id":543},"查看并批准操作",[545],{"type":43,"value":543},{"type":37,"tag":45,"props":547,"children":548},{},[549],{"type":43,"value":550},"执行任务前先选择权限模式，执行过程中检查工具步骤与结果。需要批准时，在请求卡片上允许或拒绝操作：",{"type":37,"tag":359,"props":552,"children":553},{},[554,583],{"type":37,"tag":74,"props":555,"children":556},{},[557,562,564,569,570,575,577,582],{"type":37,"tag":80,"props":558,"children":559},{},[560],{"type":43,"value":561},"操作前询问",{"type":43,"value":563},"为默认模式。读取操作自动执行；创建、连接、订阅、发布、删除、同步主题树、停止定时发布以及每次 MCP 工具调用都会等待批准。在请求卡片上选择",{"type":37,"tag":80,"props":565,"children":566},{},[567],{"type":43,"value":568},"允许一次",{"type":43,"value":105},{"type":37,"tag":80,"props":571,"children":572},{},[573],{"type":43,"value":574},"本次对话中始终允许这个工具",{"type":43,"value":576},"或",{"type":37,"tag":80,"props":578,"children":579},{},[580],{"type":43,"value":581},"拒绝",{"type":43,"value":93},{"type":37,"tag":74,"props":584,"children":585},{},[586,590],{"type":37,"tag":80,"props":587,"children":588},{},[589],{"type":43,"value":369},{"type":43,"value":591},"模式下，大多数操作无需批准。",{"type":37,"tag":45,"props":593,"children":594},{},[595,597,601],{"type":43,"value":596},"删除、清空以及保存、测试和应用脚本始终需要逐次批准，包括自动模式。",{"type":37,"tag":80,"props":598,"children":599},{},[600],{"type":43,"value":574},{"type":43,"value":602},"不适用于这些操作。",{"type":37,"tag":45,"props":604,"children":605},{},[606,608,613],{"type":43,"value":607},"在输入框的权限胶囊中切换当前会话的模式。在 ",{"type":37,"tag":80,"props":609,"children":610},{},[611],{"type":43,"value":612},"设置 → MQTTX Agent → 默认权限模式",{"type":43,"value":614}," 中设置新会话的默认值。第一次选择自动模式时，MQTTX 会要求确认相应风险。",{"type":37,"tag":299,"props":616,"children":618},{"id":617},"达到步数上限后继续",[619],{"type":43,"value":617},{"type":37,"tag":45,"props":621,"children":622},{},[623,625,630,632,637],{"type":43,"value":624},"一次回复最多执行",{"type":37,"tag":80,"props":626,"children":627},{},[628],{"type":43,"value":629},"每次回复的最大步数",{"type":43,"value":631},"个工具步骤。默认值为 50，可在设置中选择 10 至 200。达到上限后，回复会暂停并显示",{"type":37,"tag":80,"props":633,"children":634},{},[635],{"type":43,"value":636},"继续",{"type":43,"value":638},"，点击即可继续处理。",{"type":37,"tag":64,"props":640,"children":642},{"id":641},"用对话完成-mqttx-中的工作",[643],{"type":43,"value":644},"用对话完成 MQTTX 中的工作",{"type":37,"tag":299,"props":646,"children":648},{"id":647},"管理连接与消息",[649],{"type":43,"value":647},{"type":37,"tag":45,"props":651,"children":652},{},[653,655,660],{"type":43,"value":654},"通过 ",{"type":37,"tag":126,"props":656,"children":658},{"className":657},[],[659],{"type":43,"value":425},{"type":43,"value":661}," 选择已有连接；需要新建连接时，在请求中提供 Broker 地址、端口和必要的连接设置。写明要执行的操作，例如整理分组、配置 TLS、连接或断开、管理订阅和发布消息：",{"type":37,"tag":509,"props":663,"children":664},{},[665],{"type":37,"tag":45,"props":666,"children":667},{},[668,670,676],{"type":43,"value":669},"连接 Factory Demo，订阅 ",{"type":37,"tag":126,"props":671,"children":673},{"className":672},[],[674],{"type":43,"value":675},"factory/+/telemetry",{"type":43,"value":677},"，然后查看它最近收到的消息。",{"type":37,"tag":45,"props":679,"children":680},{},[681,683,688],{"type":43,"value":682},"将 Factory Demo 替换为实际使用的连接。批准请求的操作后，打开连接页，核对连接状态、订阅列表和已收到的消息。后续检查配置或流量时，继续使用该连接的 ",{"type":37,"tag":126,"props":684,"children":686},{"className":685},[],[687],{"type":43,"value":425},{"type":43,"value":689}," 上下文。",{"type":37,"tag":299,"props":691,"children":693},{"id":692},"通过自然语言与设备交互",[694],{"type":43,"value":692},{"type":37,"tag":45,"props":696,"children":697},{},[698],{"type":43,"value":699},"查询或控制设备前，先提供设备的 MQTT 协议，写明遥测主题、控制主题与 Payload 格式，以及状态回报主题。执行后，通过设备新消息核对结果。",{"type":37,"tag":45,"props":701,"children":702},{},[703],{"type":43,"value":704},"以下示例假设书房的温度传感器与风扇采用如下 MQTT 协议：",{"type":43,"value":706},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":37,"tag":153,"props":708,"children":709},{},[710,731],{"type":37,"tag":157,"props":711,"children":712},{},[713],{"type":37,"tag":161,"props":714,"children":715},{},[716,721,726],{"type":37,"tag":165,"props":717,"children":718},{},[719],{"type":43,"value":720},"用途",{"type":37,"tag":165,"props":722,"children":723},{},[724],{"type":43,"value":725},"Topic",{"type":37,"tag":165,"props":727,"children":728},{},[729],{"type":43,"value":730},"JSON Payload",{"type":37,"tag":175,"props":732,"children":733},{},[734,760,786],{"type":37,"tag":161,"props":735,"children":736},{},[737,742,751],{"type":37,"tag":182,"props":738,"children":739},{},[740],{"type":43,"value":741},"温度上报",{"type":37,"tag":182,"props":743,"children":744},{},[745],{"type":37,"tag":126,"props":746,"children":748},{"className":747},[],[749],{"type":43,"value":750},"home/study/temperature",{"type":37,"tag":182,"props":752,"children":753},{},[754],{"type":37,"tag":126,"props":755,"children":757},{"className":756},[],[758],{"type":43,"value":759},"{\"temperature\":29.4}",{"type":37,"tag":161,"props":761,"children":762},{},[763,768,777],{"type":37,"tag":182,"props":764,"children":765},{},[766],{"type":43,"value":767},"风扇控制指令",{"type":37,"tag":182,"props":769,"children":770},{},[771],{"type":37,"tag":126,"props":772,"children":774},{"className":773},[],[775],{"type":43,"value":776},"home/study/fan/set",{"type":37,"tag":182,"props":778,"children":779},{},[780],{"type":37,"tag":126,"props":781,"children":783},{"className":782},[],[784],{"type":43,"value":785},"{\"power\":\"on\",\"speed\":2}",{"type":37,"tag":161,"props":787,"children":788},{},[789,794,803],{"type":37,"tag":182,"props":790,"children":791},{},[792],{"type":43,"value":793},"风扇状态回报",{"type":37,"tag":182,"props":795,"children":796},{},[797],{"type":37,"tag":126,"props":798,"children":800},{"className":799},[],[801],{"type":43,"value":802},"home/study/fan/state",{"type":37,"tag":182,"props":804,"children":805},{},[806],{"type":37,"tag":126,"props":807,"children":809},{"className":808},[],[810],{"type":43,"value":785},{"type":37,"tag":70,"props":812,"children":813},{},[814,831,843],{"type":37,"tag":74,"props":815,"children":816},{},[817,819,824,825,830],{"type":43,"value":818},"将 MQTTX 连接到设备使用的 Broker，订阅 ",{"type":37,"tag":126,"props":820,"children":822},{"className":821},[],[823],{"type":43,"value":750},{"type":43,"value":112},{"type":37,"tag":126,"props":826,"children":828},{"className":827},[],[829],{"type":43,"value":802},{"type":43,"value":93},{"type":37,"tag":74,"props":832,"children":833},{},[834,836,841],{"type":43,"value":835},"确认温度和风扇状态消息已到达。在 Agent 对话中提供上述协议定义，并通过 ",{"type":37,"tag":126,"props":837,"children":839},{"className":838},[],[840],{"type":43,"value":425},{"type":43,"value":842}," 选择对应连接。",{"type":37,"tag":74,"props":844,"children":845},{},[846],{"type":43,"value":847},"提交以下请求：",{"type":37,"tag":509,"props":849,"children":850},{},[851],{"type":37,"tag":45,"props":852,"children":853},{},[854],{"type":43,"value":855},"查看书房温度和风扇状态；若温度高于 28°C，将风扇设为二档，并检查新的设备回报。",{"type":37,"tag":70,"props":857,"children":859},{"start":858},4,[860,871],{"type":37,"tag":74,"props":861,"children":862},{},[863,865,869],{"type":43,"value":864},"温度条件满足时，在",{"type":37,"tag":80,"props":866,"children":867},{},[868],{"type":43,"value":561},{"type":43,"value":870},"模式中批准控制指令发布，检查工具结果，确认消息已发出。",{"type":37,"tag":74,"props":872,"children":873},{},[874,876,881,883,888],{"type":43,"value":875},"检查指令之后新的 ",{"type":37,"tag":126,"props":877,"children":879},{"className":878},[],[880],{"type":43,"value":802},{"type":43,"value":882}," 回报，确认电源与档位符合 ",{"type":37,"tag":126,"props":884,"children":886},{"className":885},[],[887],{"type":43,"value":785},{"type":43,"value":889},"。没有新的匹配回报时，保留“设备结果尚未确认”的结论。",{"type":37,"tag":45,"props":891,"children":892},{},[893],{"type":43,"value":894},"以目标设备实际实现的协议为准。本例按提供的协议处理这一次请求，不配置常驻控制。",{"type":37,"tag":299,"props":896,"children":898},{"id":897},"查找异常消息的线索",[899],{"type":43,"value":897},{"type":37,"tag":45,"props":901,"children":902},{},[903],{"type":43,"value":904},"提及连接，描述异常现象、相关主题和预期 Payload，再请求检查所需的订阅、已保存或新到达的消息，以及日志。例如：",{"type":37,"tag":509,"props":906,"children":907},{},[908],{"type":37,"tag":45,"props":909,"children":910},{},[911],{"type":43,"value":912},"查看 Factory Demo 最近收到的消息，说明有哪些字段，并找出 Payload 结构与其他消息不同的记录。",{"type":37,"tag":45,"props":914,"children":915},{},[916],{"type":43,"value":917},"对照工具返回的消息和日志核对分析结果。缺少所需消息时，先检查连接与订阅，接收新消息后再提交请求。排查 TLS 问题时，可请求检查本地证书；证书和私钥的文件内容保留在本地。",{"type":37,"tag":299,"props":919,"children":921},{"id":920},"准备代码测试数据与消息处理逻辑",[922],{"type":43,"value":923},"准备代码、测试数据与消息处理逻辑",{"type":37,"tag":45,"props":925,"children":926},{},[927],{"type":43,"value":928},"在请求中说明语言或数据格式、目标主题，以及输入示例或预期输出，再请求生成客户端代码、测试消息、Protobuf 或 Avro Schema，或处理 Payload 的 JavaScript 转换函数。例如：",{"type":37,"tag":509,"props":930,"children":931},{},[932],{"type":37,"tag":45,"props":933,"children":934},{},[935,937,942],{"type":43,"value":936},"生成一个 Node.js MQTT 客户端，订阅 ",{"type":37,"tag":126,"props":938,"children":940},{"className":939},[],[941],{"type":43,"value":675},{"type":43,"value":943},"，将收到的消息解析为 JSON 后输出。",{"type":37,"tag":45,"props":945,"children":946},{},[947],{"type":43,"value":948},"按请求中的主题和格式检查生成的代码与数据。处理转换函数或 Schema 时，先提供有代表性的输入进行测试，核对输出，再应用结果。运行脚本测试在任何权限模式下都需要批准。应用转换函数会影响所有连接，应用前需要检查它的作用范围。",{"type":37,"tag":299,"props":950,"children":952},{"id":951},"整理并展示数据",[953],{"type":43,"value":951},{"type":37,"tag":45,"props":955,"children":956},{},[957],{"type":43,"value":958},"先连接并订阅相关主题，确认消息已到达。再请求构建或查看主题树、汇总消息，或为指定 Payload 字段创建 Dashboard 组件。例如，指定温度 Line 曲线与湿度 Gauge，并提供连接、主题过滤器和字段名称。",{"type":37,"tag":45,"props":960,"children":961},{},[962,964,974],{"type":43,"value":963},"打开生成的视图，对照已收到的主题与 Payload 核对结果。手动配置组件时，按 ",{"type":37,"tag":965,"props":966,"children":971},"a",{"href":967,"rel":968,"target":970},"https://mqttx.app/zh/docs/advanced#%E4%BB%AA%E8%A1%A8%E7%9B%98",[969,969],"noopener","_blank",[972],{"type":43,"value":973},"Dashboard 指南",{"type":43,"value":975}," 操作；Dashboard 可独立于 Agent 使用。",{"type":37,"tag":64,"props":977,"children":979},{"id":978},"核对任务结果",[980],{"type":43,"value":978},{"type":37,"tag":45,"props":982,"children":983},{},[984],{"type":43,"value":985},"回复结束后，打开对应的 MQTTX 页面，将实际结果与工具返回内容对照：",{"type":37,"tag":359,"props":987,"children":988},{},[989,994,999,1004],{"type":37,"tag":74,"props":990,"children":991},{},[992],{"type":43,"value":993},"修改连接或订阅后，检查连接状态与订阅列表。",{"type":37,"tag":74,"props":995,"children":996},{},[997],{"type":43,"value":998},"发布消息后，检查发布结果；任务需要设备响应时，继续检查新收到的回报。",{"type":37,"tag":74,"props":1000,"children":1001},{},[1002],{"type":43,"value":1003},"生成代码、Schema 或脚本后，对照提供的示例检查输出，并在使用前核对测试结果。",{"type":37,"tag":74,"props":1005,"children":1006},{},[1007],{"type":43,"value":1008},"创建数据视图后，将字段与读数同选定连接实际收到的消息对照。",{"type":37,"tag":45,"props":1010,"children":1011},{},[1012],{"type":43,"value":1013},"某个步骤失败或缺少所需依据时，在下一次请求中附上该结果，明确继续检查的内容，保留尚未确认的结论。",{"type":37,"tag":64,"props":1015,"children":1017},{"id":1016},"在同一段对话中继续排查",[1018],{"type":43,"value":1016},{"type":37,"tag":45,"props":1020,"children":1021},{},[1022,1024,1030],{"type":43,"value":1023},"会话历史保存此前的问题和工具结果，支持后续查看和继续排查。全屏模式下会话列表在左侧；浮窗中可通过标题栏的历史按钮打开。全屏时双击会话标题，或使用 ",{"type":37,"tag":126,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":43,"value":1029},"···",{"type":43,"value":1031}," 菜单，可修改名称。删除会话时，消息和生成的文件会一并删除。",{"type":37,"tag":45,"props":1033,"children":1034},{},[1035,1037,1042,1044,1049],{"type":43,"value":1036},"对话较长时，MQTTX Agent 会自动将较早的内容整理为摘要，并使用摘要继续对话。点击",{"type":37,"tag":80,"props":1038,"children":1039},{},[1040],{"type":43,"value":1041},"已压缩之前的对话",{"type":43,"value":1043},"分隔线可查看摘要。摘要准备过程中，面板会显示",{"type":37,"tag":80,"props":1045,"children":1046},{},[1047],{"type":43,"value":1048},"正在压缩对话…",{"type":43,"value":93},{"type":37,"tag":45,"props":1051,"children":1052},{},[1053,1055,1061],{"type":43,"value":1054},"输入框下方的上下文栏显示当前模型上下文窗口的占用情况。悬停可查看 token 数量和自动压缩临界点。来自上一次回复的数值是实际值，带 ",{"type":37,"tag":126,"props":1056,"children":1058},{"className":1057},[],[1059],{"type":43,"value":1060},"~",{"type":43,"value":1062}," 的数值为估算值。",{"type":37,"tag":64,"props":1064,"children":1066},{"id":1065},"使用-mcp-服务器提供的工具",[1067],{"type":43,"value":1068},"使用 MCP 服务器提供的工具",{"type":37,"tag":45,"props":1070,"children":1071},{},[1072,1074,1079],{"type":43,"value":1073},"MCP 支持将外部系统的工具接入当前对话。在 ",{"type":37,"tag":80,"props":1075,"children":1076},{},[1077],{"type":43,"value":1078},"设置 → MQTTX Agent → MCP 服务器配置",{"type":43,"value":1080}," 中配置服务器，支持 Streamable HTTP 和 SSE URL：",{"type":37,"tag":1082,"props":1083,"children":1088},"pre",{"className":1084,"code":1086,"language":1087,"meta":30},[1085],"language-json","{\n  \"mcpServers\": {\n    \"weather\": { \"url\": \"http://127.0.0.1:8000/mcp\" },\n    \"legacy\": { \"url\": \"http://127.0.0.1:8001/sse\" }\n  }\n}\n","json",[1089],{"type":37,"tag":126,"props":1090,"children":1091},{"__ignoreMap":30},[1092],{"type":43,"value":1086},{"type":37,"tag":45,"props":1094,"children":1095},{},[1096],{"type":43,"value":1097},"保存配置后，请求执行某个服务器支持的操作，并检查工具结果。可执行的外部操作由已配置的服务器决定。在操作前询问模式下，每次 MCP 工具调用都需要批准。",{"type":37,"tag":64,"props":1099,"children":1101},{"id":1100},"能力参考",[1102],{"type":43,"value":1100},{"type":37,"tag":45,"props":1104,"children":1105},{},[1106],{"type":43,"value":1107},"Agent 可以：",{"type":37,"tag":359,"props":1109,"children":1110},{},[1111,1116,1121,1126,1131,1136,1141,1146],{"type":37,"tag":74,"props":1112,"children":1113},{},[1114],{"type":43,"value":1115},"读取连接配置、TLS 证书信息和分组，创建、修改、删除连接。",{"type":37,"tag":74,"props":1117,"children":1118},{},[1119],{"type":43,"value":1120},"创建免费的临时 Zero EMQX Broker，并保存连接。",{"type":37,"tag":74,"props":1122,"children":1123},{},[1124],{"type":43,"value":1125},"连接与断开、订阅与取消订阅，发布 Plaintext、JSON、Base64 或 Hex 消息。",{"type":37,"tag":74,"props":1127,"children":1128},{},[1129],{"type":43,"value":1130},"开始和停止定时发布、读取已保存的消息、等待新消息，以及清空某个连接的消息。",{"type":37,"tag":74,"props":1132,"children":1133},{},[1134],{"type":43,"value":1135},"在本地检查证书和私钥，文件内容不会发送给模型。",{"type":37,"tag":74,"props":1137,"children":1138},{},[1139],{"type":43,"value":1140},"编写、测试和应用转换函数与 Schema，生成客户端代码和测试数据。",{"type":37,"tag":74,"props":1142,"children":1143},{},[1144],{"type":43,"value":1145},"构建和读取主题树，创建 Dashboard 和组件，以及调整组件的网格位置和大小。",{"type":37,"tag":74,"props":1147,"children":1148},{},[1149],{"type":43,"value":1150},"读取日志、修改支持的应用设置，以及调用已配置的 MCP 工具。",{"type":37,"tag":64,"props":1152,"children":1154},{"id":1153},"消息历史与隐私",[1155],{"type":43,"value":1153},{"type":37,"tag":45,"props":1157,"children":1158},{},[1159],{"type":43,"value":1160},"连接与订阅保持有效时，MQTTX 可以继续接收并保存消息，包括离开连接页面之后。可查看的历史取决于 MQTTX 实际收到并保存了哪些消息。",{"type":37,"tag":45,"props":1162,"children":1163},{},[1164],{"type":43,"value":1165},"对话和工具结果会发送给已配置的模型服务商。工具读取连接时，会遮盖已保存的密码；证书和私钥文件只返回路径，不返回文件内容。在对话中直接输入的文字会原样发送，因此应将凭据保留在相应的配置中。",{"type":37,"tag":64,"props":1167,"children":1169},{"id":1168},"示例把-mqtt-操作与数据展示连起来",[1170],{"type":43,"value":1171},"示例：把 MQTT 操作与数据展示连起来",{"type":37,"tag":70,"props":1173,"children":1174},{},[1175,1187],{"type":37,"tag":74,"props":1176,"children":1177},{},[1178,1180,1185],{"type":43,"value":1179},"完成模型服务商配置并打开 Agent，输入 ",{"type":37,"tag":126,"props":1181,"children":1183},{"className":1182},[],[1184],{"type":43,"value":472},{"type":43,"value":1186},"，选择 Zero EMQX Skill。",{"type":37,"tag":74,"props":1188,"children":1189},{},[1190],{"type":43,"value":847},{"type":37,"tag":509,"props":1192,"children":1193},{},[1194],{"type":37,"tag":45,"props":1195,"children":1196},{},[1197,1199,1204,1206,1212,1214,1220,1221,1227,1228,1234,1235,1241],{"type":43,"value":1198},"创建一个 Zero EMQX 临时 Broker，将连接保存为 Factory Demo 并连接，订阅 ",{"type":37,"tag":126,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":43,"value":675},{"type":43,"value":1205},"。向 ",{"type":37,"tag":126,"props":1207,"children":1209},{"className":1208},[],[1210],{"type":43,"value":1211},"factory/line-01/telemetry",{"type":43,"value":1213}," 逐条发送 12 条包含 ",{"type":37,"tag":126,"props":1215,"children":1217},{"className":1216},[],[1218],{"type":43,"value":1219},"deviceId",{"type":43,"value":105},{"type":37,"tag":126,"props":1222,"children":1224},{"className":1223},[],[1225],{"type":43,"value":1226},"temperature",{"type":43,"value":105},{"type":37,"tag":126,"props":1229,"children":1231},{"className":1230},[],[1232],{"type":43,"value":1233},"humidity",{"type":43,"value":105},{"type":37,"tag":126,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":43,"value":1240},"pressure",{"type":43,"value":1242}," 且数值有变化的 JSON 消息，再创建名为 Factory Overview 的 Dashboard：显示温度、湿度和压力读数，并放一张温度趋势图，最后打开面板。",{"type":37,"tag":70,"props":1244,"children":1246},{"start":1245},3,[1247,1252,1257],{"type":37,"tag":74,"props":1248,"children":1249},{},[1250],{"type":43,"value":1251},"在操作前询问模式中，检查并批准创建、连接、订阅、发布和 Dashboard 操作。保存连接与连接到 Broker 是两个步骤，上面的请求包含两者。",{"type":37,"tag":74,"props":1253,"children":1254},{},[1255],{"type":43,"value":1256},"打开 Factory Demo，确认连接成功、订阅存在，并且指定主题上收到了逐条发送的 JSON 消息。",{"type":37,"tag":74,"props":1258,"children":1259},{},[1260],{"type":43,"value":1261},"打开 Factory Overview，将当前读数与最新收到的消息对照，再选择覆盖这些消息的历史时间范围，检查温度趋势。",{"type":37,"tag":45,"props":1263,"children":1264},{},[1265,1267,1273],{"type":43,"value":1266},"Zero EMQX Broker 免费且隔离，会按服务返回的生命周期到期，适合测试；使用时检查返回的生命周期。密码保存在连接中，不会返回给模型。Dashboard 展示连接已收到的数据。手动配置方式和数据源选项请参阅 ",{"type":37,"tag":965,"props":1268,"children":1270},{"href":967,"rel":1269,"target":970},[969,969],[1271],{"type":43,"value":1272},"Dashboard",{"type":43,"value":93},{"title":30,"searchDepth":1275,"depth":1275,"links":1276},2,[1277,1281,1286,1289,1296,1297,1298,1299,1300,1301],{"id":66,"depth":1275,"text":66,"children":1278},[1279,1280],{"id":301,"depth":1245,"text":301},{"id":343,"depth":1245,"text":343},{"id":406,"depth":1275,"text":409,"children":1282},[1283,1284,1285],{"id":412,"depth":1245,"text":412},{"id":458,"depth":1245,"text":461},{"id":495,"depth":1245,"text":495},{"id":543,"depth":1275,"text":543,"children":1287},[1288],{"id":617,"depth":1245,"text":617},{"id":641,"depth":1275,"text":644,"children":1290},[1291,1292,1293,1294,1295],{"id":647,"depth":1245,"text":647},{"id":692,"depth":1245,"text":692},{"id":897,"depth":1245,"text":897},{"id":920,"depth":1245,"text":923},{"id":951,"depth":1245,"text":951},{"id":978,"depth":1275,"text":978},{"id":1016,"depth":1275,"text":1016},{"id":1065,"depth":1275,"text":1068},{"id":1100,"depth":1275,"text":1100},{"id":1153,"depth":1275,"text":1153},{"id":1168,"depth":1275,"text":1171},"markdown","content:zh:agent.md","content","zh/agent.md","md",1794381304063]