Forgeline
Forgeline is a read-only Modbus TCP monitoring server that exposes Modbus operations as safe MCP tools for AI agents, allowing inspection of industrial devices without modifying any device state.
get_device_info— Retrieve identity and connection details (vendor name, product code, revision, model name, host, port, unit ID) for the monitored Modbus device.read_holding_registers— Read 16-bit holding registers (FC 0x03) from a zero-based start address (0–65535), up to 125 registers at a time. Returns address→value pairs.read_input_registers— Read 16-bit read-only input registers (FC 0x04) from a zero-based start address (0–65535), up to 125 registers at a time. Returns address→value pairs.read_coils— Read single-bit on/off coil values (FC 0x01) from a zero-based start address (0–65535), up to 2000 coils at a time. Returns address→boolean pairs.
All tools are read-only — no writes or state changes are possible. The server also includes a bundled Modbus simulator for testing without physical hardware, is configurable via environment variables (host, port, unit ID, transport), and supports multiple deployment options including Docker Compose, local Python, and various MCP transports (stdio, SSE, streamable-http).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Forgeline read holding registers from address 0 to 4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Forgeline
Read-only Modbus TCP monitoring, exposed as safe MCP tools.
Forgeline is an MCP server that lets an AI agent monitor an industrial Modbus TCP device — reading holding/input registers, coils, and device identity — without being able to change anything.
It's read-only on purpose: there are no write or command tools, and no code that writes coils or registers, so a connected agent can't alter device state.
A simulated Modbus device is bundled, so you can run it with no hardware.
Status
Working MVP. Four read-only tools — get_device_info, read_holding_registers,
read_input_registers, read_coils — tested against the bundled simulator.
Related MCP server: h7tools-mcp
Project layout
forgeline/
├── src/forgeline/
│ ├── server.py # FastMCP server: registers MCP tools
│ └── tools.py # Read-only Modbus implementations (transport-agnostic)
├── simulator/
│ └── device.py # Bundled pymodbus TCP simulator (zero hardware)
├── docker-compose.yml # Starts simulator + server together
├── Dockerfile
├── pyproject.toml
├── README.md
└── LICENSE # Apache 2.0Quick start
Option A — Docker (simulator + server, one command)
docker compose up --buildThis starts:
simulator — a virtual Modbus device on
localhost:5020.forgeline — the MCP server over
streamable-httpathttp://localhost:8000/mcp, already pointed at the simulator.
Option B — Local Python
Requires Python 3.10+.
pip install -e .
# Terminal 1: start the bundled simulator
forgeline-simulator
# Terminal 2: run the MCP server (stdio transport, for an MCP client)
forgelineBy default the server talks to the simulator on 127.0.0.1:5020.
Configuration
All configuration is via environment variables.
Variable | Default | Description |
|
| Host of the Modbus TCP device to monitor. |
|
| Port of the Modbus TCP device. |
|
| Modbus unit / slave id. |
|
| Per-request timeout in seconds. |
|
| MCP transport: |
|
| Bind host for HTTP transports. |
|
| Bind port for HTTP transports. |
|
| Bind host for the bundled simulator. |
|
| Bind port for the bundled simulator. |
Connecting an MCP client
To launch Forgeline over stdio (e.g. from Claude Desktop or another MCP client),
register a server that runs the forgeline command. Example client config:
{
"mcpServers": {
"forgeline": {
"command": "forgeline",
"env": { "MODBUS_HOST": "127.0.0.1", "MODBUS_PORT": "5020" }
}
}
}(Start forgeline-simulator first, or point MODBUS_HOST/MODBUS_PORT at a
real device.)
Tools
get_device_info
Returns identity and connection details for the monitored device.
{
"host": "127.0.0.1",
"port": 5020,
"unit_id": 1,
"connected": true,
"device_identification_supported": true,
"identity": {
"vendor_name": "Forgeline",
"product_code": "FL-SIM-1",
"revision": "1.0.0",
"vendor_url": "https://github.com/codenikhildr/Forgeline",
"product_name": "Forgeline Modbus Simulator",
"model_name": "Virtual PLC",
"user_application_name": "Forgeline MVP Simulator"
}
}Devices that do not implement Modbus device identification still return
connection details, with device_identification_supported: false.
read_holding_registers / read_input_registers
Read 16-bit registers — holding (FC 0x03, read/write on the device) or input (FC 0x04, read-only measurements). Parameters:
Param | Type | Default | Bounds |
| int | — |
|
| int |
|
|
// read_holding_registers(address=0, count=5)
{
"start_address": 0,
"count": 5,
"unit_id": 1,
"values": [
{ "address": 0, "value": 100 },
{ "address": 1, "value": 101 },
{ "address": 2, "value": 102 },
{ "address": 3, "value": 103 },
{ "address": 4, "value": 104 }
]
}read_coils
Read single-bit on/off coils (FC 0x01). Parameters:
Param | Type | Default | Bounds |
| int | — |
|
| int |
|
|
// read_coils(address=0, count=4)
{
"start_address": 0,
"count": 4,
"unit_id": 1,
"values": [
{ "address": 0, "value": false },
{ "address": 1, "value": true },
{ "address": 2, "value": false },
{ "address": 3, "value": true }
]
}Requests outside these bounds (count over the limit, or a range that exceeds the 16-bit address space) are rejected before any request reaches the device.
Simulator data map
The bundled simulator pre-populates each table (addresses are zero-based):
Table | FC | Addresses | Values |
Holding registers | 0x03 | 0–99 |
|
Input registers | 0x04 | 0–99 |
|
Coils | 0x01 | 0–99 |
|
Discrete inputs | 0x02 | 0–99 |
|
Development
Run the test suite — it starts the bundled simulator on a test port and exercises all four tools plus the input-validation guards:
pip install -e ".[dev]"
pytestCI runs the same suite on every push and pull request across Python 3.10–3.12.
License
Apache License 2.0. See LICENSE.
Available Tools
4 toolsget_device_infoA
Get identity and connection details for the monitored Modbus device.
Returns the device's vendor, product code, revision and related fields (when the device supports Modbus device identification), plus the host, port and unit id Forgeline is connected to. Read-only.
Inputs: no named parameters.
read_coilsA
Read coils (FC 0x01) from the monitored Modbus device.
Coils are single-bit on/off values. Returns the start address, count, unit id, and a list of address -> boolean value pairs. Read-only.
Inputs: address (required), count.
read_holding_registersB
Read holding registers (FC 0x03) from the monitored Modbus device.
Holding registers are 16-bit read/write values (Forgeline reads them only). Returns the start address, count, unit id, and a list of address -> value pairs. Read-only.
Inputs: address (required), count.
read_input_registersA
Read input registers (FC 0x04) from the monitored Modbus device.
Input registers are 16-bit read-only measurements. Returns the start address, count, unit id, and a list of address -> value pairs.
Inputs: address (required), count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: get_device_info for identity/connection, read_coils for single-bit values, read_holding_registers for 16-bit read/write registers, and read_input_registers for 16-bit read-only registers. No overlap in functionality.
All tool names follow a consistent verb_noun pattern using lowercase and underscores (e.g., get_device_info, read_coils). The naming convention is uniform and predictable.
With 4 tools, the server is well-scoped for its purpose of monitoring a Modbus device. The count is within the ideal range of 3-15 tools and covers essential read operations without unnecessary bloat.
The tool set covers device identity and the three primary read function codes (coils, holding registers, input registers) for Modbus monitoring. A minor gap is the absence of reading discrete inputs (FC 0x02), but this is a reasonable omission for a basic monitoring server.
Related MCP Connectors
Read-only MCP server for the OPERANT AI operating-agent calibration benchmark.
Read-only MCP server exposing a user ORANO library to their own AI agent.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceThis MCP server enables AI agents to read MQTT and Sparkplug B data via tools like list_topics, get_latest, and read_all, providing read-only access to latest sensor values.1MIT
- FlicenseNot gradedqualityDmaintenanceRead-only MCP server for diagnosing H7-TOOL hardware via Modbus, USB HID, and Lua diagnostics, exposing only safe read operations.20-
- AlicenseAqualityDmaintenanceA secure, read-only MCP server for AI-powered system monitoring. It provides real-time OS metrics, config discovery, and safe log tailing to enable autonomous infrastructure audits without shell access risks.42ISC
- FlicenseNot gradedqualityDmaintenanceRead-only MCP server that connects a Broker trading account to AI clients, providing account data, positions, orders, and market data via 21 tools, with a mock sandbox mode for evaluation.-