Connect an MCP client
Use the local Model Context Protocol (MCP) server to inspect simulations from an AI client. It connects to the same running backend used by the dashboard, so both see the same profiles, runs and metrics.
Start the simulator with a local backend. Find the absolute path to the standalone lwn-server executable (lwn-server.exe on Windows) or the backend executable bundled with the desktop app. Register it as a stdio server in your MCP client. The exact settings location depends on the client.
{
"mcpServers": {
"lwn-simulator": {
"command": "/absolute/path/to/lwn-server",
"args": ["-mcp", "-port", "8080"]
}
}
}Use the backend port you see in the app. The default is 8080. The MCP process connects to 127.0.0.1 on that port. Keep the backend running while using the MCP client.
Inspect a simulation
-
Call
list_profilesto find the profile ID. Pass that ID asprofileIDin profile-specific calls. -
Use
list_devicesandlist_gatewaysto inspect the network. Callget_simulation_activityto see which profile has a running or paused simulation, then useget_simulation_statusfor its clock and metrics. -
Call
list_simulation_runsfor saved runs. Uselist_simulation_eventswithrunIDfor a saved run or omit it for the current run. To continue reading, pass the returnednextAfterSequenceasafterSequence. For the other list tools, passnextOffsetasoffsetwhen present.
The inventory and event results expose metadata such as identifiers and radio measurements. Device keys, codecs and payload bytes stay out of MCP results.
Allow simulation controls
The default configuration is read-only. Add "-mcp-write" to args to enable start_simulation, control_simulation (pause, resume or stop), queue_uplink and queue_downlink. All tool operations use the selected profile ID. Close and reconnect the MCP client after changing its configuration.
Start uses the saved Gateway Bridge settings. Use speed 1 with external gateway transport. One simulation can be active across all profiles. For a downlink, supply UTF-8 text or set base64Encoded for standard Base64. Use fPort for LoRaWAN and omit it for LoRa raw. A queue response means the simulator accepted the request. Check the run events for its outcome.
To grant an AI client control over a live simulation, review the profile and action in the client before approving a write.