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

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

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

Post by matrek »

I enabled logs, and security seems to be correct since I can connect without issues to retrieve device lists via API. However, I noticed that a missing extension appears in the logs:

Code: Select all

2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] Host:172.21.0.1 Uri:/mcp
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] Request Headers:
Host: 127.0.0.1:8080
User-Agent: curl/7.88.1
Accept: */*

2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] IP (172.21.0.1) is within Trusted network range!
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] isPage 0 isAction 0 isUpgrade 0 needsAuthentication 0 isAuthenticated 1 (admin) isNew 1
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:/mcp] unable to determine extension for /opt/domoticz/www/mcp!
2026-03-30 17:10:21.002  [7fd58d1e96c0] Status: [web:8080] Incoming connection from: 172.21.0.1
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: Web ACLF: 172.21.0.1 - - [30/Mar/2026:17:10:21.002 +0200] "GET /mcp HTTP/1.1" 400 89 - "curl/7.88.1"
matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

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

Post by matrek »

I enabled logs, and security seems to be correct since I can connect without issues to retrieve device lists via API. However, I noticed that a missing extension appears in the logs:

Code: Select all

2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] Host:172.21.0.1 Uri:/mcp
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] Request Headers:
Host: 127.0.0.1:8080
User-Agent: curl/7.88.1
Accept: */*

2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] IP (172.21.0.1) is within Trusted network range!
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:8080] isPage 0 isAction 0 isUpgrade 0 needsAuthentication 0 isAuthenticated 1 (admin) isNew 1
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: [web:/mcp] unable to determine extension for /opt/domoticz/www/mcp!
2026-03-30 17:10:21.002  [7fd58d1e96c0] Status: [web:8080] Incoming connection from: 172.21.0.1
2026-03-30 17:10:21.002  [7fd58d1e96c0] Debug: Web ACLF: 172.21.0.1 - - [30/Mar/2026:17:10:21.002 +0200] "GET /mcp HTTP/1.1" 400 89 - "curl/7.88.1"
User avatar
kiddigital
Posts: 454
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by kiddigital »

@matrek , you need to connect an Agent like Claude or OpenwebUI which will start a MCP conversation. Your curl request does not send any payload for the MCP server to handle. It is a ‘bad request’ for the MCP server.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

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

Post by matrek »

Okay, let's go back to my initial issue with the OpenwebUI. I tried to add this as a "Tool Server" in the OpenwebUI but was unsuccessful, as shown in the attached screenshot:
Screenshot 2026-03-30 at 8.43.49 PM.jpg
Screenshot 2026-03-30 at 8.43.49 PM.jpg (86.77 KiB) Viewed 26090 times
In the logs of openwebUI, I see the same error (Bad Request):

Code: Select all

$ docker logs open-webui
...
2026-03-30 20:34:01.614 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - 192.168.9.51:61892 - "POST /api/v1/configs/tool_servers/verify HTTP/1.1" 400
2026-03-30 20:34:10.534 | INFO     | httpx._client:_send_single_request:1740 - HTTP Request: POST http://domoticz:8080/mcp "HTTP/1.1 400 Bad Request"
...
And Domoticz logs show the same error as my curl above:

Code: Select all

2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: [web:8080] Host:172.21.0.8 Uri:/mcp
2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: [web:8080] Request Headers:
Host: domoticz:8080
Accept-Encoding: gzip, deflate, br, zstd
Connection: keep-alive
User-Agent: python-httpx/0.28.1
accept: application/json, text/event-stream
content-type: application/json
Content-Length: 152

2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: [web:8080] IP (172.21.0.8) is within Trusted network range!
2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: [web:8080] isPage 0 isAction 0 isUpgrade 0 needsAuthentication 0 isAuthenticated 1 (admin) isNew 1
2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: [web:/mcp] unable to determine extension for /opt/domoticz/www/mcp!
2026-03-30 20:34:10.534  [7fd58d1e96c0] Debug: Web ACLF: 172.21.0.8 - - [30/Mar/2026:20:34:10.534 +0200] "POST /mcp HTTP/1.1" 400 89 - "python-httpx/0.28.1"
Then, I started making curl requests directly to the /mcp endpoint to check if any response is received, but no luck.

