mcp-nec2-antenna
This server enables AI agents to design, simulate, and analyze wire antennas using the NEC2 method-of-moments solver via the Model Context Protocol. Capabilities include:
Antenna design: Create half-wave dipoles, Yagi-Uda beams, quarter-wave verticals with ground radials, full-wave quad loops, and inverted-V dipoles, with customizable frequency, height, wire radius, element counts, radial counts, and droop angle.
Simulation: Run NEC2 frequency sweeps to obtain impedance, VSWR, gain, and radiation patterns.
Export: Generate raw NEC2 card decks for use with external tools like 4nec2 or xnec2c.
Session management: List all active antenna designs and browse built-in antenna types.
Ground models: Support free-space, perfect (PEC), and real (Sommerfeld) ground options.
Integration: Seamlessly works with MCP clients such as Claude Desktop, Claude Code, and Codex CLI, and is part of the eng-mcp-suite for broader RF engineering workflows.
Engine: Wraps the canonical NEC2C implementation for accurate simulations.
Integrates with the NEC2 method-of-moments solver to design and simulate wire antennas, returning impedance, VSWR, gain patterns, and radiation lobes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-nec2-antenna Design a 3-element Yagi for 145 MHz"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Design and simulate wire antennas with the NEC2 method-of-moments solver, driven over MCP. Gain patterns, impedance, VSWR, radiation lobes: from your terminal or AI agent.
Quick start · Tools · Workflows · Documentation
What is mcp-nec2-antenna?
mcp-nec2-antenna is an MCP server that wraps NEC2 (Numerical Electromagnetics Code, version 2). The classic method-of-moments wire-antenna solver, so an LLM agent can design, sweep, and analyze HF / VHF / UHF antennas through plain-English tool calls.
Drive it from any MCP client (Claude Desktop, Claude Code, Codex CLI)
or call the NEC2C binary directly via the same card-deck export. Five
parameterized antenna geometries (dipole, Yagi-Uda, ground-plane
vertical, full-wave loop, inverted-V) compile to NEC2 GW/EX/FR/RP cards,
solve with the nec2c reference engine, and return impedance, VSWR,
gain, and front-to-back from a single tool call.
What mcp-nec2-antenna does well:
AI-native via MCP. First-class Model Context Protocol server with 9 tools. Any Claude / LLM agent can drive it.
Reference engine. Uses the canonical NEC2C C implementation. The same solver behind 4nec2, xnec2c, and antenna textbooks.
Parameterized geometries. Five built-in wire antennas with closed-form initial sizing; the agent fills in band + height + element count and gets a ready-to-solve deck.
Three ground models. free-space, perfect ground, real (Sommerfeld) ground: picked per geometry.
AGPL-3.0-or-later. Modifications shared back if served over a network.
Related MCP server: mcp-openems
Quick start
Install
NEC2C must be on PATH first:
# Ubuntu/Debian
sudo apt install nec2c
# macOS
brew install nec2c
# Arch Linux
yay -S nec2cThen:
git clone https://github.com/RFingAdam/mcp-nec2-antenna.git
cd mcp-nec2-antenna
uv pip install -e .Wire it into your MCP client
Claude Code:
claude mcp add nec2-antenna -- uv run --directory /path/to/mcp-nec2-antenna mcp-nec2-antennaCodex CLI:
codex mcp add nec2-antenna -- uv run --directory /path/to/mcp-nec2-antenna mcp-nec2-antennaRaw config (Claude Desktop):
{
"mcpServers": {
"nec2-antenna": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-nec2-antenna", "mcp-nec2-antenna"]
}
}
}Then ask your assistant in plain English:
"Design a 5-element Yagi for 435 MHz at 10 m height, simulate it, and tell me the gain and front-to-back."
The agent calls nec2_create_yagi followed by nec2_simulate, and
reports impedance, VSWR, and radiation pattern.
Tools
Tool | Purpose | Key arguments |
| Half-wave horizontal dipole |
|
| Yagi-Uda directional beam |
|
| Quarter-wave vertical w/ radials |
|
| Full-wave quad loop |
|
| Inverted-V dipole from a single mast |
|
| Run NEC2 sweep: Z, VSWR, gain, pattern |
|
| Export raw NEC2 card deck (for 4nec2/xnec2c) |
|
| List antennas in the current session | none |
| Show built-in antenna types + characteristics | none |
Full tool reference in docs/tools.md.
What it solves
Antenna | Typical gain | Pattern | Best for |
Dipole | 2.15 dBi | Omnidirectional | General purpose, portable |
Yagi-Uda | 7–15 dBi | Directional | DX, satellites, weak-signal work |
Vertical | 0–2 dBi | Omnidirectional | Mobile, limited real estate |
Loop | 3–4 dBi | Bidirectional | Low-noise receive, DX |
Inverted-V | 2 dBi | Omnidirectional | Single-mast portable |
Ground models: free-space, perfect (PEC), and real (Sommerfeld two-medium). Pattern step is configurable; default is 5° azimuth/elevation.
Workflows
mcp-nec2-antenna fits in the following eng-mcp-suite workflow bundles:
rf-design: closed-form trans-line synthesis (lineforge) + wire-antenna MoM (this server) + circuit/filter sim (mcp-ltspice-qucs).antenna-bench: antenna design + EMC limit lookup (mcp-emc-regulations) before lab measurement.
See the suite manifest for the full list of sibling MCPs and bundle definitions.
Documentation
Quick Start: install through first call.
Tool reference. Every MCP tool, every argument.
Usage examples: practical end-to-end walkthroughs.
Architecture: how this MCP fits in eng-mcp-suite.
Part of eng-mcp-suite
This MCP server is part of
An open umbrella for engineering MCP servers across RF, EMC, PCB, signal integrity, EM simulation, and lab test. Same brand, same docs structure, designed to compose. See the full catalog or jump to a sibling:
Domain | Sibling MCPs |
RF / Transmission lines | |
Circuit + filter sim | |
PCB / SI | |
EMC regulatory | |
EM simulation (3D) | |
Diagrams | |
Lab gear |
Contributing
Contributions are welcome.
Pick a GitHub issue.
Fork + branch (
feature/your-thingorfix/your-bug).Run the local check suite:
uv run pytestOpen a PR: link the issue, request review.
License
AGPL-3.0-or-later. Relicensed from Apache-2.0 in v0.2.0 to align with the eng-mcp-suite toolkit-wide AGPL move. The underlying NEC2 engine is public-domain US-government code; this wrapper is AGPL-3.0-or-later and is independent of NEC2's public-domain status.
Trademarks and brand assets
This project is not affiliated with, endorsed by, or sponsored by Lawrence Livermore National Laboratory or any distributor of NEC2. "NEC2" is used here only to identify the electromagnetics code this project interoperates with.
The project name and the logo files in this repository are not part of the licensed work. The licence above grants no permission to use them, except as needed to describe the origin of the work.
Acknowledgments
Gerald J. Burke (LLNL): original NEC2 Fortran (1981, public domain).
Neoklis Kyriazis (5B4AZ): NEC2C C port, the reference engine this server invokes.
The MCP working group: for the Model Context Protocol specification.
Part of eng-mcp-suite: built for ham radio operators, RF engineers, and AI agents.
Available Tools
9 toolsnec2_create_dipoleB
Create a half-wave dipole antenna. Returns antenna ID for simulation.
Inputs: name (required), frequency_mhz (required), height_m, wire_radius_mm.
nec2_create_inverted_vA
Create an inverted-V dipole antenna (requires only one support).
Inputs: name (required), frequency_mhz (required), apex_height_m, droop_angle_deg.
nec2_create_loopB
Create a full-wave loop antenna (quad configuration).
Inputs: name (required), frequency_mhz (required), height_m.
nec2_create_verticalB
Create a quarter-wave vertical antenna with ground radials.
Inputs: name (required), frequency_mhz (required), num_radials.
nec2_create_yagiB
Create a Yagi-Uda directional antenna with specified number of directors.
Inputs: name (required), frequency_mhz (required), num_directors, height_m.
nec2_get_nec_cardsA
Get the raw NEC2 card deck for an antenna design (for manual editing or external tools).
Inputs: antenna_id (required).
nec2_list_antennasA
List all antenna designs in the current session.
Inputs: no named parameters.
nec2_list_antenna_typesB
List available antenna types and their characteristics.
Inputs: no named parameters.
nec2_simulateA
Run NEC2 simulation on an antenna to get impedance and radiation pattern.
Inputs: antenna_id (required), frequency_start_mhz, frequency_end_mhz, frequency_steps.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct antenna type or action (creation of specific antennas, listing, raw card access, simulation). No overlap in functionality, making it easy for an agent to select the correct tool.
All tools follow the consistent pattern 'nec2_<verb>_<noun>', with verbs like create, get, list, and simulate. The prefix is uniformly applied, and naming is predictable.
With 9 tools, the set covers the essential operations for antenna design and simulation without being excessive. Each tool serves a clear purpose, and the count is appropriate for the domain.
The tool set provides creation of common antenna types, listing, simulation, and raw card access. However, it lacks update or delete tools for antennas, which would complete the lifecycle. Overall, core workflows are covered.
Maintenance
Related MCP Connectors
Amateur radio MCP server with band plans, EIRP, cable loss, antenna gains, and more
N2YO MCP — wraps the N2YO Satellite Tracking REST API (n2yo.com)
MCP server for aerospace calculations: orbital mechanics, ephemeris, DSN operations, ...
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for rftools.io — 213 RF & electronics calculators + 13 server-side simulation tools for AI agents. Give Claude, Cursor, or any MCP-compatible AI assistant access to validated engineering calculators and heavy server-side simulations. Microstrip impedance, link budgets, filter design, converter sizing, antenna patterns, and 190+ more calculators — plus NEC2 antenna simulation, FDTD, Mon1,472 npm8MIT
- AlicenseAqualityCmaintenanceEnables AI-assisted design of antennas and electromagnetic structures using openEMS FDTD simulation, with analytical dimension calculators and full-wave script generation.163AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables natural-language-driven modeling, simulation, and optimization of antennas in CST Studio Suite, covering geometry, materials, ports, solvers, S-parameters, far-field analysis, parameter sweeps, and optimization via 73 MCP tools.3MIT
- AlicenseAqualityBmaintenanceEnables RF and microwave engineers — or any MCP client — to convert impedances, analyze transmission lines and ladder circuits, synthesize L/Pi/T/stub/quarter-wave matching networks, and evaluate transistor S-parameters, stability, gain and noise circles. It also renders publication-quality Smith charts and returns human-readable summaries in English or Turkish over stdio or Streamable HTTP.14MIT