Open-Source-Simulator: Claude steuert Modbus-Geräte über MCP und testet SCADA ohne PLC
Mit dem Simulator fieldpuppet lassen sich per Prompt an Claude etwa 50 Energiezähler anlegen und gezielt Störungen simulieren, um SCADA-Systeme ohne echte SPS-Hardware zu testen.

Hinweis: Ich arbeite an fieldpuppet, dem Open-Source-Simulator aus diesem Beitrag. Er wird von dem Team hinter PLCGateway gepflegt.
Hier ist ein Prompt, den ich inzwischen in Claude eingeben kann:
Richte 50 Energiezähler ein, beginnend bei Port 6000. Lass Zähler 12 für 30 Sekunden nicht antworten und sag mir danach, welche Register meine SCADA von ihm gelesen hat.
Ein paar Sekunden später laufen 50 Modbus-TCP-Geräte auf meinem Laptop, eines davon wird planmäßig stumm, und ich erhalte einen Bericht darüber, was meine Software abgefragt hat. Keine SPS, kein Zähler, kein Schaltschrank.
Dieser Beitrag erklärt, warum ich fieldpuppet gebaut habe, wie der MCP-Teil funktioniert und wie man es auch ganz ohne KI verwenden kann.
Wer Software schreibt, die Modbus TCP spricht (ein SCADA-Bildschirm, ein Gateway, ein Historian, ein Datensammler), kennt diese Situation: Der Code ist fertig, aber die SPS steckt im Schaltschrank beim Kunden, der Energiezähler ist noch nicht geliefert, und niemand erlaubt, eine Pumpe abzuklemmen, nur um zu sehen, wie die Software mit einem Timeout umgeht.
Eine Registertabelle, die feste Zahlen zurückgibt, hilft da nicht viel weiter. Realistisches Testen erfordert:
Das Einrichten von Testgeräten ist langweilige, sich wiederholende Arbeit: Eine Registerliste aus einem Handbuch übertragen, Ports wählen, einen Fehlerzeitplan schreiben. Genau diese Art von Arbeit erledigt ein Assistent gut, wenn er die richtigen Werkzeuge hat.
fieldpuppet ist eine einzelne Rust-Executable von etwa 2 MB mit integriertem MCP-Server. Es stellt 22 Tools bereit, darunter create_device, set_signal, apply_scenario, inject_fault und get_traffic_log. Jedes Tool trägt Hinweise dazu, ob es nur lesend oder zerstörend ist, sodass der Client weiß, welche Aufrufe den Zustand verändern.
claude mcp add fieldpuppet -- /full/path/to/fieldpuppet mcp Enter fullscreen mode Exit fullscreen mode Für Claude Desktop bietet jedes Release ein.mcpb-Bundle, das man in den Extensions-Einstellungen installieren kann. Jeder MCP-Client, der einen lokalen Server über stdio starten kann, funktioniert.
Ein nur lesendes Web-Dashboard unter http://127.0.0.1:5080 zeigt jedes Gerät, dessen Live-Werte und einen Feed aller Änderungen, die der Assistent vorgenommen hat, sodass man nie rätseln muss, was er getan hat.
devices: - id: pump-1 template: pump port: 5020 - id: dosing-skid port: 5021 points: - name: chlorine_ppm table: input address: 0 scale: 0.01 unit: ppm value: 0.8 signal: { type: random_walk, min: 0.5, max: 1.2, step: 0.02 } Enter fullscreen mode Exit fullscreen mode Ausführen mit:
fieldpuppet run water-station.yaml Enter fullscreen mode Exit fullscreen mode Richten Sie Ihre eigene Software auf 127.0.0.1, Port 5020 oder 5021, Unit-ID 1. Der Chlrowert treibt wie bei einem echten Sensor zwischen 0,5 und 1,2 ppm. Adressen sind nullbasierte Protokolladressen, Holding-Register 40001 entspricht also Adresse 0.
Vier Fehlertypen stehen zur Verfügung, jeweils mit optionalem Zeitlimit:
So findet man heraus, ob die eigene Software neu verbindet, ob ein totes Gerät die Abfrage der anderen 49 blockiert und ob veraltete Werte als veraltet markiert werden.
Der Code liegt auf GitHub unter MIT / Apache 2.0: CybriantOps/fieldpuppet. Es ist ein neues Projekt, daher sind Fehlerberichte und Feature-Wünsche sehr willkommen.
Welcher Fehlerfall hat Ihnen im Feld die meisten Probleme bereitet?
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Disclosure: I work on fieldpuppet, the open-source simulator in this post. It is maintained by the team behind PLCGateway.
Here is a prompt I can now type into Claude:
Set up 50 energy meters starting at port 6000. Make meter 12 stop answering for 30 seconds, then tell me which registers my SCADA read from it.
A few seconds later there are 50 Modbus TCP devices listening on my laptop, one of them goes silent on schedule, and I get a report of what my software polled. No PLC, no meter, no cabinet.
This post explains why I built it, how the MCP part works, and how to use it without any AI at all.
If you write software that talks Modbus TCP (a SCADA screen, a gateway, a historian, a data collector), you know this situation. The code is ready, but the PLC is in a cabinet at the customer site, the energy meter has not shipped yet, and nobody will let you unplug a pump just to see how your software handles a timeout.
A register table that returns fixed numbers does not help much. Real testing needs:
Setting up test devices is boring, repetitive work: copy a register list from a manual, pick ports, write a fault timeline. It is exactly the kind of work an assistant does well if it has the right tools.
fieldpuppet is a single Rust executable of about 2 MB with an MCP server built in. It exposes 22 tools, such as create_device, set_signal, apply_scenario, inject_fault and get_traffic_log. Every tool carries read-only and destructive hints, so the client knows which calls change state.
claude mcp add fieldpuppet -- /full/path/to/fieldpuppet mcp Enter fullscreen mode Exit fullscreen mode For Claude Desktop, each release has an.mcpb bundle you can install from the Extensions settings. Any MCP client that can start a local server over stdio works.
A read-only web dashboard on http://127.0.0.1:5080 shows every device, its live values and a feed of everything the assistant changed, so you are never guessing what it did.
devices: - id: pump-1 template: pump port: 5020 - id: dosing-skid port: 5021 points: - name: chlorine_ppm table: input address: 0 scale: 0.01 unit: ppm value: 0.8 signal: { type: random_walk, min: 0.5, max: 1.2, step: 0.02 } Enter fullscreen mode Exit fullscreen mode Run it:
fieldpuppet run water-station.yaml Enter fullscreen mode Exit fullscreen mode Point your own software at 127.0.0.1, port 5020 or 5021, unit id 1. The chlorine value drifts between 0.5 and 1.2 ppm like a real sensor would. Addresses are zero-based protocol addresses, so holding register 40001 is address 0.
Four fault types are available, each with an optional time limit:
This is how you find out whether your software reconnects, whether one dead device stalls the polling of the other 49, and whether stale values are marked as stale.
The code is on GitHub under MIT / Apache 2.0: CybriantOps/fieldpuppet. It is a new project, so bug reports and feature requests are very welcome.
Which fault case has caused you the most trouble in the field?