So, just a quick question: is there any other way I can confirm that the /mcp endpoint actually works in my domoticz instance?
Last edited by matrek on Monday 30 March 2026 20:54, edited 1 time in total.
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

@matrek, maybe you should first try VSCode as documented in the wiki. Whitelist your machine that runs VSCode in Domoticz, and you should be up and running in no time (Assuming you use the latest beta versions)
If that works, then try another application
Quality outlives Quantity!
matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

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

Post by matrek »

Okay, I will try using another agent. By the way, should I switch to beta instead of stable? I'm asking because I used the stable version 2026.1, as the wiki mentions that MCP is added in 2026.1, so I ran Domoticz via Docker Compose with the latest stable version as mentioned in one of my previous post.
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

Yes 100% ! There have been many additions to MCP in the latest beta versions.

If you want to stay ahead with AI, also stay ahead with Domoticz :ugeek:
Quality outlives Quantity!
matrek
Posts: 7
Joined: Saturday 30 March 2019 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

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

Post by matrek »

Ok, I figured out that on the stable 2026.1 version, the MCP server needs to be enabled with the "-mcp" flag, and then it works even in the openwebUI.

Code: Select all

2026-03-30 21:23:25.897  [7f54ed193780] Status: Model Context Protocol (MCP) Support enabled (/mcp)
But I will probably switch to beta soon :)

Thanks for your help!
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

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

Post by meal »

Hello,

I am running Domoticz 2026.1 v17592 on a RPI4B / bookworm.

I have configured Visual Studio Code to access a local Domoticz application using the following configuration file

"servers": {
"my-mcp-server-XXXXXX": {
"url": "http://192.168.0.112:8080/mcp",
"type": "http"
}
},
"inputs": []


Chat activity is successful and I can benefit of AI advise regarding this application via my-mcp-server-XXXXX.

I have a second Domoticz application running remotely and try unsuccessfully to get access to it via my-mcp-server-YYYYY. I have configured it as shown below:

"servers": {
"my-mcp-server-XXXXX": {
"url": "http://192.168.0.112:8080/mcp",
"type": "http"
},
"my-mcp-server-YYYYY": {
"url": "https://MyDomain:ZZZZ/mcp",
"type": "http"
}
},
"inputs": []
}
When starting my-mcp-server-YYYYY I get this eror in Visual Studio Code

2026-03-31 10:44:07.069 [info] Connection state: Starting
2026-03-31 10:44:07.085 [info] Starting server from LocalProcess extension host
2026-03-31 10:44:07.091 [info] Connection state: Running
2026-03-31 10:44:07.511 [warning] Could not fetch resource metadata: AggregateError: Failed to fetch resource metadata from all attempted URLs
2026-03-31 10:44:07.567 [warning] Error fetching authorization server metadata: Error: Failed to fetch authorization server metadata from https://MyDomain:ZZZZ/.well-known/oauth-authorization-server: 400 <html><head><title>Bad Request</title></head><body><h1>400 Bad Request</h1></body></html>
2026-03-31 10:44:07.567 [info] Discovered authorization server metadata at https://MyDomain:ZZZZ/.well-known/openid-configuration
2026-03-31 10:44:12.096 [info] Waiting for server to respond to `initialize` request...

I would apprciate if anyone has already addressed the issue to give me a hint to tackle it
BR
meal
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

@mael, you need authentication for your second instance, see the wiki manual. You need to use a token. (or whitelist your house ip address, but token would be better)
Quality outlives Quantity!
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

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

Post by meal »

@gizmocuz
Many thanks for the hint.

To summarize to use Visual Studio Code with a remote mcp server you have create a Mcp Server in View/Command Palette/Mcp Add Server.
It creates a mcp.json file located in windows directory "YourUser\AppData\Roaming\Code\User\"

And add
"headers": {
"Authorization": "Bearer TokenID"
}

as shown below:

{
"servers": {
"my-mcp-server-bee1ce86": {
"url": "https://YourDomain:YourPort/mcp",
"type": "http",
"headers": {
"Authorization": "Bearer TokenID"
}
}
},
"inputs": []
}

