TwinCAT ValidatorCAUTION
An MCP server that validates, auto-fixes, and scaffolds TwinCAT 3 XML files. Connect it to any LLM client to give your AI assistant reliable, deterministic TwinCAT code quality tooling — structural checks, 21 IEC 61131-3 OOP checks, auto-fix pipelines, and canonical skeleton generation.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT) [](https://modelcontextprotocol.io) [](https://github.com/psf/black)
An MCP server that validates, auto-fixes, and scaffolds TwinCAT 3 XML files (.TcPOU, .TcIO, .TcDUT, .TcGVL). Connect it to any LLM client to give your AI assistant reliable, deterministic TwinCAT code quality tooling — structural checks, 21 IEC 61131-3 OOP checks, auto-fix pipelines, and canonical skeleton generation.
Supported File Types
Installation
pip install twincat-validator-mcp
From Source
git clone https://github.com/agenticcontrolio/twincat-validator-mcp.git cd twincat-validator-mcp pip install -e .
Claude Desktop Extension
The easiest way to use this server with Claude Desktop is via the one-click .dxt extension:
pip install twincat-validator-mcp- Download the
.dxtfile from the latest release - Open Claude Desktop → Settings → Extensions → Install Extension
See dxt/README.md for full instructions and troubleshooting.
Connecting to an LLM Client
For other clients (Cursor, VS Code, Windsurf, Cline), the server uses stdio transport. Add the following to your client's MCP config file:
Cursor — .cursor/mcp.json
{
"mcpServers": {
"twedb6504c245aOBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add twincat-validator-mcp -- uvx twincat-validator-mcp
{
"mcpServers": {
"twincat-validator-mcp": {
"command": "uvx",
"args": [
"twincat-validator-mcp"
]
}
}
}Exposed tools (16)
11 read · 5 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
autofix_batch | read | Automatically fix multiple TwinCAT files matching glob patterns. |
autofix_file | read | Automatically fix common TwinCAT XML issues. |
check_specific | write | Run specific validation checks on a TwinCAT file. |
extract_methods_to_xml | read | Promote inline METHOD blocks from main ST to <Method> XML elements. |
generate_skeleton | read | Generate canonical deterministic TwinCAT XML skeleton for a file type. |
get_context_pack | read | Get curated knowledge base entries and OOP policy scoped by workflow stage. |
get_effective_oop_policy | read | Get effective OOP validation policy for a file or directory target. |
get_validation_summary | read | Get high-level file quality summary with health score. |
lint_oop_policy | read | Lint nearest .twincat-validator.json policy keys/types and return normalized policy. |
process_twincat_batch | write | Run enforced deterministic batch TwinCAT workflow. |
process_twincat_single | write | Run enforced deterministic single-file TwinCAT workflow. |
suggest_fixes | read | Generate prioritized fix recommendations from validation results. |
validate_batch | read | Validate multiple TwinCAT files matching glob patterns. |
validate_file | read | Validate a single TwinCAT file. |
validate_for_import | write | Quick validation check for TwinCAT import readiness. |
verify_determinism_batch | write | Run strict batch orchestration twice and report per-file idempotence stability. |
Trust audit
CAUTIONgrade B · trust 89/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- declared (2 observation(s))
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (3)
importlib.import_module(f"{__name__}.{module_name}")importlib.import_module(f"{__name__}.{module_name}")digest = hashlib.md5(seed.encode("utf-8")).hexdigest()Gates applied: no_behavioural_pass.
edb6504c245afull audit observations/trust-audit/mcp-server/agenticcontrolio__twincat-validator.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | edb6504c245a | CAUTION | B | 89 | first audit |
Questions
What is the TwinCAT Validator MCP server?
An MCP server that validates, auto-fixes, and scaffolds TwinCAT 3 XML files. Connect it to any LLM client to give your AI assistant reliable, deterministic TwinCAT code quality tooling — structural checks, 21 IEC 61131-3 OOP checks, auto-fix pipelines, and canonical skeleton generation.
What tools does TwinCAT Validator expose?
16 in total: 11 read-only, 5 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is TwinCAT Validator safe to connect to an agent?
With care. The audit graded it B (89/100) and found 3 things worth knowing before you trust this server, listed below with the exact line each was found on.
What credentials does TwinCAT Validator need?
No credential environment variables were found in its source, so it appears to need none.
How does TwinCAT Validator run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as twincat-validator-mcp.
How current is this page?
The grade is for one exact copy of the source (edb6504c245a), read on 2026-10-08. The repository is watched and re-audited when it changes.