lasal-mcp

v0.4.0
lasal-mcp Checked 8 hours ago Published 20 days ago

MCP 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.

ParameterTypeDescription
path *stringFull 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.

ParameterTypeDescription
jobIdstringJob 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.

ParameterTypeDescription
class_namesarrayReturn 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_connectionsbooleanInclude network connections in the output (requires include_networks). Default false.
include_networksbooleanInclude network objects in the output. Default false to keep output small.
lcp_pathstringAbsolute 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.

ParameterTypeDescription
auto_fixbooleanAutomatically resolve duplicate GUID collisions and update @CT_ hashes. Default true.
lcp_pathstringAbsolute 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.

ParameterTypeDescription
action *string'read' returns the source; 'write' overwrites it.
class_name *stringName of the CLASS 2 class (e.g. 'Palletizer').
header_sourcestringContent to write to the .h file. Omit to leave it unchanged (write only).
include_headerbooleanAlso return the .h file contents (read only). Default false.
lcp_pathstringAbsolute path to the .lcp file. Omit to use the selected project.
sourcestringFull 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.

ParameterTypeDescription
ipstringNew IP address (e.g. '192.168.1.100').
portstringNew port (default '1954'). Only change if non-standard.
ssltlsbooleanEnable SSL/TLS for the connection. Omit to leave unchanged.
stationstringStation 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.

ParameterTypeDescription
action *string'open' launches LASAL CLASS 2; 'close' kills it.
forcebooleanClose every CLASS 2 instance, including ones opened for another project. Default false.
lcp_pathstringFull 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.

ParameterTypeDescription
action *string'open' launches VISUDesigner; 'close' kills it.
forcebooleanClose every VISUDesigner instance, including ones opened for another project. Default false.
lvp_pathstringFull 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).

ParameterTypeDescription
action *string'open' launches the LASAL SCREEN (LSE) editor; 'close' kills it (releases .lpr file locks).
lpr_pathstringFull 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).

ParameterTypeDescription
action *string'compile' builds the project; 'download' transfers it to the PLC.
add_loader_anywaybooleanForce 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…
asyncbooleanRun in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false.
connectionstringConnection 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_pathstringAbsolute path to the .lcp file. Omit to use the selected project.
optionsstringCompile mode (compile only). RebuildAll is safest; BuildChanges is faster for incremental work.
timeout_sintegerTimeout 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.

ParameterTypeDescription
output_path *stringDirectory to write the bootdisk into (e.g. a prepared USB stick root).
add_autoexecbooleanPlace an autoexec.lsl into the destination directory that starts the update script (update-stick mode).
add_multimaster_stationsbooleanCopy the MultiMaster Stations.txt into the destination (update-stick mode). Default true.
all_lobs_in_onebooleanWrite all .lob files into a single file.
autoexec_filestringPath of a regular Autoexec.lsl to place on the PLC (update-stick mode).
lcp_pathstringAbsolute path to the .lcp file. Omit to use the currently selected project.
lvd_runtimebooleanWhen a VISUDesigner publish folder is set: also use its Runtime directory. Default true.
modestringBootdisk flavor. Default: update_stick when any of os_file/visu_publish_folder/autoexec_file/add_autoexec/update_script is used, otherwise simple.
os_filestringLasalOS image (.lbi) to include (update-stick mode).
overwritebooleanOverwrite existing bootdisk content. Default true.
platformstringTarget architecture: AUTO (project target), ALL, ARM or X86. Default AUTO.
timeout_sintegerTimeout in seconds. Default 300.
update_scriptstringUpdate-tool script flavor (update-stick mode): none, all (runs every update) or menu. Default none.
use_active_connection_filesbooleanUse the project's active connection files (update-stick mode). Default true.
visu_publish_folderstringVISUDesigner '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.

ParameterTypeDescription
action *string'start' runs the PLC project; 'stop' halts it; 'get_state' queries its current state.
connectionstringConnection string or address-book name. Omit to use the project's saved connection.
lcp_pathstringAbsolute 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.

ParameterTypeDescription
action *string'read' fetches live channel values; 'write' pushes new values.
channelsarrayChannel paths to read, each in 'ObjectName.ChannelName' format (read only).
connectionstringConnection string or address-book name. Omit to use the project's saved connection.
lcp_pathstringAbsolute path to the .lcp file. Omit to use the selected project.
valuesarrayChannel/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.

ParameterTypeDescription
script_body *stringPython 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…
argsarrayOptional arguments exposed to the script as sys.argv[1:]. Default [].
lcp_pathstringAbsolute 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.

