VS Code extension
The Modex extension adds Modelica, PSCAD, draw.io, figure and document editors to VS Code and to editors built on it. It is a preview release.
Install
| Editor | Where |
|---|---|
| VS Code 1.106 or later | Visual Studio Marketplace |
| VSCodium and other Open VSX editors | Open VSX |
| Cursor, Windsurf, Antigravity | the one-click links on the downloads page |
Release testing covers VS Code on Windows x64 and Linux x64. macOS is supported but not part of release testing, and the editors other than VS Code are not tested yet.
First steps
- Open a folder that holds your models (File → Open Folder…).
- Open the Modex view in the Activity Bar.
- Open a
.mofile, or create one with Modex: New Model. Switch between Diagram, Icon and Text from the editor toolbar.
The first time a model needs the Modelica Standard Library and none is installed, Modex offers to install it (about 16 MB). Manage libraries later under Modex: Settings… → Libraries.
Editing works without a simulation engine. To simulate, set one up first — see Simulation engines — then run Modex: Simulate.
Saving
The extension uses VS Code's own model: an edit, on the canvas or in the text, changes the editor's buffer, and you save it the way you save any file (Ctrl+S, or files.autoSave). VS Code's Local History keeps earlier saved versions.
Settings
Modex: Settings… opens one settings tab with the pages most people need: Models and Agent Tools (AI), Libraries, Simulation, Engines, OpenModelica Toolchain and Python. Everything else is in VS Code's own Settings — search for Modex.
Commands worth knowing
| Command | What it does |
|---|---|
| Modex: New Model | create a Modelica class in the workspace |
| Modex: Simulate / Modex: Cancel Simulation | run the open model, or stop the run |
| Modex: Simulation Setup | choose the engine, stop time and other options for a model's runs |
| Modex: New Figure / Modex: New Document | create a .mxfig or .mxdoc |
| Modex: New draw.io Diagram | create a .drawio |
| Modex: Open Agent Settings | choose the AI runtime or provider for the built-in agent |
| Modex: Copy MCP Config Snippet | connect your own agent — see Claude Code, Codex & MCP |
| Modex: Show Simulation Output | the compiler and simulator log |
AI is optional
Nothing above needs an AI provider. To use the built-in agent, run Modex: Open Agent Settings and pick a runtime: Claude Code and Codex are detected when installed, and GitHub Copilot, API providers and local OpenAI-compatible endpoints are also available. To use an agent you already run instead, see Claude Code, Codex & MCP.
Remote, WSL and containers
The extension runs where VS Code's extension host runs. Under Remote-SSH, WSL, Codespaces or a dev container, install OpenModelica — and PSCAD, for .pscx artwork — on that remote machine, not only on the computer in front of you.
Telemetry
Limited usage telemetry is on by default and follows VS Code's telemetry setting. Turn it off with "modex.telemetry.enabled": false or "telemetry.telemetryLevel": "off". The privacy page lists exactly what is sent.
Uninstalling
If you connected Modex to other AI tools, run Modex: Unregister MCP from AI Tools (or Disconnect all under Agent Tools) before you uninstall, so their configuration files do not keep an entry for a server that is gone.