---
title: mcnanovna Overview
description: MCP server for NanoVNA-H vector network analyzers
---

import { Aside } from '@astrojs/starlight/components';

mcnanovna gives LLMs direct control of NanoVNA-H vector network analyzers over USB serial. It exposes 78 MCP tools for frequency sweeps, S-parameter measurements, calibration, LCD capture, RF analysis, and 3D antenna radiation pattern visualization.

## Capabilities

### Measurement
- Frequency sweeps with configurable start/stop/points
- S11 (reflection) and S21 (transmission) measurements
- Marker-based frequency analysis
- Real-time data streaming

### Calibration
- Full SOLT calibration workflow
- Save/recall calibration to device flash
- Calibration status verification

### Analysis
- SWR, return loss, impedance calculations
- Filter characterization (cutoffs, bandwidth, Q)
- Crystal parameter extraction
- TDR (time domain reflectometry)
- L/C component identification
- Impedance matching network design

### Radiation Patterns
- Analytical 3D patterns from S11 data
- Support for dipole, monopole, EFHW, loop, patch antennas
- Pattern import from CSV, EMCAR, NEC2, Touchstone S1P
- Optional Three.js web viewer

## Supported Hardware

| Device | Frequency Range | Notes |
|--------|----------------|-------|
| NanoVNA-H | 50 kHz - 900 MHz | Original hardware |
| NanoVNA-H4 | 50 kHz - 1.5 GHz | Extended range |

<Aside type="note">
Other NanoVNA variants using the same USB serial protocol (VID 0x0483, PID 0x5740) should also work.
</Aside>

## Architecture

```
┌─────────────────────────────────────────────────────────┐
│                    MCP Client                           │
│                         │                               │
│                    MCP Protocol                         │
│                         ▼                               │
│  ┌─────────────────────────────────────────────────┐   │
│  │              mcnanovna server                    │   │
│  │  ┌─────────┐  ┌────────────┐  ┌─────────────┐  │   │
│  │  │  tools/ │  │ protocol.py│  │calculations │  │   │
│  │  │ 8 mixins│  │  USB serial│  │  S-param    │  │   │
│  │  └────┬────┘  └─────┬──────┘  │  math       │  │   │
│  │       │             │         └─────────────┘  │   │
│  │       ▼             ▼                          │   │
│  │  ┌──────────────────────────────────────────┐ │   │
│  │  │           NanoVNA class                   │ │   │
│  │  │  (connection lifecycle, auto-reconnect)   │ │   │
│  │  └──────────────────────────────────────────┘ │   │
│  └─────────────────────────────────────────────────┘   │
│                         │                               │
│                    USB Serial                           │
│                         ▼                               │
│              ┌──────────────────┐                       │
│              │   NanoVNA-H      │                       │
│              └──────────────────┘                       │
└─────────────────────────────────────────────────────────┘
```

## Connection Lifecycle

1. **First tool call**: Auto-discovers USB device, opens serial at 115200 baud
2. **Idle < 30s**: Trusts existing connection
3. **Idle ≥ 30s**: Sends sync probe to validate; reconnects on failure
4. **Retry**: 2 attempts with 300ms delay on cold/stale ports

No manual connect/disconnect needed—the server manages the connection automatically.
