Build your SysML v2 model together with your AI agent. SysMLv2 Modeler is a Visual Studio Code (VS Code) extension for MBSE that lets you and your AI agent work on the same model, in text and on diagrams.

This guide uses the included sample, a small delivery robot, to walk you through the basics in three steps: exploring the model, connecting your AI agent, and editing with AI and by hand. The sample contains nine diagrams that cover all eight standard SysML v2 view kinds.

Contents

1. Installation

System requirements

Before installing, make sure your computer runs on one of the supported platforms.

Supported platforms Windows (x64), macOS (Apple Silicon), and Linux (x64). Windows on ARM64 and Intel-based Macs are not supported.

Install VS Code

If you don’t have VS Code yet, follow the instructions in Download and install Visual Studio Code.

Install SysMLv2 Modeler

  1. Start VS Code and open the Extensions view from the Activity Bar on the left (the four-squares icon, ⌘/Ctrl+Shift+X).
  2. Click … at the top right of the Extensions view → Install from VSIX…, and select the .vsix file you received.
The … menu at the top right of the Extensions view, with Install from VSIX… highlighted
  1. The first time, you are asked to accept the license agreement. Review it, accept, and reload the window when prompted.
  2. When the SysML v2 icon appears in the Activity Bar, you’re done.
The SysML v2 icon in the Activity Bar, with the SysML v2 Models view open

Disable other SysML v2 extensions. If another SysML v2 or KerML extension (for language support, syntax highlighting, and so on) is installed, it may take over .sysml files, and SysMLv2 Modeler may not work correctly. When SysMLv2 Modeler starts, it tells you the name of any other SysML extension that is enabled.

To fix this, type sysml in the Extensions view search box, disable (or uninstall) every SysML-related extension except SysMLv2 Modeler, and reload the window.

No further setup required. The extension comes bundled with a Java runtime and the SysML v2 standard library. There’s nothing else to install and no server to run.

Open the sample model

  1. Copy the entire sample folder included with this guide to a working folder.
  2. In VS Code, choose File → Open Folder… and select the copied sample folder.
  3. When VS Code asks “Do you trust the authors of the files in this folder?”, choose Yes, I trust the authors. The extension doesn’t run in Restricted Mode, which VS Code uses for folders you don’t trust.
  4. Click the SysML v2 icon in the Activity Bar. The sample appears in the Model Tree. The first time, this may take up to a minute while the standard library loads.
The Model Tree showing “Sample: a small delivery robot”, with MiniRobot.sysml open in the editor

What’s in the sample A delivery robot simplified to four parts (sensor, controller, drive, and battery), three requirements (Payload, StopForPeople, and Endurance), three behaviors (Deliver, DrivingState, and StopSequence), and a 3D outline. The MiniRobotViews package contains nine diagrams (view declarations).

2. Exploring a model

You can explore the same model in three ways: as text, in the Model Tree, and on diagrams.

As text

Open MiniRobot.sysml from the Explorer or the Model Tree to see the model as SysML v2 text.

MiniRobot.sysml open in the editor with syntax highlighting, the type name PersonSensor selected, and the Model Tree on the left
With the cursor on PersonSensor, press F12 to go to its definition.

Use these commands to navigate the text.

TaskHow
Go to a definitionF12 or ⌘/Ctrl+click
Go backCtrl+- (macOS), Alt+← (Windows), Ctrl+Alt+- (Linux)
Find where an element is usedRight-click → Find All References
List all elements in a fileOutline view
Find an element by name and jump to it⌘/Ctrl+Shift+O (Go to Symbol in Editor). A list appears at the top of the window. Type to filter it.
See an element’s descriptionHover over its name

In the Model Tree

The Model Tree shows the model in the open folder, organized by ownership. Double-click an element to open it in the text editor, or right-click it and choose Open Diagram to see it on a diagram.

The Model Tree with the sample expanded to DeliveryRobot, and its right-click menu showing Open in Text Editor and Open Diagram

On diagrams

There are two ways to open a diagram.

A. From a view declaration (a saved diagram)

The MiniRobotViews package at the end of the sample contains view declarations such as view structure : InterconnectionView { expose …; }. A view declaration saves what the diagram shows, so it opens with the same contents every time. To save the layout as well, switch to manual layout (see Saving diagrams).

To open one, click Open Diagram above the declaration in the editor.

MiniRobot.sysml in the editor, with Open Diagram links shown above the MiniRobotViews package and each view declaration

Or double-click the view in the Model Tree. You can also right-click the view and choose Open Diagram.

