Skip to main content
Glama
nbrain-industrial-ot-zkteco-modbus

nbrain-industrial-ot-zkteco-modbus

README.md
# `nbrain-industrial-ot-zkteco-modbus` — Industrial OT `Modbus RTU/TCP`, `IEC 62443-3-3` AI Agent Safety Firewall & `ZKTeco` Biometric Attendance Protocol + MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg)](./LICENSE)
[![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B%20Zero--Dep-blue.svg)](./pyproject.toml)
[![MCP Registry](https://img.shields.io/badge/MCP-io.github.NBrain--Studio%2Fnbrain--industrial--ot--zkteco--modbus-purple.svg)](./server.json)

Engineered by **[Eng. Nadeem Mohamed Badr El-Din](https://nadeembadr.com)** at **[NBrain (`منظومة إن برين` — nbra.in)](https://nbra.in)** from production factory ERP, water-treatment telemetry, and Odoo 19 ZKTeco biometric integrations.

## Capabilities
1. **Modbus RTU (`CRC-16/MODBUS` `0xA001` LSB-first) & Modbus TCP (`MBAP` 7-byte header)**: Deterministic binary framing, hex/byte decoding, and CRC-16 corruption detection.
2. **`IEC 62443-3-3` AI Agent Read-Only Firewall**: Prevents autonomous AI agents from issuing destructive coil/register writes (`FC05`, `FC06`, `FC0F`, `FC10`, `FC16`, `FC17`) to PLCs unless an `HMAC-SHA256` dual-control authorization token is verified.
3. **ZKTeco Biometric Protocol (`ZK Packed 32-Bit Epoch` & `ADMS / iClock ATTLOG`)**: Exact conversion of ZKTeco's non-Unix 31-day-month packed 32-bit integer timestamps + `ATTLOG` shift overtime (`1.5x` `Decimal`) payroll bridge.

## Quick Verification
```bash
PYTHONPATH=src python -m unittest discover -s tests -v
```

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct role: Modbus frame encoding/decoding, IEC 62443 command safety auditing, ZKTeco timestamp conversion, and ZKTeco ATTLOG reconciliation. The two Modbus tools are separated by codec vs. safety enforcement, and the two ZKTeco tools by timestamp conversion vs. log processing.

Naming Consistency4/5

All names use snake_case and begin with an action verb, making the set readable and predictable. The compound verbs such as frame_and_verify and decode_or_encode are semantically justified but slightly reduce strict verb_noun uniformity.

Tool Count5/5

Four tools is well within the expected range for a specialized industrial OT integration toolkit. Each tool covers a distinct, non-trivial operation and none appears redundant.

Completeness3/5

The tools cover the advertised narrow utilities: Modbus frame codec, IEC 62443 command audit, ZKTeco epoch conversion, and ATTLOG reconciliation. However, there is no direct Modbus transaction/read-write tool or broader ZKTeco ADMS/device management surface, leaving notable operational gaps.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues