I’m having trouble connecting connecting chatgpt with Openhab.
- I logged into my OpenhabCloud instance and verified I could see my overview page
- Installed the MCP binding
- Went into the settings and then I enabled the MCP binding and the webhook
- I then launch chatgpt app and enter settings via Edit menu
- searched for developer mode and enabled it
- Clicked on plugins and then click on mcp
- Created an entry for openab and entered https://myopenhab.org/api/hooks/ from the Cloud Webhook URL section
- save it
- Refreshed it and clicked on button to authenticate
- I get an error saying it can’t connect to Openhab
I tried troubleshooting with chatgpt and it verified it reaches the openhab mcp server and gets a 401 error which is fine since I need to authenticate. However, I can’t get it to work. Any suggestions?
Below are debug messages on the Openhab Console when I try to authenticate
21:08:27.559 [DEBUG] [io.mcp.internal.auth.McpAuthenticator] - Auth reject: GET /mcp — no Authorization/X-OPENHAB-TOKEN header
21:08:27.560 [DEBUG] [avaxStreamableServerTransportProvider] - Streamable GET rejected: /mcp from 127.0.0.1
21:08:28.100 [DEBUG] [internal.servlet.OAuthMetadataServlet] - OAuth metadata GET /mcp/.well-known/oauth-protected-resource -> {resource=https://myopenhab.org/api/hooks/<uuid>, authorization_servers=[https://myopenhab.org/api/hooks/<uuid>], bearer_methods_supported=[header], scopes_supported=[mcp], resource_documentation=https://www.openhab.org/addons/integrations/mcp}
21:08:28.634 [DEBUG] [internal.servlet.OAuthMetadataServlet] - OAuth metadata GET /mcp/.well-known/oauth-authorization-server -> {issuer=https://myopenhab.org/api/hooks/<uuid>, authorization_endpoint=https://connect.myopenhab.org/auth/authorize, token_endpoint=https://myopenhab.org/api/hooks/<uuid>/oauth/token, registration_endpoint=https://myopenhab.org/api/hooks/<uuid>/oauth/register, response_types_supported=[code], grant_types_supported=[au uthorization_code, refresh_token], code_challenge_methods_supported=[S256], token_endpoint_auth_methods_supported=[none], scopes_supported=[mcp]}
21:08:29.219 [DEBUG] [io.mcp.internal.auth.McpAuthenticator] - Auth reject: GET /mcp — no Authorization/X-OPENHAB-TOKEN header
21:08:29.220 [DEBUG] [avaxStreamableServerTransportProvider] - Streamable GET rejected: /mcp from 127.0.0.1
21:08:29.761 [DEBUG] [internal.servlet.OAuthMetadataServlet] - OAuth metadata GET /mcp/.well-known/oauth-protected-resource -> {resource=https://myopenhab.org/api/hooks/<uuid>, authorization_servers=[https://myopenhab.org/api/hooks/<uuid>], bearer_methods_supported=[header], scopes_supported=[mcp], resource_documentation=https://www.openhab.org/addons/integrations/mcp}
21:08:30.303 [DEBUG] [internal.servlet.OAuthMetadataServlet] - OAuth metadata GET /mcp/.well-known/oauth-authorization-server -> {issuer=https://myopenhab.org/api/hooks/<uuid>, authorization_endpoint=https://connect.myopenhab.org/auth/authorize, token_endpoint=https://myopenhab.org/api/hooks/<uuid>/oauth/token, registration_endpoint=https://myopenhab.org/api/hooks/<uuid>/oauth/register, response_types_supported=[code], grant_types_supported=[au uthorization_code, refresh_token], code_challenge_methods_supported=[S256], token_endpoint_auth_methods_supported=[none], scopes_supported=[mcp]}
