Content
# Ansys Maxwell MCP Server
[](https://github.com/Jairam-1/ansys-maxwell-pyaedt-mcp/actions/workflows/ci.yml)
[](LICENSE)
[](https://www.python.org/downloads/)
An open-source [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that lets AI assistants drive **Ansys Maxwell** electromagnetic simulations through [PyAEDT](https://aedt.docs.pyansys.com/).
Works with any MCP-compatible client — Claude Code, Claude Desktop, Cursor, or any other compliant tool.
> **Disclaimer:** This is an independent, personal open-source project. It is
> **not affiliated with, endorsed by, or sponsored by ANSYS, Inc.** "Ansys",
> "Maxwell", and "AEDT" are trademarks of ANSYS, Inc. This project is an API
> wrapper that requires you to supply your own licensed Ansys installation; it
> does not include, distribute, or bypass any Ansys software or licensing.
## What it does
| Layer | Capability |
|-------|-----------|
| **Tools** | Launch/close Maxwell, draw geometry (box, cylinder, polyline), assign materials, set boundaries (vector potential, master/slave), create coil & winding excitations, configure EddyCurrent/Transient/Magnetostatic setups, run simulations, extract forces, export field plots, read/write design variables |
| **Resources** | Domain knowledge for SLIM/DSLIM linear-induction-motor modelling — known failure modes, validated workflows, and a complete design vector |
| **Prompts** | `dslim_troubleshooter` for script review against known pitfalls; `maxwell_setup_guide` for step-by-step simulation setup |
## Prerequisites
1. **Python 3.10+**
2. **Ansys Electronics Desktop (AEDT)** installed locally — the MCP server calls PyAEDT, which drives AEDT via COM.
3. **A valid Ansys license** — this project is an API wrapper; it does not include or bypass any Ansys software.
## Installation
```bash
git clone https://github.com/Jairam-1/ansys-maxwell-pyaedt-mcp.git
cd ansys-maxwell-pyaedt-mcp
pip install -e .
```
Or with [uv](https://docs.astral.sh/uv/):
```bash
uv pip install -e .
```
## Configuration
Add the server to your AI client's MCP configuration.
### Claude Code / Claude Desktop
Add to your `claude_desktop_config.json` or `~/.claude.json`:
```json
{
"mcpServers": {
"ansys-maxwell": {
"command": "python",
"args": ["-m", "ansys_maxwell_pyaedt_mcp.server"]
}
}
}
```
### Cursor
Add to `.cursor/mcp.json` in your project:
```json
{
"mcpServers": {
"ansys-maxwell": {
"command": "python",
"args": ["-m", "ansys_maxwell_pyaedt_mcp.server"]
}
}
}
```
## Quick start
Once configured, ask your AI assistant:
> "Launch Maxwell 3D, create a copper box, set up a Magnetostatic simulation, and solve it."
Or for linear-machine work:
> "Read the DSLIM best practices and help me set up a 3-D periodic eddy-current simulation for a 4-pole linear induction motor."
## Tools reference
### Session management
- `launch_maxwell` — Start AEDT and initialise a Maxwell 2-D or 3-D session
- `close_maxwell` — Gracefully release the desktop COM handle
- `set_solution_type` — Switch between EddyCurrent, Transient, Magnetostatic, etc.
- `set_model_depth` — Set the out-of-plane ModelDepth for a 2-D design (mm)
### Geometry
- `create_box` — Draw a 3-D box with material assignment
- `create_cylinder` — Draw a cylinder along any axis
- `create_polyline` — Draw a polyline from vertices
### Materials
- `assign_material` — Apply a material from the Ansys library
- `list_materials` — List available materials
### Boundaries
- `assign_vector_potential` — Apply A = const boundary
- `assign_master_slave` — Apply periodic Master/Slave pair
### Excitations
- `assign_coil` — Assign a coil excitation with turn count and polarity
- `assign_winding` — Group coils into a current or voltage winding
### Simulation
- `assign_force` — Assign a force parameter to an object (before solving)
- `setup_eddy_current` — Configure an EddyCurrent solve
- `setup_transient` — Configure a Transient solve
- `setup_magnetostatic` — Configure a Magnetostatic solve
- `analyze` — Run the simulation (blocking; gates on `setup.is_solved`)
### Post-processing
- `get_forces` — Extract Fx, Fy, Fz for an assigned force from a solved setup
- `export_field_plot` — Export a field overlay as an image
- `get_design_variable` / `set_design_variable` — Read/write parametric variables
## DSLIM resources
This server includes domain-specific resources from research on Double-Sided Linear Induction Motors:
- **`dslim://best-practices`** — Modelling lessons for linear-induction motors in Maxwell: stator feed polarity, the 60° winding belt, pole-count bookkeeping, boundary conditions over gRPC, 2-D ModelDepth, the `is_solved` solve gate, the Russell–Norsworthy edge correction, transient brittleness, and the validated 3-D periodic workflow.
## Development
```bash
git clone https://github.com/Jairam-1/ansys-maxwell-pyaedt-mcp.git
cd ansys-maxwell-pyaedt-mcp
pip install -e ".[dev]"
ruff check . # lint
pytest # test suite (PyAEDT is stubbed, so no Ansys install is needed)
```
CI runs lint, the test suite across Python 3.10–3.12, and a packaging build on
every push and pull request (`.github/workflows/ci.yml`). Pushing a `v*` tag
builds the sdist/wheel and attaches them to a GitHub Release
(`.github/workflows/release.yml`).
## Contributing
Contributions are welcome. Please open an issue first to discuss what you would like to change.
## Disclaimer
This project is an independent, personal open-source effort and is **not
affiliated with, endorsed by, or sponsored by ANSYS, Inc.** "Ansys", "Maxwell",
and "AEDT" are trademarks of their respective owner (ANSYS, Inc.), used here only
to describe interoperability. The software is provided "as is" without warranty
of any kind (see [LICENSE](LICENSE)). You are responsible for holding a valid
Ansys license to use the underlying Ansys Electronics Desktop; this project does
not include or circumvent any Ansys software or licensing mechanism.
## License
[MIT](LICENSE)