TwinCAT Validator

•
36
•

Validates, auto-fixes, and scaffolds TwinCAT 3 XML files, providing deterministic code quality tooling for AI assistants via an MCP server.

TwinCAT Validator is an MCP server designed to enhance the reliability and quality of TwinCAT 3 XML code generated or managed by AI assistants. It performs rigorous structural checks, enforces 21 IEC 61131-3 OOP rules, and provides auto-fix pipelines to ensure code correctness. The tool can also generate canonical TwinCAT XML skeletons for various file types, offering a consistent foundation for development. By connecting to LLM clients, it empowers AI assistants with the capability to produce robust, compliant, and maintainable TwinCAT code, complete with detailed validation reports and context-aware guidance.

Key Features

0118 GitHub stars
02Comprehensive validation for TwinCAT 3 XML files (structural, style, IEC 61131-3 OOP)
03Intent-aware OOP enforcement and policy resolution for flexible validation
04Deterministic auto-fix pipelines for common TwinCAT XML issues
05Canonical skeleton generation for TwinCAT POU, DUT, GVL, and IO files
06Integrated knowledge base and prompt templates for LLM-friendly workflows

Use Cases

01Integrating reliable TwinCAT code quality checks into LLM-driven development workflows
02Automating the validation and fixing of TwinCAT XML files for CI/CD pipelines
03Generating canonical TwinCAT project structures and code skeletons with AI assistance