This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

LM5-MCP-PA: let AI assistants (Claude, Codex, Antigravity…) read and program your Log
#1
Hi everyone,

I'm a KNX integrator from Vietnam. Most of my daily work is on LogicMachine: Lua scripts, scenes, schedulers, Modbus and visualization. Over the last weeks I built a small tool that lets an AI assistant work directly on the LM, and I'd like to share it with the community.

GitHub: https://github.com/panhhvtc-droid/LM5-MCP-PA

What is it?
LM5-MCP-PA is an MCP server (Model Context Protocol – the standard AI apps use to talk to external tools). It connects AI assistants such as Claude Desktop, Google Antigravity, Codex or Cursor to a LogicMachine on your LAN. You describe the task in plain language, and the AI reads and changes the LM for you, for example:

- "Which objects control the living-room lights? Where is 1/1/5 used?" (scripts, scenes, schedulers, visualization, trends)
- "Write an event script on 32/1/10 that switches 1/1/1 … and show me the script errors"
- "Create a scene 'Movie' with …", "Move the morning scheduler to 6:30"
- "Add a Modbus RTU device on RS485-1 with this profile", "Copy plan 'Floor 1' and remap its objects to 2/x/x"
- Several LMs (one per site) in one list: "switch to LM House A"

57 tools in total: objects, scripts, scenes, schedulers, Modbus, classic Visualization and the new Visu (FW 2025.11+), logs, read-only database queries.

How it works
- On the LM: paste lm/install.lua into a script and run it once. It installs a small gateway (.lp) protected by a random token, plus an agent event script on virtual object 32/7/255. No .ipk, nothing else changed. uninstall.lua removes everything.
- On the PC: Python 3.8+, standard library only. One-click .mcpb for Claude Desktop (from Releases), and a .bat installer for Codex / Antigravity.

Safety
- Old versions of scripts/objects are backed up locally before every change, and every write is logged.
- New scripts are created disabled.
- Read-only mode (on the PC side or READ_ONLY in install.lua) and a separate switch for writing to the KNX bus.
- Anyone with the token can change the LM, so keep it private and use it on the LAN only.

Tested so far
- LM5 Lite i.MX6 and LM5 RA i.MX6UL
- FW 20240426 and 2025.12: full checklist passed
- FW 20211215: works, except saving/deleting schedulers and deleting classic plans (no webrequest on this firmware)
- AI apps: Claude Desktop and Google Antigravity. Codex installer included but not tested yet.

Looking for help
I've only been able to test on my own sites, so I would really appreciate it if you could:
1. Try it on your LM (ideally a test unit or a backed-up project, read-only mode first) and report what works and what doesn't – especially other hardware models and firmware versions.
2. Tell me which daily tasks you would like the AI to handle.
3. Contribute fixes or new tools via GitHub (pull requests welcome).

Please open an issue on GitHub with your LM model, firmware, AI app/model and the error text:
https://github.com/panhhvtc-droid/LM5-MCP-PA/issues

One question for the Embedded Systems team: some features (scenes, schedulers, Modbus, Visu) currently go through internal functions such as webrequest() and the plugin handlers, because there's no public Lua API for them. If there is a recommended or more stable way to do this, I'd be glad to switch to it.

Notes
- Unofficial project, not affiliated with or endorsed by Embedded Systems SIA.
- License: GPLv3 with additional terms (keep the copyright notice; modified versions must use a different name).
- I also made similar MCP servers for JUNG Smart Visu Server and trivum, in case anyone works with those:
  https://github.com/panhhvtc-droid/SVS-MCP-PA
  https://github.com/panhhvtc-droid/TRIVUM-MCP-PA

Thanks for reading – feedback of any kind is welcome!

Phuong Anh
Reply


Forum Jump: