cst-sim-agent
中文版
A Claude Code plugin that turns CST Studio Suite into a conversational electromagnetic simulation assistant via MCP.
AI for Science (AI4S) is pushing AI from "chatting" toward "actually doing research and engineering."
For electromagnetic simulation, a real bottleneck is this: an agent needs to operate professional software like CST, yet cannot communicate with it smoothly — even after a successful connection, it doesn't know the correct VBA method names or the CST-adapted Python idioms. General-purpose LLMs were never trained on how to operate CST; writing raw code produces invented phantom methods, and a single (10091) error can waste hours.
cst-sim-agent solves this with a three-layer design: an MCP toolset lets natural language drive modeling → material assignment → port setup → solving → result reading; an embedded domain knowledge base (an 8-domain VBA syntax library, 158 official examples, pitfall checklists) lets the agent look things up and use them directly — without re-reading technical documentation, re-learning interface settings, or even re-learning physics when switching application domains, the way a human engineer would have to; constraint hooks check the library before writing VBA and check the CST message window after execution, guarding against hallucination and silent failure. In end-to-end validation practice, this mechanism completed close to 20 multi-method simulation projects in 2 days (modeling, method switching, parametric comparison) — the same output would take weeks through a purely manual workflow. More importantly, the mechanism self-evolves with your use — every pitfall you hit and every experience you validate is guided back into the knowledge base at wrap-up, forming a "use → consolidate → reuse" loop: the more you use it, the smarter it gets, and the smoother similar tasks run.
Our vision is to bring AI for Science onto engineers' and researchers' simulation workbenches — not to replace engineers, but to extend humanity's ability to do science through physical simulation: leave the repetitive, mechanical operations and cross-domain learning to the agent, keep humans in electromagnetic design and physical judgment, and free human engineers.
Features
| Category | Tools |
|---|
| Connection & project | cst_connect / cst_disconnect / cst_create_project / cst_open_project / cst_save_project / cst_close_project / cst_get_project_state / checkpoint series |
| Geometry query | cst_query_geometry / cst_get_model_tree / cst_get_materials |
| Modeling primitives | cst_create_brick / cst_create_cylinder / cst_create_cone / cst_create_sphere / boolean operations / transforms / delete |
| Materials | cst_create_material / cst_create_sit_material (SIT impedance table) / cst_set_material |
| Solver | cst_set_frequency_range / cst_start_solver / cst_is_solver_running / cst_stop_solver / cst_run_simulation / cst_parameter_sweep |
| SBR/RCS | cst_configure_sbr / cst_run_sbr / cst_farfield_read |
| VBA/scripting | cst_execute_vba (arbitrary CST VBA) |
| Operations | cst_get_messages / cst_check_status / cst_detect_popups / cst_dismiss_popup |
Maturity & verification
This plugin grew out of several CST automation engineering projects, iterated internally over multiple rounds, and passed an independent blind acceptance test before its first public release. Verified coverage: installation & hooks, connecting to a real CST instance, the official patch-antenna tutorial end to end, knowledge base & residue review. Not yet fully covered: multi-version CST compatibility, more complex models, and more tool combinations — these need community developers to validate together.
The end-to-end official example (circular patch antenna, 2–3 GHz) ran through: S11 resonance at 2.40 GHz, matching CST's official tutorial reference value (≈2.4 GHz). See the verification report. Watch the demo video on Bilibili: https://www.bilibili.com/video/BV1CC896qEAt/
Technology selection and design decisions (VBA channel primary, official API auxiliary) are documented in the architecture document.
Prerequisites
- Windows (CST's COM interface lives on Windows)
- CST Studio Suite 2024/2025/2026 (2026 recommended; older versions should work but are not individually verified)
- Python 3.10+ (including the Windows
py launcher — ships with the official Python installer; the MCP server starts via py -3 and does not depend on python being on PATH)
- Python dependencies:
pip install -r requirements.txt (mcp, pywin32)