To create the TokenID you have to :
- create an application in domoticz with application name : domoticzmcp and client secret=YourClientSecret
- create a user in domoticz with name MCP password YourPWD.

and launch the linux command

curl --location --request POST 'https://YourDomain:YourPort/oauth2/v1/token?client_id=domoticzmcp&client_secret=YourClientSecret&username=MCP&password=YourPWD&grant_type=password'

The result is :
{
"access_token" : "TokenID",
"expires_in" : 3600,
"token_type" : "Bearer"
}

When starting the mcp server in Visual Studio Code the application prompts you to provide the application name and YourClientSecret then open the domoticz login page to fill in with MCP as the name and YourPWD as password.

BR
meal
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

meal wrote: Wednesday 01 April 2026 19:51 @gizmocuz
Many thanks for the hint.
If it is not to much to ask, could you check this page if it is missing any information?

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

If it is, could you update

mcp.wiki in this folder:

https://github.com/domoticz/domoticz/tr ... pment/docs
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

Lot's have been changed related to MCP.

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

Now it is also very easy to create a access token to be used with it
Quality outlives Quantity!
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

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

Post by meal »

Hello,

I am using Domoticz 2026.1 V17917 and struggling to connect Claude to Domoticz mcp server.

I have created a token id via Domoticz- Setup → More Options → Access Tokens.

Here is my configuration in MyUser\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

{
"preferences": {
"coworkWebSearchEnabled": true,
"coworkScheduledTasksEnabled": false,
"ccdScheduledTasksEnabled": false
},
"mcpServers": {
"domoticz": {
"command": "/usr/local/bin/mcp-proxy",
"args": ["--transport", "streamablehttp", "https://MyDomain:MyPort/mcp"],
"env": {
"API_ACCESS_TOKEN": "token id"
}
}
}
}

When running Claude I get the error message:

[error] spawn /usr/local/bin/mcp-proxy ENOENT

It seems that mcp-proxy cannot be found.

I would appreciate if someone has already succeeded to connect Claude to domoticz mcp server or if he could provide a hint to tackle the issue.

BR
meal
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

I am using claude code myself and have no issues using it as described in the wiki above. I also tested the Domoticz MCP with

https://inspector.mcp-use.com/

(and other test tools that you can install locally)

Are you able to use the MCP server when you put the IP running claude in the whitelist in the Domoticz Settings? Maybe that would be a first step, next secure it with a token

Edit: Also try with VS Code first to see if the correction is OK
Quality outlives Quantity!
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

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

Post by meal »

@gizmocuz

domoticz mcp server is working perfectly with Visual Studio Code in remote mode.

I checked with MCP inspector the access in local mode http://192.168.0.xxx:8080/mcp and https://mydomain:myport/mcp and both are accessible.

My issue is more with the installation of mcp-proxy.

Do I need it installed ?

On my RPI ? or on my laptop windows ?

BR
meal
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: Using AI tools with Domoticz, anyone given it a go?

Post by gizmocuz »

I have no idea what MCP proxy is, so I would say this is not needed.
Quality outlives Quantity!
mgugu
Posts: 238
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

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

Post by mgugu »

meal wrote: Sunday 03 May 2026 9:29 @gizmocuz

domoticz mcp server is working perfectly with Visual Studio Code in remote mode.

I checked with MCP inspector the access in local mode http://192.168.0.xxx:8080/mcp and https://mydomain:myport/mcp and both are accessible.

My issue is more with the installation of mcp-proxy.

Do I need it installed ?

On my RPI ? or on my laptop windows ?

BR
mcp-proxy is only needed if a conversion SSE <-> STDIO is required which is the case for free Claude account. For paid account like Claude Code, not needed.
meal
Posts: 127
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

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

Post by meal »

Hello,

I am currently using a free account for Claude access. I understand that I need mcp-proxy.

I have a windows labtop connected to my RPI4B+ running domoticz 2026.1 V17928.

How do I install mcp-proxy ?

Many thanks for your help
BR
meal
mgugu
Posts: 238
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

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

Post by mgugu »

Ask Claude ... With this prompt: "How do I connect Claude Desktop (Windows) with Domoticz mcp server, using mcp-proxy"
Post Reply