Can't get Chatgpt desktop to authenticate with Openhab

I’m having trouble connecting connecting chatgpt with Openhab.

  1. I logged into my OpenhabCloud instance and verified I could see my overview page
  2. Installed the MCP binding
  3. Went into the settings and then I enabled the MCP binding and the webhook
  4. I then launch chatgpt app and enter settings via Edit menu
  5. searched for developer mode and enabled it
  6. Clicked on plugins and then click on mcp
  7. Created an entry for openab and entered https://myopenhab.org/api/hooks/ from the Cloud Webhook URL section
  8. save it
  9. Refreshed it and clicked on button to authenticate
  10. 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]}

your logs already show the oauth metadata wants https://myopenhab.org/api/hooks/, but in chatgpt you pasted the bare https://myopenhab.org/api/hooks/ path. that wont finish auth.

grab the full hook url with the real uuid from the mcp add-on settings (registerCloudWebhook on) or from the openhab log, then put that whole url in as the connector url.

chatgpt will open a browser login and you usually sign in twice (myopenhab first, then openhab). needs a paid chatgpt plan for connectors.

docs: openHAB MCP Server - System Integrations | openHAB

@nite_route, I replaced the actual uuid with <uuid> for security reasons in my original post. I have a paid plan. It just won’t open a browser login

if the connector url already has the full /api/hooks/ and it still never opens a browser, try the auth from a normal browser-based chatgpt window first (not only the desktop app). the desktop build sometimes fails to hand off the oauth popup.

also check that chatgpt is allowed to open links (os default browser set), and try pasting the authorization_endpoint from your log directly in a browser after a successful browser login, go back and hit authenticate again in the app.

if metadata returns fine but no browser ever launches, thats usually the chatgpt desktop side, not openhab.

I was able to create a direct connection with my openhab server. The issue I was having was that I was entering the bearer token in teh bearer token env var. After consulting with Chatgpt, it instructed me to enter the token via the authorization header. I attached the screenshot for those wish to bypass the openhab cloud and create a direction connection.