ParameterTypeDescription
action *stringPLC 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_pathstringAbsolute path to the DataAnalyzer config file (trace action only).
connectionstringPLC connection string. Omit to use connection from project's .lss file.
connection_filestringOptional .lcf connection file path (download_connection_file action only; omit to use the project's active connection file).
duration_msintegerDuration in milliseconds to run the trace (trace action only). Default 5000.
lcp_pathstringAbsolute path to the .lcp file. Omit to use the currently selected project.
local_pathstringLocal file path on the host (for file upload/download).
os_pathstringLasalOS update file (.lbi) to install (download_os action only).
output_pathstringDestination path for the trace output or code analysis result.
plc_pathstringFile path on the PLC (for file upload/download/delete).
source_filestringAnalyze a single source file instead of the whole project (code_analysis action only).
timeout_sintegerTimeout 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…

ParameterTypeDescription
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_modestringWith action 'simulate': CLASS 2 compile mode. Default RebuildAll (safest).
dry_runbooleanWith action 'gc': report what would be removed without deleting anything. Default false.
lcp_pathstringAbsolute path to a .lcp to create a workspace for (setup only, when no station name is usable).
min_age_hintegerWith action 'gc': only delete workspaces unreferenced for at least this many hours (overrides LASAL_MCP_LARS_GC_MIN_AGE_H; 0 = immediately.
namestringLARS workspace name (e.g. 'VisuPalletizer_PLC'). Required for start/stop/remove/set_station_target/restore when station is omitted.
project_dirstringSolution 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_compilebooleanWith action 'simulate': skip the CLASS 2 compile step (reuse the existing build). Default false.
skip_downloadbooleanWith action 'simulate': skip the download step (only compile + start). Default false.
stationstringStation 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).

ParameterTypeDescription
add_plc_loaderbooleanForce 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_runtimebooleanForce runtime download to HMI even if the version already matches.
asyncbooleanRun in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false.
compilebooleanCompile the CLASS 2 project. Default true.
compile_lsebooleanCompile the LASAL SCREEN project (writes the Runtime output folder). Skipped when there is no .lpr. Default true.
compile_optionsstringCompile mode. RebuildAll is safest; BuildChanges is faster for incremental work.
download_lsebooleanDownload the LASAL SCREEN project to its station (requires lse_connection or a station target in the solution). Default false.
download_plcbooleanDownload the compiled CLASS 2 project to the PLC. Default true.
download_visubooleanDownload the VISUDesigner project to the HMI after updating stations. Requires visu_connection. Default false.
lcp_pathstringAbsolute path to the .lcp file. Omit to use the selected project.
lse_connectionstringSCREEN download target, e.g. 'TCPIP:192.168.1.50'. Omit to resolve from the station that owns the .lpr.
lse_pathstringAbsolute path to the .lpr (LASAL SCREEN) project. Omit to auto-detect from the selected project.
lse_runbooleanStart the screen runtime on the target after download (Download & Run). Default true.
lvp_pathstringAbsolute path to the .lvp file. Omit to auto-detect from the selected project.
plc_connectionstringPLC connection string (e.g. 'TCPIP:192.168.1.100'). Omit to use the connection saved in the project's .lss file.
start_hmi_runtimebooleanStart the local HMI runtime (DataService) and copy HMI files after a successful compilation/update. Default false.
start_plcbooleanStart the PLC runtime after a successful download. Default true.
timeout_sintegerTimeout override in seconds for compile and download steps.
update_visu_stationsbooleanRun update_all_stations on the VISUDesigner project to sync datapoints after CLASS 2 changes. Default true.
visu_connectionstringHMI connection string (e.g. 'TCPIP:192.168.1.100'). Required when download_visu is true.
visu_download_flagsintegerVISUDesigner 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…

ParameterTypeDescription
stations *arrayOrdered per-station deploy steps. Instructions are emitted per station in field order: class2 → screen → visu → run → write → cli → packages → os → boot → files.
asyncbooleanRun in the background: returns { status: 'pending', jobId } — poll with check_job_status. Default false.
dry_runbooleanGenerate and return the .lutc without executing MachineManager (plan review).
lsm_pathstringPath to the .lsm solution. Omit to use the selected project.
machine_nrstringMachine number used in the update log, e.g. "042". Default "000".
timeout_sintegerTimeout override for the whole update run.
utc_pathstringWhere 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).

ParameterTypeDescription
action *stringAction to perform on the HMI runtime DataService.
debugPublishbooleanUse debug publish (requires TypeScript project support). Fallback to standard publish on failure. Default true.
lvp_pathstringAbsolute path to the .lvp file. Omit to use the currently selected project.
publishFirstbooleanPublish the project before starting the DataService. Default true.