The views under MiniRobotViews in the Model Tree, with the right-click menu on requirements showing Open in Text Editor and Open Diagram
The views are listed under MiniRobotViews in the Model Tree.

B. From a model element (a temporary diagram)

Place the cursor on an element in the text (for example, part def DeliveryRobot) and press ⌘/Ctrl+Shift+V. Or right-click the element in the Model Tree and choose Open Diagram.

A list appears at the top of the window, in two groups:

  • Existing diagrams (upper group): saved diagrams that already show the element, such as the ones in A. Choose one to open it.
  • Create a new diagram (lower group): diagram kinds, such as InterconnectionView and StateTransitionView. Only the kinds that suit the element are listed. Choose one, and a diagram centered on that element opens right away.
The Open Diagram picker for DeliveryRobot, listing existing diagrams and the diagram kinds InterconnectionView and GeneralView

This new diagram isn’t saved yet. If you close it without saving, it’s discarded. To keep it, right-click its background and choose Save This Diagram to .sysml (Add View Declaration).
The diagram is saved as a view declaration. (This menu item doesn’t appear on diagrams that are already saved.)

An InterconnectionView of DeliveryRobot with the right-click menu open and Save This Diagram to .sysml (Add View Declaration) highlighted

From a diagram back to the text

Press F12 in a diagram to go back to the text. If an element is selected, you jump to its declaration. If nothing is selected, you jump to the diagram’s view declaration.

Views in the sample

The sample contains nine diagrams that cover all eight standard SysML v2 view kinds. GeneralView is used twice.

requirements GeneralView
requirementsGeneralView
Requirement text, constraints, and subject.
robotDefinition GeneralView
robotDefinitionGeneralView
Definitions and parts as a general graph.
structure InterconnectionView
structureInterconnectionView
Parts, ports, and flows.
deliveryFlow ActionFlowView
deliveryFlowActionFlowView
The order of actions.
drivingStates StateTransitionView
drivingStatesStateTransitionView
States and transitions.
stopSequence SequenceView
stopSequenceSequenceView
Messages exchanged between parts.
traceMatrix GridView
traceMatrixGridView (beta)
Which part satisfies which requirement.
partsTree BrowserView
partsTreeBrowserView
The ownership hierarchy as a tree.
outlineShape GeometryView
outlineShapeGeometryView
3D shapes and their placement, using the Geometry library.

Zooming and panning

TaskHow
Zoom in or out⌘/Ctrl+wheel or trackpad pinch, ⌘/Ctrl+= / ⌘/Ctrl+-, or + / − on the panel at the bottom left
Reset to 100%⌘/Ctrl+0, or click the zoom percentage on the panel
Fit the diagram to the window⌘/Ctrl+9, or ⛶ on the panel
PanThe wheel scrolls up and down, and Shift+wheel scrolls sideways. You can also drag with Space held down, or with the middle or right mouse button, or drag the frame in the minimap at the bottom right.
Select an areaDrag the background with the left mouse button
A whole diagram with the zoom and layout panel at the bottom left and the minimap at the bottom right
Bottom left: zoom, fit, layout mode (auto or manual), auto layout, and more. Bottom right: minimap. Top right: button to open the palette

3. Connecting your AI agent

Connect the AI agent you use through MCP (a standard way to give AI agents access to tools). You’re not tied to any particular AI service. The connected AI can see the open diagram (as an image and as structure), your current selection, and the model structure. It can explain them, and when you ask for a change, it edits the .sysml files directly.

How your design data is handled

  • The model stays in your local .sysml files. It leaves your computer only through features you start yourself, such as AI integration and the @sysml chat.
  • The MCP server accepts connections only from this computer (127.0.0.1).
  • What you show the connected AI is handled according to that AI service’s terms. Connect only AI services approved by your organization.

① Turn on MCP

In Settings (⌘/Ctrl+,), search for sysmlv2-modeler.mcp.enabled and select the checkbox (off by default).

VS Code Settings searched for sysmlv2-modeler.mcp.enabled, with the Mcp: Enabled checkbox selected

② Register it with your AI agent

How you register depends on your AI agent.

  • GitHub Copilot (VS Code chat): no registration needed. Step ① is enough.
  • Claude Code or Codex (in a terminal or as a VS Code extension):
  1. Open the Command Palette (⌘/Ctrl+Shift+P) and run SysML: Show MCP Connection Information.
The Command Palette with SysML: Show MCP Connection Information highlighted
  1. Click Copy Claude Code Command (or Copy Codex Command).
