Version 2.2.0 — lightweight Modbus TCP simulator with a single in-memory store, a modern Web UI, REST API, Swagger, MCP over HTTP, JavaScript simulation scripts, and a named address map.
Built with Rust (Rocket, tokio-modbus, QuickJS, rmcp).
/ui/ — register matrix, UInt16/Int32/float/double, bit masks, auto-refresh; EN/RU; installable PWAconf/var-map.json), including bit fields in register words/app/script: modbus.onWrite, modbus.setInterval, typed I/O, map.* API/api/v1/ (same data as Modbus TCP)/api/v1/swagger//mcp (Modbus tools, var-map, scripts, combined export/import)RUST_LOG (default info)docker pull allexd2010/modbus-server-sim:2.2.0
docker run -d --name modbus-sim \
-p 9090:9090 \
-p 502:502 \
-e RUST_LOG=info \
allexd2010/modbus-server-sim:2.2.0
| Port | Service |
|---|---|
| 9090 | Web UI, REST, Swagger, MCP (/mcp) |
| 502 | Modbus TCP |
Open http://localhost:9090/ui/ after start.
docker run -d --name modbus-sim \
-p 9090:9090 -p 502:502 \
-v /path/to/scripts:/app/script \
-v /path/to/conf:/app/conf \
allexd2010/modbus-server-sim:2.2.0
/app/script — simulation *.js files/app/conf — var-map.json (named Modbus variables)| Variable | Default | Description |
|---|---|---|
WEB_SERVER_PORT | 9090 | HTTP (UI, REST, Swagger, MCP) |
MB_SERVER_PORT | 502 | Modbus TCP listen port |
MCP_SERVER_PORT | 1 | Set 0 to disable MCP |
MB_MAX_ADDRESS | 65535 | Max protocol address (HTTP API / UI) |
MB_MAX_READ_COUNT | 65535 | Max words/bits per HTTP read/write batch |
SIM_SCRIPTS_DIR | /app/script | Simulation scripts directory |
SIM_SCRIPTS_DISABLE | (unset) | 1 or true disables QuickJS engine |
VAR_MAP_PATH | /app/conf/var-map.json | Address map file |
RUST_LOG | info | Log level (tracing) |
Protocol and API use zero-based offsets (first holding register = 0).
Modicon-style: 40001 → offset 0, 40021 → offset 20.
mcp.json){
"mcpServers": {
"modbus-tcp-sim": {
"url": "http://127.0.0.1:9090/mcp"
}
}
}
2.2.0 — current release (address map, simulation scripts, structured logging)latest — latest stable releasetest — CI builds from mainRelease tags are published for linux/amd64 and linux/arm64.
Content type
Image
Digest
sha256:cf2254478…
Size
35 MB
Last updated
3 months ago
docker pull allexd2010/modbus-server-sim