Skip to content

MCP Configure Issue #3393

@buttash

Description

@buttash

Describe the bug
I am setting up Claude to use Predbat's MCP. My configuration is:
"predbat-mcp": { "command": "/Users/martin/.nvm/versions/node/v20.19.4/bin/npx", "args": [ "mcp-remote", "http://homeassistant.local:8199/mcp", "--allow-http", "--header", "Authorization: mcp_live_a8f3e7d1b9c2f4a6e5d8c1b7a9f3e2d4c6b8a1e7f5d3c9b2a4e6f8d1c3b5a7" ], "env": { "PATH": "/Users/martin/.nvm/versions/node/v20.19.4/bin:/usr/local/bin:/usr/bin:/bin" } },

The http approach did not work in my environment - hence using npx with pointers to the specific version on my client.

Expected behaviour
Claude connects to Predbat's MCP successfully.

Instead, I get an authorisation screen. I put in the secret (as above) and then I get aredirect to:

http://localhost:14795/oauth/callback?code=MjPA-RTBHKUh2JndipvPPwWa_gVoGmqCDLTWgyk-Ib4&state=9a44d3a8-fe46-47fb-8158-1a009e12755c

This fails.

Predbat version

8.33.3

Environment details

Standard HAOS, running 8.33.3

Screenshots

Image Image

Log file
2026-02-19 10:37:16.738859: MCP GET: Received request from 192.168.1.65 2026-02-19 10:37:16.763566: MCP: Protected Resource Metadata request from 192.168.1.65 2026-02-19 10:37:16.763620: MCP: Protected Resource Metadata request from 192.168.1.65 2026-02-19 10:37:16.779533: MCP: OAuth Metadata request from 192.168.1.65 2026-02-19 10:37:16.819296: MCP POST: Received request from 192.168.1.65 2026-02-19 10:37:16.819411: MCP POST: Missing or invalid Authorization header 2026-02-19 10:37:16.827079: MCP: Protected Resource Metadata request from 192.168.1.65 2026-02-19 10:37:16.827131: MCP: Protected Resource Metadata request from 192.168.1.65 2026-02-19 10:37:16.838056: MCP: OAuth Metadata request from 192.168.1.65 2026-02-19 10:37:17.305617: MCP OAuth: Authorization request received from 192.168.1.65 2026-02-19 10:37:17.305693: MCP OAuth: GET authorization request from client_id: mcp-client-M83Rff0HyTMtAaY1KqrQJQ 2026-02-19 10:37:40.099203: MCP OAuth: Authorization request received from 192.168.1.65 2026-02-19 10:37:40.099512: MCP OAuth: POST authorization request from client_id: mcp-client-M83Rff0HyTMtAaY1KqrQJQ 2026-02-19 10:37:40.099566: MCP OAuth: User authenticated successfully 2026-02-19 10:37:40.099608: MCP OAuth: Authorization code generated for mcp-client-M83Rff0HyTMtAaY1KqrQJQ with state=9b3f2847-ac46-4703-a467-28c070a5a45a 2026-02-19 10:37:40.099623: MCP OAuth: Redirecting to http://localhost:14795/oauth/callback?code=1FzScAH9wIu28JhWNAr01H9AP86u1DQjJwJ_1sMJLsE&state=9b3f2847-ac46-4703-a467-28c070a5a45a 2026-02-19 10:37:40.169193: MCP: Default route for /.well-known/oauth-protected-resource/mcp - 404 Not Found 2

Claude log file:

`
2026-02-19T10:51:45.680Z [predbat-mcp] [info] Server started and connected successfully { metadata: undefined }
2026-02-19T10:51:45.743Z [predbat-mcp] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{"extensions":{"io.modelcontextprotocol/ui":{"mimeTypes":["text/html;profile=mcp-app"]}}},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0} { metadata: undefined }
[76861] Using existing client port: 14795
[76861] Using custom headers: {"Authorization":"mcp_live_a8f3e7d1b9c2f4a6e5d8c1b7a9f3e2d4c6b8a1e7f5d3c9b2a4e6f8d1c3b5a7"}
[76861] Discovering OAuth server configuration...
[76861] Discovered authorization server: http://homeassistant.local:8199
[76861] [76861] Connecting to remote server: http://homeassistant.local:8199/mcp
[76861] Using transport strategy: http-first
[76861]
Please authorize this client by visiting:
http://homeassistant.local:8199/oauth/authorize?response_type=code&client_id=mcp-client-M83Rff0HyTMtAaY1KqrQJQ&code_challenge=9UBBeSGXZCdNXBFMnTf__AuQGWEuVVoPHJTTTFUEE58&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A14795%2Foauth%2Fcallback&state=9b6129d7-2a4b-4586-81db-fb4338acf572&scope=mcp%3Aread+mcp%3Awrite+mcp%3Acontrol&resource=http%3A%2F%2Fhomeassistant.local%3A8199%2F

[76861] Browser opened automatically.
[76861] Authentication required. Initializing auth...
[76861] Initializing auth coordination on-demand
[76861] OAuth callback server running at http://127.0.0.1:14795
[76861] Creating lockfile for server dfbc535f08bb2bfa4be0a94996de60d5 with process 76861 on port 14795
[76861] Authentication required. Waiting for authorization...
`

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions