Metadata-Version: 2.4
Name: mcnanovna
Version: 2026.2.1
Summary: MCP server for NanoVNA-H vector network analyzers
Project-URL: Homepage, https://mcnanovna.l.zmesh.systems
Project-URL: Documentation, https://mcnanovna.l.zmesh.systems
Project-URL: Repository, https://github.com/ryanmalloy/mcnanovna
Author-email: Ryan Malloy <ryan@supported.systems>
License-Expression: MIT
License-File: LICENSE
Keywords: antenna,ham-radio,mcp,nanovna,rf,s-parameters,swr,vna
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Ham Radio
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: fastmcp>=2.14.0
Requires-Dist: pillow>=11.0.0
Requires-Dist: pyserial>=3.5
Provides-Extra: webui
Requires-Dist: fastapi>=0.115.0; extra == 'webui'
Requires-Dist: uvicorn[standard]>=0.34.0; extra == 'webui'
Description-Content-Type: text/markdown

# mcnanovna

MCP server for controlling NanoVNA-H vector network analyzers over USB serial.

Provides 78 tools for frequency sweeps, S-parameter measurements, calibration, LCD capture, RF analysis, 3D antenna radiation pattern visualization, and pattern import from external files.

## Installation

```bash
# From PyPI (when published)
uvx mcnanovna

# From source
uv run mcnanovna

# With optional web UI for 3D pattern visualization
uv sync --extra webui
MCNANOVNA_WEB_PORT=8080 uv run mcnanovna
```

## Quick Start

Just plug in your NanoVNA-H and start the server. The device auto-connects on first tool call.

```bash
# Add to Claude Code
claude mcp add mcnanovna -- uvx mcnanovna
```

Then ask Claude to scan your antenna, analyze a filter, or measure a crystal.

## Tools

### Measurement
`info`, `sweep`, `scan`, `data`, `frequencies`, `marker`, `cal`, `save`, `recall`, `pause`, `resume`

### Configuration
`power`, `bandwidth`, `edelay`, `s21offset`, `vbat`, `capture`, `measure`, `config`, `saveconfig`, `clearconfig`, `color`, `freq`, `tcxo`, `vbat_offset`, `threshold`

### Display
`trace`, `transform`, `smooth`, `touchcal`, `touchtest`, `refresh`, `touch`, `release`

### Device
`reset`, `version`, `detect`, `disconnect`, `raw_command`, `cw`, `sd_list`, `sd_read`, `sd_delete`, `time`

### Diagnostics
`i2c`, `si`, `lcd`, `threads`, `stat`, `sample`, `test`, `gain`, `dump`, `port`, `offset`, `dac`, `usart_cfg`, `usart`, `band`

### Analysis
`analyze`, `export_touchstone`, `export_csv`, `analyze_filter`, `analyze_xtal`, `analyze_tdr`, `analyze_component`, `analyze_lc_series`, `analyze_lc_shunt`, `analyze_lc_match`, `analyze_s11_resonance`

### Radiation Patterns
`radiation_pattern`, `radiation_pattern_from_data`, `radiation_pattern_multi`

### Pattern Import
`import_pattern_csv`, `import_pattern_emcar`, `import_pattern_nec2`, `import_pattern_s1p`, `list_pattern_formats`

## Prompts

| Prompt | Description |
|--------|-------------|
| `calibrate` | SOLT calibration walkthrough |
| `export_touchstone` | S-parameter export to .s1p/.s2p |
| `analyze_antenna` | SWR, impedance, bandwidth analysis |
| `measure_cable` | TDR and cable characterization |
| `analyze_crystal` | Crystal motional parameter extraction |
| `analyze_filter_response` | Filter type classification and cutoffs |
| `measure_tdr` | Time domain reflectometry |
| `compare_sweeps` | Before/after comparison |
| `measure_component` | Unknown L/C/R identification |
| `measure_lc_series` | Series LC resonator measurement |
| `measure_lc_shunt` | Shunt LC resonator measurement |
| `impedance_match` | L-network matching design |
| `visualize_radiation_pattern` | 3D pattern from S11 scan |
| `import_pattern` | Load patterns from CSV/EMCAR/NEC2/S1P |
| `measure_antenna_range` | Automated 3D pattern with positioner |

## Web UI

Enable the optional 3D radiation pattern viewer:

```bash
uv sync --extra webui
MCNANOVNA_WEB_PORT=8080 uv run mcnanovna
```

Open http://localhost:8080 for an interactive Three.js visualization of antenna patterns.

## Antenna Positioner Integration

For automated 3D pattern measurement, use together with [mcpositioner](../mcpositioner/):

```bash
claude mcp add mcpositioner -- uvx mcpositioner
claude mcp add mcnanovna -- uvx mcnanovna
```

The `measure_antenna_range` prompt guides through the cross-server workflow.

## Supported Hardware

- NanoVNA-H (original)
- NanoVNA-H4
- Other variants using the same USB serial protocol (VID 0x0483, PID 0x5740)

## License

MIT
