BL616/BL618 firmware flashing and UART monitoring MCP Server using FastMCP with HTTP transport
Server provides 5 well-intentioned tools with Chinese descriptions and basic parameter schemas. However, critical gaps limit production readiness: (1) Descriptions are present but lack English localization and brevity optimization, many exceed recommended 10-1024 char range when translated mentally; (2) Parameter schemas exist but lack enum constraints for categorical values (chipname, interface); (3) Error handling is basic, tools return plain strings instead of structured JSON with actionable recovery guidance; (4) Output schemas are documented in text but not formalized; (5) Security considerations around serial port access and firmware writing are not explicitly addressed; (6) No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear risk levels. Naming is clear and verb-driven, which is a strength. The tooling follows a coherent domain model (flash→monitor→read→stop), but execution lacks enterprise-grade rigor.
烧录固件到 BL616/BL618。 参数: file - 固件路径,支持 WSL 路径(/home/...、/mnt/c/...)或 Windows 路径 port - 串口号,如 COM6 start_addr - 烧录起始地址,默认 0x10000(从 config.json 读取) chipname - 芯片型号,默认 bl616 baudrate - 波特率,默认 2000000 返回烧录结果摘要和完整日志。
列出当前系统所有可用串口(COM 口)。 返回 JSON 数组,每项包含 port、description、hwid。
读取 UART 监控的增量日志。每次最多返回 200 行。 参数: session_id - start_uart_monitor 返回的 session ID since_index - 上次返回的 new_index(首次调用传 0) 返回 JSON: lines - 本次新增日志行数组 new_index - 下次调用传入的 since_index is_closed - true 表示 session 已停止,Sub-agent 应退出 loop is_error - true 表示串口发生异常 error_msg - 异常描述 total_lines - 本 session 累计接收总行数
开启 UART 后台监控,开始将串口输出录制到内存 RingBuffer(最大 10MB)。 参数: port - 串口号,如 COM6 baudrate - 波特率,默认从 config.json 读取(通常 2000000) 返回 session_id,后续 read_uart_logs / stop_uart_monitor 均需要此 ID。 同一 port 不可重复开启,请先 stop 后再启动。
停止 UART 监控,关闭串口,释放资源。 参数: session_id - start_uart_monitor 返回的 session ID 返回统计信息:总行数、运行时长、因超出 10MB 被丢弃的行数。
All descriptions are in Chinese only. MCP ecosystem is English-first. Non-English descriptions create friction for English-speaking agents and reduce discoverability.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear risk classification. flash_firmware is WRITE with irreversible consequences (firmware overwrite), start_uart_monitor and stop_uart_monitor manage serial resources, but no hints exist to guide agent caution.
Parameter constraints are missing or underspecified. chipname accepts arbitrary strings (should be enum: [bl616, bl618]); start_addr is string without format hint (should specify hex notation); port has no regex (should match COM[1-9][0-9]* on Windows or /dev/tty* on Unix); baudrate has no bounds documentation (should specify min/max).
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | B | 72 | <=2025-11-25 | v2 |
| 2026-03-09 | D | 56 | - | v1 |
Output schemas are documented in natural language but not formally defined in code. flash_firmware returns plaintext summary; start_uart_monitor returns JSON but type not declared; read_uart_logs documents output structure in docstring but code returns raw JSON.dumps(). LLMs cannot reliably extract fields from unstructured descriptions.
Error handling lacks recovery guidance. When session_id not found in read_uart_logs, tool returns is_error=true and error_msg but does NOT suggest 'call start_uart_monitor first'. When firmware file not found, flash_firmware returns friendly message but no suggestion to verify path or list available files. LLMs need actionable next steps, not bare error messages.
Tool interdependencies are not documented. start_uart_monitor returns session_id that MUST be passed to read_uart_logs and stop_uart_monitor. Descriptions mention this but do not explicitly state 'You must call start_uart_monitor before this tool' or 'This tool requires the session_id from start_uart_monitor'. Agents may not infer the correct sequence.
No timeout or resource cleanup documentation. flash_firmware has a 120-second timeout (from config.json) but the tool description does not mention timeout behavior or how to recover if it exceeds timeout. start_uart_monitor allocates a serial port resource, if agent crashes before stop_uart_monitor, resource leaks. No mitigation or cleanup guidance provided.
Security considerations not addressed in tool definitions. flash_firmware accepts file paths with WSL/Windows path conversion, no validation against path traversal or access control checks documented. start_uart_monitor opens serial ports, no permission gate or audit logging. No tool declares required permissions (e.g., 'requires serial port access', 'requires firmware write capability').