Skip to content

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 ​

EditorWhere
VS Code 1.106 or laterVisual Studio Marketplace
VSCodium and other Open VSX editorsOpen VSX
Cursor, Windsurf, Antigravitythe 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 ​

  1. Open a folder that holds your models (File → Open Folder…).
  2. Open the Modex view in the Activity Bar.
  3. Open a .mo file, 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 ​

CommandWhat it does
Modex: New Modelcreate a Modelica class in the workspace
Modex: Simulate / Modex: Cancel Simulationrun the open model, or stop the run
Modex: Simulation Setupchoose the engine, stop time and other options for a model's runs
Modex: New Figure / Modex: New Documentcreate a .mxfig or .mxdoc
Modex: New draw.io Diagramcreate a .drawio
Modex: Open Agent Settingschoose the AI runtime or provider for the built-in agent
Modex: Copy MCP Config Snippetconnect your own agent — see Claude Code, Codex & MCP
Modex: Show Simulation Outputthe 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.