Description
Environment: Windows 11 stable latest (26200.8655), PowerShell
When using DevSpace MCP with ChatGPT through a Cloudflare tunnel, the MCP works normally while the Node.js process keeps running. Disconnecting and reconnecting from ChatGPT does not break the connection.
However, after stopping the local server with Ctrl+C and starting it again with npm run start, ChatGPT can no longer reconnect. The OAuth page returns:
{"error":"invalid_client","error_description":"Invalid client_id"}
Steps to Reproduce
-
Start DevSpace with npm run start.
-
Add the MCP in ChatGPT and authenticate with the owner password.
-
Use the MCP to read local files successfully.
-
Disconnect and reconnect in ChatGPT; it still works.
-
Stop the local DevSpace process with Ctrl+C.
-
Run npm run start again.
-
Try reconnecting from ChatGPT.
-
The OAuth flow fails with invalid_client.
Expected Behavior
After restarting the DevSpace server, an existing ChatGPT MCP connection should either reconnect successfully, or the server should handle re-registration cleanly.
Actual Behavior
The server rejects the existing ChatGPT OAuth client with:
JSON
{"error":"invalid_client","error_description":"Invalid client_id"}
Possible Cause
From the source code, it looks like OAuth clients are stored in an in-memory Map. After the Node.js process restarts, the registered client_id is lost, while ChatGPT still tries to use the previously registered client_id.
This seems to make the OAuth client registration non-persistent across server restarts.
I would be happy to help with a PR if the maintainers agree this should be fixed by persisting registered OAuth clients. I am not very familiar with the whole codebase, so I would appreciate guidance on the preferred storage location and expected behavior.
Description
Environment: Windows 11 stable latest (26200.8655), PowerShell
When using DevSpace MCP with ChatGPT through a Cloudflare tunnel, the MCP works normally while the Node.js process keeps running. Disconnecting and reconnecting from ChatGPT does not break the connection.
However, after stopping the local server with Ctrl+C and starting it again with
npm run start, ChatGPT can no longer reconnect. The OAuth page returns:{"error":"invalid_client","error_description":"Invalid client_id"}Steps to Reproduce
Start DevSpace with
npm run start.Add the MCP in ChatGPT and authenticate with the owner password.
Use the MCP to read local files successfully.
Disconnect and reconnect in ChatGPT; it still works.
Stop the local DevSpace process with Ctrl+C.
Run
npm run startagain.Try reconnecting from ChatGPT.
The OAuth flow fails with
invalid_client.Expected Behavior
After restarting the DevSpace server, an existing ChatGPT MCP connection should either reconnect successfully, or the server should handle re-registration cleanly.
Actual Behavior
The server rejects the existing ChatGPT OAuth client with:
JSON
{"error":"invalid_client","error_description":"Invalid client_id"}Possible Cause
From the source code, it looks like OAuth clients are stored in an in-memory
Map. After the Node.js process restarts, the registeredclient_idis lost, while ChatGPT still tries to use the previously registered client_id.This seems to make the OAuth client registration non-persistent across server restarts.
I would be happy to help with a PR if the maintainers agree this should be fixed by persisting registered OAuth clients. I am not very familiar with the whole codebase, so I would appreciate guidance on the preferred storage location and expected behavior.