4 Commits

Author SHA1 Message Date
48e91a755c Async progress notifications for long-running tools, connection keepalive
Convert scan, analyze, capture, and cal to async with MCP progress
reporting via FastMCP Context. Blocking serial I/O wrapped with
asyncio.to_thread() so the event loop stays free to deliver progress
notifications during hardware sweeps.

Add connection keepalive: _ensure_connected validates stale connections
with a sync probe after 30s idle, and retries on cold-start failures
(fixes flaky first-connect after MCP server restart).
2026-01-30 15:05:50 -07:00
4569fea9f9 Full protocol coverage: 60 tools, 5 prompts, S-parameter math
Phase 1 — Add 33 new tool methods to nanovna.py wrapping every
remaining firmware shell command (measure, config, saveconfig,
clearconfig, color, freq, tcxo, vbat_offset, touchcal, touchtest,
refresh, touch, release, sd_list, sd_read, sd_delete, time, i2c,
si, lcd, threads, stat, sample, test, gain, dump, port, offset,
dac, usart_cfg, usart, band) plus server-side analyze tool.
All capability-gated for firmware variants.

Phase 2 — New prompts.py with 5 FastMCP guided workflows:
calibrate (SOLT), export_touchstone (S1P/S2P), analyze_antenna,
measure_cable, compare_sweeps. Includes HAM_BANDS presets from
160m through 23cm.

Phase 3 — New calculations.py with pure-Python S-parameter math:
swr, return_loss, impedance, admittance, phase_deg, insertion_loss,
group_delay, q_factor, capacitance, inductance, find_resonance,
find_bandwidth, analyze_scan.
2026-01-30 14:24:22 -07:00
68a8705baf capture tool returns PNG Image by default, raw RGB565 optional
- Add Pillow dependency for server-side RGB565→PNG conversion
- capture() now returns fastmcp Image (PNG) by default
- Pass raw=True to get the original RGB565 base64 dict
- Eliminates 204K token overflow on default capture calls
2026-01-30 13:42:10 -07:00
eaa4f1d977 Initial implementation of mcnanovna FastMCP server
NanoVNA-H MCP server with 27 tools for VNA control via USB serial.
Protocol layer handles text + binary scan data parsing, three-phase
initialization sequence, and automatic device discovery (VID 0x0483).

Tools: info, sweep, scan, data, frequencies, marker, cal, save, recall,
pause, resume, power, bandwidth, edelay, s21offset, vbat, capture, trace,
transform, smooth, threshold, reset, version, detect, disconnect,
raw_command, cw
2026-01-30 12:27:47 -07:00