The MCP Connection Information dialog with Copy Claude Code Command highlighted
  1. Open a terminal in the sample folder, then paste and run the command.
    On Windows with Claude Code, use the terminal inside VS Code (View → Terminal). A terminal outside VS Code may write the drive letter differently (C:\ vs. c:\), and the Claude Code extension then doesn’t see the registration. If it still doesn’t appear, add -s user to the command.
  • Other agents: follow your agent’s documentation and register the following as an MCP server.
ItemValue
TypeMCP server (HTTP, Streamable HTTP)
URLRun SysML: Show MCP Connection Information and click Copy URI (http://127.0.0.1:<port>/mcp/…)
NameAny name (for example, sysmlv2)
RequirementThe AI agent must run on this computer

Register once per workspace (folder). This doesn’t apply to GitHub Copilot.

  • By default, the MCP port is different for each workspace (folder) you open. It stays the same for the same workspace, even after a restart. When you open a different workspace, register again there.
  • Claude Code remembers registrations per folder (project), so run the command in a terminal opened in that workspace’s folder. Even when you switch between workspaces, each one connects to its own MCP server.
  • Codex keeps only one registration overall, and registering again under the same name replaces the previous one. When you switch to a different workspace, register again.
  • If you fix the port, you don’t need to register again when you reopen the same workspace. Set sysmlv2-modeler.mcp.httpPort to a number (for example, 23456) in your user settings. The end of the URL (/mcp/…) differs per workspace, so in a different workspace, register again with the command you copy there. Only one window at a time can use that port. Windows opened later use a different, temporary port.
  • If the same workspace is open in two windows, the second window uses a different, temporary port. If you can’t connect, first check the actual port in SysML: Show MCP Connection Information.

After registering, start a new AI conversation. Many AI agents load MCP registrations when a conversation starts, so a conversation that was already open can’t use the new connection. In Claude Code, type /mcp in a new conversation. When sysmlv2 shows as connected, you’re ready.

③ Talk to it

Try asking the AI the following. If the first one opens a diagram, you’re connected.

  • “Open the structure diagram.” — the AI opens the diagram in VS Code.
  • “Look at this diagram and explain what the controller does.” — the AI reads the open diagram and explains it.
  • “What have I selected?” (select an element in a diagram first) — the AI reads your selection.

Environments that can’t connect The MCP server accepts connections only from this computer, so AI agents that run only on another computer or in the cloud (such as an AI you use only in a browser) can’t connect. If several people use this computer, click Turn On Authentication in SysML: Show MCP Connection Information to require approval for each connection. (The AI agent must support MCP authentication.)

4. Editing a model

You can create a new model, or edit an existing one in three ways: ask AI, edit the text, or edit the diagram. All three change the same .sysml text.

Create a new model (.sysml)

When there is no model (.sysml) yet

  1. Open an empty folder, then click the New Model or Diagram button (the file icon with ⊕, shown when you hover over the tree) at the top of the Model Tree.
  2. In “What do you want to start from?”, pick a starting point. GeneralView starts blank; the other four (InterconnectionView, ActionFlowView, StateTransitionView, SequenceView) start with a template.
The New Model or Diagram button at the top of the Model Tree and the list of starting points: GeneralView, InterconnectionView, ActionFlowView, StateTransitionView, and SequenceView
  1. Choose a file name. The .sysml file is created and its diagram opens. From there, open the palette with the button at the top right of the diagram and place elements.
A new model.sysml file and its empty diagram, with the palette open showing the Place, Attach, and Connect groups

Adding a diagram to an existing .sysml

  1. In the Model Tree, select the package that should hold the diagram.
  2. Click New Model or Diagram at the top of the tree (or right-click the package → New SysML Diagram…) and choose the kind and a name.
  3. A container element (for a SequenceView, an occurrence def) and a view declaration are added to the package, and a diagram with a template opens.

You can also ask AI. Ask something like “Create a structure diagram of a cleaning robot from scratch,” and the AI writes the .sysml and the view declaration for you.

Ask AI

The easiest way to edit is to describe the change to the AI (set up in Connecting your AI agent). The AI edits the .sysml file, and open diagrams update immediately.

  • “Add the 0.5-second stopping time in StopForPeople (R2) as a constraint.”
  • “Add motor and brake parts to the drive, and show them in the structure diagram.”
  • “Add a charging state to DrivingState with transitions to and from idle.”

Check the result. After the AI makes a change, ask “Check for problems.” The AI reads the editor’s diagnostics (the same errors shown as red squiggles) and reports them.

Work back and forth with the AI. This is how the tool is meant to be used. For example, ask the AI to “add a motor and a brake to the drive,” tidy up the layout and names on the open diagram yourself, and then ask the AI, “Look at the structure diagram. Are any connections missing?” Whoever makes the changes, and in whatever order, the same .sysml keeps growing.

Edit the text

These features help you as you edit models in text:

  • Completion: suggestions appear as you type (press Ctrl+Space if they don’t). For example, type battery. to see its ports.
  • Checks as you type: errors show as red squiggles and are listed in the Problems panel (⌘/Ctrl+Shift+M).
  • Rename: put the cursor on a name and press F2. The declaration and every reference to it change together.
  • Formatting: right-click anywhere in the text editor and choose Format Document.
// Example: add a brake inside DeliveryRobot
part brake : DriveUnit;

Save (⌘/Ctrl+S) and the open diagrams reflect the change.

Edit the diagram

InterconnectionView with the palette open
The palette, opened with the button at the top right. Items are grouped into Quick, Place, Attach, and Connect.
TaskHow
Add an elementDrag a palette item onto the diagram (or select it, then click the diagram). Dropping it inside a part creates it inside that part.
Draw a relationshipChoose a kind under Connect, then click the source and the target. Flows between ports work too.
Change a name or valueSelect it and press F2 (or double-click the label). References in the text change too.
Add quicklyWhen you select an element, a small command bar (the quick palette) appears nearby, with shortcuts for relationships, navigation, and other commands.
DeleteDelete. It is removed from the text as well.
Move and alignDrag (alignment guides appear and snap). Select several and press Alt+Shift+arrow keys to align.

Elements keep moving? In auto layout mode (the default), the diagram rearranges itself every time you add an element. Click Pause Auto Layout (⏸) on the panel at the bottom left to stop this, and click it again to resume.

Save from the text tab. Edits made on a diagram go first into the (unsaved) .sysml text. Press ⌘/Ctrl+S in the text tab to save them.

5. Good to know

.sysml files and the model

  • The text is the source of truth: the model is the text of the .sysml files (the standard SysML v2 textual notation). Diagrams draw that text, and diagram layout is also stored inside the view declarations.
  • One folder, one model: all .sysml files in the opened folder are loaded together and can refer to each other. .project.json marks the folder as a project.
  • Standard library: packages such as ISQ::* (quantities) and SI::* (units) come from the bundled standard library.
  • It’s plain text: diffs, reviews and history in git work just as they do for source code.

When in doubt, ask AI

If you’re unsure how to write something in SysML v2, asking AI is the shortcut: “What’s the difference between satisfy and verify?”, “Write a test case that verifies this requirement”, “Which parts are not on this diagram?”. The AI reads the model structure and the diagram on screen, and can confirm its edits against the editor’s diagnostics.

Auto and manual layout

Switch the layout mode on the panel at the bottom left of a diagram.

ModeBehaviorGood for
Auto (default)Rearranges the whole diagram whenever elements are added or removed. Layout is not written back to the .sysml.Building up a model; checking its structure
ManualExisting elements never move automatically; only newly added elements are placed. Positions are saved in the view declaration, so the diagram opens the same way next time.Finishing diagrams for documents

In either mode, Auto Layout on the panel (⌘/Ctrl+Shift+L) rearranges once. Click the Auto layout and display settings button on the panel to choose the layout algorithm, direction, spacing, and edge routing (Orthogonal, Polyline, or Splines) for each diagram.

The Auto layout and display settings button on the panel at the bottom left, with its settings open: algorithm, direction, spacing, port labels, and edge routing

View declarations and expose

Diagrams are written as view declarations in the .sysml. The expose lines decide which elements appear.

view structure : StandardViewDefinitions::InterconnectionView {
    expose MiniRobot::DeliveryRobot;      // show this element (and its contents)
}
view requirements : StandardViewDefinitions::GeneralView {
    expose MiniRobot::Payload;            // you can list elements one by one
    expose MiniRobot::StopForPeople;
}
view everything : StandardViewDefinitions::GeneralView {
    expose MiniRobot::*;                  // everything directly in the package
}
  • The : …View part is the kind of diagram. There are eight kinds: GeneralView, InterconnectionView, ActionFlowView, StateTransitionView, SequenceView, GridView, BrowserView, and GeometryView.
  • The label at the top left of a diagram’s frame shows the view’s name and kind. The box at the top right lists its exposes.
The frame label «view» MiniRobotViews::requirements : GeneralView at the top left, and the box listing three expose lines at the top right
  • To add a new diagram, see Create a new model (.sysml).
  • Put view declarations in a package of their own (like MiniRobotViews in the sample) to keep the model tidy.

Saving diagrams

You can save a diagram at two levels:

What is savedHowNext time you open it
Declaration only
(what the diagram shows)
On a diagram opened from a model element (see On diagrams), right-click the background → Save This Diagram to .sysml (Add View Declaration). A view with its exposes is written.It opens with the same elements. The layout is computed by auto layout each time.
With layout
(positions, sizes, edge shapes)
Switch the view’s diagram to manual layout, arrange it, then press ⌘/Ctrl+S in the text tab. Layout is written inside the view declaration.It opens exactly as you arranged it.

Positions moved in auto layout are not saved. In auto layout mode, moving elements changes only the screen, not the .sysml. When you reopen the diagram, the auto layout returns. To keep a layout, switch to manual layout first.

Switching from manual to auto layout deletes the saved layout. You’re asked to confirm first, and you can undo it with ⌘/Ctrl+Z.

Compartments

The sections separated by horizontal lines inside an element are compartments. They group an element’s contents by kind, such as attributes, parts, ports, doc, and require constraints (see Views in the sample).

The Payload requirement with four compartments: doc, attributes, subject, and require constraints
  • To choose which compartments an element shows, select it and use the compartment button in the quick palette, or right-click it and choose Compartments….
  • To edit a compartment row directly, select it and press F2 (for example, the battery’s capacity = 880 [W * h] in the structure diagram).

GridView (trace matrix) (beta)

A GridView shows model elements and relationships as a table. The sample’s view traceMatrix is a matrix of parts (rows) and requirements (columns) that shows which part satisfies which requirement.

  1. In Settings, search for sysmlv2-modeler.enableBetaFeatures and select the checkbox.
  2. Open the traceMatrix view (under MiniRobotViews in the Model Tree). It opens as a matrix.
  3. Double-click an empty cell to add a satisfy relationship. It’s added to the text as well.
  4. To see the data as a list (a table with attributes as columns), switch views on the panel at the bottom left.
  5. Click the table to select it, press ⌘/Ctrl+C, and paste it into Excel or another spreadsheet.

Why it opens as a matrix A view opens as a matrix when its declaration includes render ChangeVisionGridRenderings::asMatrix;.

Copying and exporting diagrams

TaskHow
Copy the whole diagram as an imageWith nothing selected, ⌘/Ctrl+C → paste into slides or documents
Copy part of itSelect elements, then ⌘/Ctrl+C (only the area around them)
Export an SVG fileRight-click the background → Export as SVG. Stays sharp at any size.
Black and white for documents◐ on the panel (diagram theme: dark → light → mono), or the sysmlv2-modeler.diagramTheme setting

Learning more about SysML v2

This extension follows the official SysML v2 release 2026-09.1 (SysML 2.1 Beta 2).

ResourceWhere
Specification (OMG)omg.org/spec/SysML
Specification PDFs (the version this extension follows)The doc folder of the official release
Official sample modelssysml/src/examples (examples by topic)
Training examplessysml/src/training (short examples, one notation at a time)

Open an official sample folder with this extension to view it as diagrams or have your AI explain it.

Troubleshooting

SymptomWhat to check
Opening a .sysml file shows no “Open Diagram”, the Model Tree is empty, or completion doesn’t workIs another SysML v2 extension active? Search for sysml in the Extensions view, disable everything except SysMLv2 Modeler, and reload (see the note under Installation). You can also click the language mode in the status bar (bottom right) to see which extension’s language is in use.
No SysML v2 icon in the Activity BarDid you trust the folder? (If “Restricted Mode” appears at the top of the window, click it and choose Trust.) Did you accept the license agreement and reload the window? Did you open a folder (Open Folder…, not a single file)?
The AI can’t see the modelDid you register MCP for the workspace (folder) you have open? (Connecting your AI agent)

If that doesn’t help, contact us using the links below.

Contact, feedback, requests and bug reports

Impressions, feature requests (“I wish it did…”), questions about how to use it, and bug reports all go to the same place. Good news and pain points are equally welcome.

ForURL
Contact, feedback, requests and bug reportshttps://astah.change-vision.com/sys-modeler-inquiry.var
Product informationhttps://astah.change-vision.com/sys-modeler.var

From inside VS Code, you can also use SysML: Send Feedback / SysML: Report a Problem in the Command Palette (⌘/Ctrl+Shift+P).

When reporting a bug, besides what happened, what you expected and the steps, a small .sysml that reproduces it or an image of the diagram (copy with ⌘/Ctrl+C) makes the investigation much faster.

Diagram images were drawn from the sample model by the actual extension. You can read the license agreement at any time with SysML: Show License Agreement in the Command Palette.