Domoticz MCP python plugin

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Domoticz MCP python plugin

Post by domovincent »

I have created a Model Context Protocol (MCP) server for domoticz, so you can control it via Claude Desktop, Gemini, or whatever can speak MCP. It's published on github: https://github.com/adrighem/domoticz-mcp

I'm using it myself with gemini-cli, for some maintenance on the system. Stuff like: this event is not optimal because it does x and I need y, can you evaluate and fix it? It works fairly well, can authenticate both via Oauth2 as an app, and via basic auth (couldn't get oauth2 working at first because of my own setup at home, but it seems to work correctly now).

Please, feel free to use it.
It's my first public project.
Feedback on the MCP welcome.
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Domoticz MCP

Post by gizmocuz »

Domoticz has a MCP server build in... Is that not working for you?
Quality outlives Quantity!
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Domoticz MCP

Post by domovincent »

I feel slightly stupid right now...didn't know about it. But the releases don't contain it yet, and both the wiki and forum don't mention mcp either. But I see it in the code on the development branch. Apparently, it has existed since October last year. Will try the beta and let you know.
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Domoticz MCP

Post by waltervl »

See also https://github.com/domoticz/domoticz/pull/6388
Indeed not really documented on the wiki, who can do that?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Domoticz MCP

Post by gizmocuz »

Maybe @KitDigital ? It's pretty documented in the PR ;)
Quality outlives Quantity!
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Domoticz MCP

Post by waltervl »

PR info is added to wiki page https://wiki.domoticz.com/MCP_model_con ... otocol_LLM

Feel free to modify or update.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz MCP

Post by Itschi »

@domovincent: Excellent!!!

Other than the MCP client in Domoticz itself I got it working with my Chat Clients using supergateway as stdio -> http streamable adapter. Works great! As long as the internal MCP imlemtation is lacking real streaming support, you provided the first and only usable MCP server for Domoticz. Congratulations!

@waltervl: For me definitly worth to mention it in the Wiki as working streamable alternative. If you want, I could summarize a short how to.
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Domoticz MCP

Post by waltervl »

For plugin documentation it should be documented in the plugin repository or in this topic.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz MCP

Post by Itschi »

Well, but it's not a plugin but an externl tool that acts as a bridge between an LLM and Domoticz. Isn't the Wiki th reigth place for it?
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Domoticz MCP

Post by waltervl »

Itschi wrote: Friday 20 March 2026 14:12 Well, but it's not a plugin but an externl tool that acts as a bridge between an LLM and Domoticz. Isn't the Wiki th reigth place for it?
When you are talking about connecting a chat client on the build in Domoticz MCP as documented on the wiki it should be added to the wiki.

When you are talking about adding a chat client to the python MCP plugin from @domovincent, it should be added to this topic or to the plugin repository. I was assuming you were talking about the Python plugin MCP.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz MCP

Post by Itschi »

Well, I'm talking about connecting a chat client aka llm client via supergateway, @domovincent MCP client and Domoticz-API with Domoticz. Personally iI feel thsi is much closer to the Wiki articel about MCP rather than (Python-) plugins. Anyhow, I can do a short discription and we'll se where it fits best.
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Using AI tools with Domoticz, anyone given it a go?

Post by Itschi »

There is a nice alternativ solution of an MCP server from @domovincent that can be found here: https://github.com/adrighem/domoticz-mcp

Also it only supports stdio it can be combined with supergateway available at https://github.com/supercorp-ai/supergateway which acts as a stdio to streamable http adapter. With that you can use it with almost any chat client.

The insatllation of the MCP sever and supergateway ist pretty straight forward. See their instructions on github. I had issues with supergateways docker image but the standard installation works fine. After the installation you just have to start supergateway like:

Code: Select all

npx -y supergateway --stdio "set DOMOTICZ_URL="http://192.168.100.100:8080" && C:\mcp\Domoticz\domoticz-mcp\.venv\Scripts\domoticz-mcp.exe" --outputTransport streamableHttp --port 8099
Change IP, ports and path to the MCP server according to your installation.

As a result you can see here the MCP server in llama.cpp's WebUI. It comes with an extensive toolset (only fraction of it can be seen on the screenshot) that allows practical everything that's possible in Domoticz.
Screenshot 2026-03-21 104913.png
Screenshot 2026-03-21 104913.png (44.42 KiB) Viewed 4540 times
Herer is a test query:
Screenshot 2026-03-21 105330.png
Screenshot 2026-03-21 105330.png (44.82 KiB) Viewed 4540 times
Many thanks again to @domovincent who did a great job here and of course to suprgateway as well as to @KitDigital who did the first move within Domoticz.
Itschi
Posts: 34
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz MCP

Post by Itschi »

User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Domoticz MCP

Post by waltervl »

That is the wrong topic, I will move it to here....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Domoticz MCP python plugin

Post by domovincent »

Thanks for the endorsement @Itschi.
I'm using my domoticz-mcp (which can run inside of the llm chatclient or as a container, and connects to the domoticz API directly.

It currently supports sse and stdio, and hopefully streamable http soon too.

The reason I use it instead of the native mcp is because it allows me to work on events. Basically, it exposes more resources and tools of domoticz. Now your AI agent can help you troubleshoot and fix your broken event. Isn't that nice?
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Domoticz MCP python plugin

Post by gizmocuz »

That is nice, would be even better if it was just build into Domoticz and we did not need a external library (Which was what we intended to make)
I understand that not everyone knows c++, but with a simple ChatGPT/Claude code session missing parts could be integrated via a PR that we can check/merge
Quality outlives Quantity!
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Domoticz MCP python plugin

Post by domovincent »

Thanks for the suggestion gizmocuz. To be honest this was my first serious attempt at a project, and if I had known Domoticz had something in the works I would never even have attempted this. But hey...if nothing else, this has resulted in "experience".

Something built into domoticz is preferred, I understand that. Maybe there's a use case for my separate domoticz-mcp. It's easy to install/configure and use.

And let's see how much of my university c++ still remains. To be continued. :-)
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Domoticz MCP python plugin

Post by gizmocuz »

@domovincent, I love your work and already have created a PR so we are in sync

https://github.com/domoticz/domoticz/pull/6686/

Documentation is also updated:

https://wiki.domoticz.com/MCP_model_con ... otocol_LLM

If you already work with AI , AI can assist you in the c++ task
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 3026
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Domoticz MCP python plugin

Post by gizmocuz »

A lot of work has now been put into the native MCP handling.

Documentation has been updated

https://wiki.domoticz.com/MCP_model_con ... otocol_LLM
Quality outlives Quantity!
Post Reply