Skip to main content

Build IIoT Solutions Without Memorizing a Single Command

You don’t need to be a LoT (Language of Things) expert to build industrial IoT solutions with Coreflux. With an AI assistant connected to the Coreflux MCP, you describe what you want in plain English, and the AI writes the LoT code for you — correctly, following best practices, using real syntax from the official documentation. This page walks you through the entire workflow: from setting up the MCP connection to deploying a working IIoT feature, using only natural language prompts. Whether you’re monitoring factory temperatures, logging production data to a database, or bridging sensor networks to the cloud — the process is the same.
Like dictating a blueprint to an expert architect. You describe the building you want — “a sensor system that alerts when temperatures spike” — and the architect draws up structurally sound plans, handles the engineering codes, and hands you something ready to build.

When to Use This Guide

  • You’re new to Coreflux and want to build something real without learning LoT syntax first
  • You have an AI coding assistant (Cursor, Claude, Copilot) and want to use it effectively for IIoT
  • You want a step-by-step walkthrough of the AI-assisted development workflow
  • You’re exploring whether Coreflux fits your industrial automation or IoT data pipeline needs

Prerequisites

Before starting, make sure you have:
If you haven’t connected the Coreflux MCP to your AI assistant yet, follow the MCP Setup Guide first. It takes under 5 minutes.
You do not need prior experience with LoT syntax, MQTT, or industrial protocols. The AI assistant handles the technical details — you focus on describing your goals.

The AI-Assisted Workflow

Every AI-assisted Coreflux project follows three phases. This isn’t a suggestion — it’s the workflow that consistently produces working results. The key insight is that you are the domain expert and the AI is the LoT expert. You know your factory floor, your sensor layout, your business rules. The AI knows the syntax, the patterns, and the best practices. Together, you build faster than either could alone.

Phase 1: Plan Your Feature

The most important step happens before any code is written. A clear plan gives the AI the context it needs to produce working LoT code on the first try.

Describe Your Goal, Not Your Code

Tell the AI what you want to achieve, not how to write it. Let it choose the right LoT building blocks.
The more specific you are on the components you are working with (for example: hardware brands, specific protocols, IP addresses, ports, etc.), the better the end result will tend to be.
A clear, goal-oriented description that gives the AI enough context to make architectural decisions:

The Planning Checklist

Before you prompt your AI assistant, gather answers to these questions. You don’t need to answer all of them — but the more you provide, the better the result.
You can share this checklist directly with the AI. Paste it into your prompt and fill in the answers — the AI will use them to design the complete system.

Ask the AI to Propose an Architecture

Once you’ve described your goal, ask the AI to plan before coding. This avoids wasted iteration.
The AI will consult the Coreflux MCP documentation and respond with something like:
“For this system, I recommend:
  • An Action to monitor temperatures and trigger alerts
  • A Model to structure sensor readings into consistent JSON
  • A Route to store readings in PostgreSQL
  • A callable Action for the Celsius-to-Fahrenheit conversion (reusable)
Topic structure: sensors/+/reading (input), processed/+/fahrenheit (converted), alerts/temperature/+ (alerts)”
Review this before saying “go ahead.” It’s much easier to adjust a plan than to rewrite code.

Phase 2: Build with AI

Now let’s walk through a complete guided demo. We’ll build a temperature monitoring system that reads sensor data, converts units, triggers alerts, and logs to a database — all by prompting the AI.

Step 1: Create the Core Logic (Actions)

Start with the Action that processes incoming data. Paste this prompt into your AI assistant:
The AI will consult the Coreflux documentation through the MCP and produce working LoT code. Here is what a correct result looks like:
The AI uses the MCP’s consult_documentation and consult_internal_documentation tools behind the scenes to look up correct syntax. You don’t need to tell it to use the MCP — it does this automatically when it detects a Coreflux-related question.

Step 2: Add Unit Conversion (Callable Action)

Now ask the AI to add a reusable conversion utility:
The AI will produce two connected Actions:

Step 3: Structure the Data (Model)

Ask the AI to create a Model that formats raw sensor readings into consistent JSON:
The result:

Step 4: Connect to a Database (Route)

Now bring in a Route to persist the data. Ask the AI:
The AI generates:

Step 5: Deploy Everything

Ask the AI how to deploy your code:
The AI will explain the deployment process:
The recommended way to deploy LoT code is through the LoT Notebooks extension in VS Code or Cursor.
1

Create a Notebook

Create a new .lotnb file in your project. Each cell can contain one or more LoT definitions.
2

Add Your Code

Paste each definition into its own cell — this lets you deploy and test them individually.
3

Run Each Cell

Execute cells in order. The extension sends the LoT code to your connected Coreflux broker.
4

Verify in MQTT Explorer

Open MQTT Explorer and subscribe to # (all topics). Publish a test payload to sensors/temp001/temperature and watch the system respond.

Phase 3: Verify and Iterate

After deploying, test the system by publishing a simulated sensor reading.

Test Your System

Open MQTT Explorer (or any MQTT client) and follow these steps:
1

Subscribe to All Topics

Subscribe to # to see all messages flowing through the broker.
2

Publish a Test Reading

Publish to sensors/temp001/temperature with this payload:
3

Check the Results

You should see messages appear on these topics:
4

Test Below Threshold

Publish to sensors/temp001/temperature with {"value": 45.0}. Verify that no alert is generated — only the processed and fahrenheit topics should update.

When Something Doesn’t Work

If the output isn’t what you expect, describe the problem to the AI:
The AI will consult the MCP documentation and help you debug — checking for type casting issues, topic mismatches, or deployment errors. You don’t need to debug LoT syntax yourself. Describe the symptom, and the AI diagnoses the cause.

Prompt Patterns That Work

After building dozens of IIoT features with AI, these prompt patterns consistently produce the best results.

Pattern 1: Context → Goal → Constraints

Provide the situation, then state what you want, then add any constraints:

Pattern 2: Ask for Explanation Before Code

When learning, ask the AI to explain its choices:

Pattern 3: Incremental Building

Build complex systems one piece at a time rather than all at once:
Each step is small enough for the AI to get right, and you verify as you go.

Pattern 4: Reference the MCP Explicitly

When you need maximum accuracy, tell the AI to consult the documentation:
This triggers the AI to call consult_documentation or consult_internal_documentation through the MCP, ensuring the answer uses real, verified syntax.

Common Pitfalls

These mistakes happen frequently when developers start using AI for LoT development. Knowing them upfront saves hours of debugging.
If your AI assistant is not connected to the Coreflux MCP, it may generate LoT-like code that looks correct but uses invented syntax. Always verify the MCP connection before starting a session. Check that the consult_documentation and consult_internal_documentation tools appear in your assistant’s available tools.

Expanding Your System

Once the basic monitoring system works, you can extend it with a single prompt each. Here are natural next steps: Each of these is a single prompt that the AI can handle using the MCP documentation. The workflow is always the same: describe → review → deploy → verify.

Next Steps

Coreflux MCP Setup

Haven’t connected the MCP yet? Set up your AI assistant’s connection to the Coreflux documentation in under 5 minutes.

Best Practices & AGENTS.md

Level up your AI workflow with naming conventions, code patterns, and a project rules template that keeps your assistant consistent.
Last modified on May 22, 2026