mcp-nec2-antenna
Design and simulate wire antennas using the NEC2 method-of-moments solver via MCP. Supports dipole, Yagi-Uda, vertical, loop, and inverted-V geometries with pattern, impedance, and VSWR analysis.
README
<div align="center">
<img src="assets/logo-banner.svg" alt="mcp-nec2-antenna — NEC2 wire-antenna method-of-moments solver" width="100%"/>
<br/>
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
</div>
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.
Quick start
Install
NEC2C must be on PATH first:
# Ubuntu/Debian
sudo apt install nec2c
# macOS
brew install nec2c
# Arch Linux
yay -S nec2c
Then:
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-antenna
Codex CLI:
codex mcp add nec2-antenna -- uv run --directory /path/to/mcp-nec2-antenna mcp-nec2-antenna
Raw 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 |
|---|---|---|
nec2_create_dipole |
Half-wave horizontal dipole | name, frequency_mhz, height_m |
nec2_create_yagi |
Yagi-Uda directional beam | name, frequency_mhz, num_elements, boom_height_m |
nec2_create_vertical |
Quarter-wave vertical w/ radials | name, frequency_mhz, num_radials |
nec2_create_loop |
Full-wave quad loop | name, frequency_mhz, height_m |
nec2_create_inverted_v |
Inverted-V dipole from a single mast | name, frequency_mhz, apex_height_m, droop_deg |
nec2_simulate |
Run NEC2 sweep — Z, VSWR, gain, pattern | antenna_id, frequency_start/stop_mhz, steps |
nec2_get_nec_cards |
Export raw NEC2 card deck (for 4nec2/xnec2c) | antenna_id |
nec2_list_antennas |
List antennas in the current session | none |
nec2_list_antenna_types |
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
<sub>This MCP server is part of</sub>
<sub>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:</sub>
| Domain | Sibling MCPs |
|---|---|
| RF / Transmission lines | lineforge |
| Circuit + filter sim | mcp-ltspice-qucs |
| PCB / SI | mcp-pcb-emcopilot |
| EMC regulatory | mcp-emc-regulations |
| EM simulation (3D) | mcp-openems |
| Diagrams | drawio-engineering-mcp |
| Lab gear | copper-mountain-vna-mcp |
Contributing
Contributions are welcome.
- Pick a GitHub issue.
- Fork + branch (
feature/your-thingorfix/your-bug). - Run the local check suite:
uv run pytest - Open 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.
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.
<div align="center">
<sub>Part of <a href="https://github.com/RFingAdam/eng-mcp-suite">eng-mcp-suite</a> — built for ham radio operators, RF engineers, and AI agents.</sub>
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。