check-script

A command that checks an MDL script, the text format used to describe Mendix application changes, before it runs.

In plain words
What is it for?
It is for checking script syntax and, when given a Mendix project file, confirming that modules, entities, associations, and variables are valid.
Why use it?
It catches grammar, return-value, variable-scope, and reference problems before the script can cause errors during execution.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mendixlabs/mxcli/check-script
Clone the repo
git clone --depth 1 https://github.com/mendixlabs/mxcli

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 611 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00611
Opus 5 $0.00004 $0.00305
Sonnet 5 $0.00002 $0.00122
Haiku 4.5 $0.00001 $0.00061

Measured yesterday against content hash 949c993ee5b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

check-script scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/mendix/check-script.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Check Script

Validate an MDL script before executing it.

Commands

# Syntax check only (no project needed)
mxcli check script.mdl

# Syntax + reference validation (checks entities/modules exist)
mxcli check script.mdl -p app.mpr --references

What It Checks

Syntax check (always runs):

  • MDL grammar correctness
  • Proper statement structure
  • Valid keywords and types

Microflow body validation (always runs, no project needed):

  • RETURN must provide a value when microflow declares a return type
  • RETURN must not provide a value on void microflows (except RETURN empty)
  • Scalar literals (string, integer, boolean) cannot be returned from entity-typed microflows
  • All code paths must end with RETURN for non-void microflows
  • Variables declared inside IF/ELSE branches or ON ERROR bodies cannot be used outside the branch
  • VALIDATION FEEDBACK must have a non-empty message (CE0091)

Reference check (with --references, requires -p):

  • Module references exist
  • Entity references exist
  • Association references exist
  • Skips references to objects created in the same script
  • Variables must be declared before use with SET
  • Validates all branches (IF/ELSE) and loops
  • Tracks variable declarations from parameters, DECLARE, CREATE, RETRIEVE, CALL

Example Output

$ mxcli check domain-model.mdl -p app.mpr --references
Checking: domain-model.mdl
✓ Syntax OK (15 statements)
✓ References OK

$ mxcli check broken.mdl
Checking: broken.mdl
✗ Line 5: missing ';' at 'CREATE'
✗ Line 12: unknown type 'Strin'
Found 2 errors

$ mxcli check microflow.mdl
Checking: microflow.mdl
✓ Syntax OK (3 statements)
Validation errors:
  - statement 1 (Module.MyMicroflow): RETURN requires a value because microflow returns Boolean
  - statement 2 (Module.OtherFlow): microflow returns String but not all code paths have a RETURN statement
  - statement 3 (Module.ScopeIssue): variable '$X' is declared inside IF branch but used outside

$ mxcli check microflow.mdl -p app.mpr --references
Checking: microflow.mdl
✓ Syntax OK (1 statements)
Reference errors:
  statement 1: microflow 'Module.Name' has validation errors:
  - variable 'IsValid' is not declared. Use DECLARE IsValid: <Type> before using SET
✗ 1 reference error(s) found

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 80 lines · 8 tokens per session scan A 949c993ee5b0

Subscribe to this mod's changes

check-script is a command published in the GitHub repository mendixlabs/mxcli (115 stars, last pushed 2d ago), licensed Apache-2.0. It adds 8 tokens to every session and 611 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.