lasal-mcp
v0.4.0MCP server for LASAL IDE automation
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
select_project
Set the active LASAL project for THIS agent session by directory path. Call first — all other tools default to this project. Selections are per MCP server process, so parallel agents do not redirect each other.
| Parameter | Type | Description |
|---|---|---|
path * | string | Full path to the LASAL solution folder (must contain a .lsm file). |
lasal_status
Check project selection, station discovery, PLC/HMI reachability, engine paths, running processes, HMI runtime health, live agent sessions and CLASS 2 ownership. Call to orient or diagnose connection issues.
check_job_status
Poll the status of a background job started with async: true (build_project, deploy_all, deploy_solution, lse_project). Omit jobId to list recent jobs.
| Parameter | Type | Description |
|---|---|---|
jobId | string | Job id returned by an async tool call (status 'pending'). Omit to list recent jobs. |
inspect_project
Read-only inventory of the CLASS 2 project: classes (name, channels, tasks), networks and objects, from the .lcp manifest and class sources. Use it to plan changes before apply_project_changes.
| Parameter | Type | Description |
|---|---|---|
class_names | array | Return full channel details only for these class names. Omit to get a summary of all classes (name + channel counts). Use this to drill into specific classes after the initial summary. |
include_connections | boolean | Include network connections in the output (requires include_networks). Default false. |
include_networks | boolean | Include network objects in the output. Default false to keep output small. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the currently selected project. |
validate_guids
Scan a LASAL station project for duplicate GUID collisions and uninitialized TO_UDINT(0) placeholders in classes. Auto-resolves duplicate GUID collisions (generating fresh GUIDs and updating MaeExp.txt/xml) and populates exact LASAL CRC32 @CT_ hashes. Also cleans dangling network metadata.
| Parameter | Type | Description |
|---|---|---|
auto_fix | boolean | Automatically resolve duplicate GUID collisions and update @CT_ hashes. Default true. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the currently selected project. |
read_class_source
Read or write a CLASS 2 class source (.st) by class name, with optional .h access. Writes are latin1-validated and require the CLASS 2 IDE to be closed.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'read' returns the source; 'write' overwrites it. |
class_name * | string | Name of the CLASS 2 class (e.g. 'Palletizer'). |
header_source | string | Content to write to the .h file. Omit to leave it unchanged (write only). |
include_header | boolean | Also return the .h file contents (read only). Default false. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the selected project. |
source | string | Full content to write to the .st file — must be latin1-compatible (write only). |
set_target_ip
Update the target IP/port/SSL of a station in its .lss (surgical edit, other settings preserved). Use when a station moved networks; connection strings can also be passed per call.
| Parameter | Type | Description |
|---|---|---|
ip | string | New IP address (e.g. '192.168.1.100'). |
port | string | New port (default '1954'). Only change if non-standard. |
ssltls | boolean | Enable SSL/TLS for the connection. Omit to leave unchanged. |
station | string | Station name to update (e.g. 'PLC', 'HMI'). Omit if the project has only one station. |
manage_class2
Open or close the LASAL CLASS 2 IDE GUI. Close before running batch operations. close only terminates instances opened for this agent's project unless force: true is passed.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'open' launches LASAL CLASS 2; 'close' kills it. |
force | boolean | Close every CLASS 2 instance, including ones opened for another project. Default false. |
lcp_path | string | Full path to the .lcp station file to open (open only). Omit to auto-detect from the selected project. |
manage_visudesigner
Open or close the VISUDesigner GUI. Close before running automated visu operations. close only terminates instances opened for this agent's project unless force: true is passed.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'open' launches VISUDesigner; 'close' kills it. |
force | boolean | Close every VISUDesigner instance, including ones opened for another project. Default false. |
lvp_path | string | Full path to the .lvp station file to open (open only). Omit to auto-detect from the selected project. |
manage_lasalscreen
Open or close the LASAL SCREEN (LSE) editor for .lpr screen projects. Close before running lse_project automation (releases .lpr file locks).
| Parameter | Type | Description |
|---|---|---|
action * | string | 'open' launches the LASAL SCREEN (LSE) editor; 'close' kills it (releases .lpr file locks). |
lpr_path | string | Full path to the .lpr screen project to open (open only). Omit to auto-detect from the selected project. |
build_project
Compile the CLASS 2 project or download it to the PLC. Compilation closes this project's CLASS 2 IDE; an IDE opened for another project is reported, not killed. Download pings the PLC first. Supports async: true — the call then returns immediately with a jobId and you MUST poll check_job_status until it reports status completed/failed (the result is delivered there).
| Parameter | Type | Description |
|---|---|---|
action * | string | 'compile' builds the project; 'download' transfers it to the PLC. |
add_loader_anyway | boolean | Force loader download even if the target OS already has a compatible loader (download only). Default: auto — the loader is sent for local LARS/loopback targets, skipped otherwise. Set false to disab… |
async | boolean | Run in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false. |
connection | string | Connection string (e.g. 'TCPIP:192.168.1.100') or address-book name (download only). Omit to use the connection saved in the .lss file. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the selected project. |
options | string | Compile mode (compile only). RebuildAll is safest; BuildChanges is faster for incremental work. |
timeout_s | integer | Timeout in seconds for compile or download. Omit for default (600s). |
create_class2_bootdisk
Create a CLASS 2 bootdisk (update stick): plain bootdisk or the full Update-Tool flavor with update script, Autoexec.lsl, LasalOS image, VISUDesigner publish folder and MultiMaster Stations.txt. Platform AUTO/ALL/ARM/X86.
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Directory to write the bootdisk into (e.g. a prepared USB stick root). |
add_autoexec | boolean | Place an autoexec.lsl into the destination directory that starts the update script (update-stick mode). |
add_multimaster_stations | boolean | Copy the MultiMaster Stations.txt into the destination (update-stick mode). Default true. |
all_lobs_in_one | boolean | Write all .lob files into a single file. |
autoexec_file | string | Path of a regular Autoexec.lsl to place on the PLC (update-stick mode). |
lcp_path | string | Absolute path to the .lcp file. Omit to use the currently selected project. |
lvd_runtime | boolean | When a VISUDesigner publish folder is set: also use its Runtime directory. Default true. |
mode | string | Bootdisk flavor. Default: update_stick when any of os_file/visu_publish_folder/autoexec_file/add_autoexec/update_script is used, otherwise simple. |
os_file | string | LasalOS image (.lbi) to include (update-stick mode). |
overwrite | boolean | Overwrite existing bootdisk content. Default true. |
platform | string | Target architecture: AUTO (project target), ALL, ARM or X86. Default AUTO. |
timeout_s | integer | Timeout in seconds. Default 300. |
update_script | string | Update-tool script flavor (update-stick mode): none, all (runs every update) or menu. Default none. |
use_active_connection_files | boolean | Use the project's active connection files (update-stick mode). Default true. |
visu_publish_folder | string | VISUDesigner 'Publish' folder to bundle into the update (update-stick mode). |
control_plc
Start, stop, or query PLC runtime state. Pings the target PLC before start/stop.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'start' runs the PLC project; 'stop' halts it; 'get_state' queries its current state. |
connection | string | Connection string or address-book name. Omit to use the project's saved connection. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the selected project. |
plc_values
Read or write live channel values on a running PLC. Channels use 'ObjectName.ChannelName' format. Auto-coerces types based on ST declarations.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'read' fetches live channel values; 'write' pushes new values. |
channels | array | Channel paths to read, each in 'ObjectName.ChannelName' format (read only). |
connection | string | Connection string or address-book name. Omit to use the project's saved connection. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the selected project. |
values | array | Channel/value pairs to write (write only). |
apply_project_changes
Run CLASS 2 batch engine operations that cannot be done by editing files directly: create/delete/rename networks, add/remove/rename objects, create/delete connections, set init values, configure tasks, compile, download. Kills CLASS 2 IDE before running.
run_class2_script
Escape hatch: run arbitrary Python 2.7 batch statements through Lasal2.exe (module `batch`, project `prj` in scope). Use for batch API calls not covered by apply_project_changes; the project is NOT saved automatically.
| Parameter | Type | Description |
|---|---|---|
script_body * | string | Python 2.7 statements executed inside the CLASS 2 batch context. `batch` (sigmatek.lasal.batch) and the loaded project `prj` are in scope; the project is closed afterwards (call batch.Save(prj) yourse… |
args | array | Optional arguments exposed to the script as sys.argv[1:]. Default []. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the currently selected project. |
plc_diagnostics
Run PLC diagnostics: trace recording, file upload/download/delete on PLC, or static code analysis.
| Parameter | Type | Description |
|---|---|---|
action * | string | PLC diagnostics/maintenance action: trace (DataAnalyzer run), file_upload/file_download/file_delete (files on the control), code_analysis (static analysis on the project or one source file), download_… |
config_path | string | Absolute path to the DataAnalyzer config file (trace action only). |
connection | string | PLC connection string. Omit to use connection from project's .lss file. |
connection_file | string | Optional .lcf connection file path (download_connection_file action only; omit to use the project's active connection file). |
duration_ms | integer | Duration in milliseconds to run the trace (trace action only). Default 5000. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the currently selected project. |
local_path | string | Local file path on the host (for file upload/download). |
os_path | string | LasalOS update file (.lbi) to install (download_os action only). |
output_path | string | Destination path for the trace output or code analysis result. |
plc_path | string | File path on the PLC (for file upload/download/delete). |
source_file | string | Analyze a single source file instead of the whole project (code_analysis action only). |
timeout_s | integer | Timeout override in seconds. Defaults: 120s, or 600s for download_os. |
lars_runtime
Manage local LARS (LASAL Runtime System) simulation instances. LARS runs one program per instance — use one workspace per station (PLC + HMI) so both run simultaneously on separate ports. Actions: list (auto-cleans stale workspaces), setup (create workspaces for all stations), start (auto-creates the workspace if the station is known but unconfigured), stop, remove, gc (lazy cleanup of unreferenced workspaces), set_station_target (point a station's .lss at its LARS instance), restore (revert .lss to the real target. After set_station_target, build_project/control_plc/plc_values/deploy_all op…
| Parameter | Type | Description |
|---|---|---|
action * | string | 'list' shows all configured LARS workspaces and their state (auto-cleans stale ones, but never the selected project's). 'setup' creates/updates LARS workspaces for the selected project's stations (or… |
compile_mode | string | With action 'simulate': CLASS 2 compile mode. Default RebuildAll (safest). |
dry_run | boolean | With action 'gc': report what would be removed without deleting anything. Default false. |
lcp_path | string | Absolute path to a .lcp to create a workspace for (setup only, when no station name is usable). |
min_age_h | integer | With action 'gc': only delete workspaces unreferenced for at least this many hours (overrides LASAL_MCP_LARS_GC_MIN_AGE_H; 0 = immediately. |
name | string | LARS workspace name (e.g. 'VisuPalletizer_PLC'). Required for start/stop/remove/set_station_target/restore when station is omitted. |
project_dir | string | Solution directory to auto-detect stations from and to scope station resolution (setup/list/start/stop/set_station_target/restore/target_pc/simulate. Defaults to the selected project. |
skip_compile | boolean | With action 'simulate': skip the CLASS 2 compile step (reuse the existing build). Default false. |
skip_download | boolean | With action 'simulate': skip the download step (only compile + start). Default false. |
station | string | Station name from the selected project's solution (e.g. 'PLC', 'HMI', 'Local'). Resolution is scoped to the selected project; a station that only exists in another project's workspace is refused, and… |
visu_project
Run VISUDesigner engine operations: update stations, publish, manage text lists/schemes/media/code modules, set datapoint properties, or download to HMI. These need the VISUDesigner engine — for direct dashboard JSON editing, edit the files in the project directly.
lse_project
Run LASAL SCREEN (LSE) engine operations on a .lpr screen project via the LASALScreen COM automation: info (screens/windows/servers/text lists/languages/settings inventory), create (fresh project), compile (Runtime output folder), download to a panel (Download & Run), and apply_changes with granular operations: merge/fuse projects, export_xml/import_xml text round-trips, import_variables (CLASS 2 references), textlist_* translations, server_get_property/server_set_property (limits, unit, menu, state schema, hostname, …), bulk update_buttons/update_softkeys theming, settings_set (resolution/c…
deploy_all
Full deploy pipeline: compile → download PLC → start PLC → verify state → compile LASAL SCREEN (.lpr, when present) → optional SCREEN download → update Visu stations → download Visu → start HMI runtime. Each step is optional via flags. Supports async: true — the call then returns immediately with a jobId and you MUST poll check_job_status until it reports status completed/failed (the result is delivered there).
| Parameter | Type | Description |
|---|---|---|
add_plc_loader | boolean | Force loader download to PLC even if the target already has a compatible loader. Default: auto — sent for local LARS/loopback targets, skipped otherwise. Set false to disable, true to force. |
add_visu_runtime | boolean | Force runtime download to HMI even if the version already matches. |
async | boolean | Run in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false. |
compile | boolean | Compile the CLASS 2 project. Default true. |
compile_lse | boolean | Compile the LASAL SCREEN project (writes the Runtime output folder). Skipped when there is no .lpr. Default true. |
compile_options | string | Compile mode. RebuildAll is safest; BuildChanges is faster for incremental work. |
download_lse | boolean | Download the LASAL SCREEN project to its station (requires lse_connection or a station target in the solution). Default false. |
download_plc | boolean | Download the compiled CLASS 2 project to the PLC. Default true. |
download_visu | boolean | Download the VISUDesigner project to the HMI after updating stations. Requires visu_connection. Default false. |
lcp_path | string | Absolute path to the .lcp file. Omit to use the selected project. |
lse_connection | string | SCREEN download target, e.g. 'TCPIP:192.168.1.50'. Omit to resolve from the station that owns the .lpr. |
lse_path | string | Absolute path to the .lpr (LASAL SCREEN) project. Omit to auto-detect from the selected project. |
lse_run | boolean | Start the screen runtime on the target after download (Download & Run). Default true. |
lvp_path | string | Absolute path to the .lvp file. Omit to auto-detect from the selected project. |
plc_connection | string | PLC connection string (e.g. 'TCPIP:192.168.1.100'). Omit to use the connection saved in the project's .lss file. |
start_hmi_runtime | boolean | Start the local HMI runtime (DataService) and copy HMI files after a successful compilation/update. Default false. |
start_plc | boolean | Start the PLC runtime after a successful download. Default true. |
timeout_s | integer | Timeout override in seconds for compile and download steps. |
update_visu_stations | boolean | Run update_all_stations on the VISUDesigner project to sync datapoints after CLASS 2 changes. Default true. |
visu_connection | string | HMI connection string (e.g. 'TCPIP:192.168.1.100'). Required when download_visu is true. |
visu_download_flags | integer | VISUDesigner download mode: 0=normal (default), 1=changes only, 2=publish+download changes. |
deploy_solution
Multi-station deploy via MachineManager: generates a .lutc update file from the solution (class2/screen/visu downloads, OS updates, file transfers, run/boot, channel writes, CLI commands) and executes it with MachineManager.exe /update. This is the official flow for pushing LASAL SCREEN projects together with CLASS 2 to the same panel. Use dry_run to review the generated .lutc first. The newest MachineManager per-run log is returned with the result. Supports async: true — the call then returns immediately with a jobId and you MUST poll check_job_status until it reports status completed/faile…
| Parameter | Type | Description |
|---|---|---|
stations * | array | Ordered per-station deploy steps. Instructions are emitted per station in field order: class2 → screen → visu → run → write → cli → packages → os → boot → files. |
async | boolean | Run in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false. |
dry_run | boolean | Generate and return the .lutc without executing MachineManager (plan review). |
lsm_path | string | Path to the .lsm solution. Omit to use the selected project. |
machine_nr | string | Machine number used in the update log, e.g. "042". Default "000". |
timeout_s | integer | Timeout override for the whole update run. |
utc_path | string | Where to write the generated .lutc update file (default: MCP scratch directory). |
hmi_runtime
Start, stop, or check the local HMI web simulation (LasalVISUDataService). Publishes the project, copies webroot, and spawns the DataService. Returns the accessible HTTP URL (e.g. for testing via Playwright MCP or opening in a browser).
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on the HMI runtime DataService. |
debugPublish | boolean | Use debug publish (requires TypeScript project support). Fallback to standard publish on failure. Default true. |
lvp_path | string | Absolute path to the .lvp file. Omit to use the currently selected project. |
publishFirst | boolean | Publish the project before starting the DataService. Default true. |