[Remote MCP] OAuth regression: /authorize returns HTTP 500 after device verification

Author: nectarfloralCreated Sep 12, 2026Updated Sep 28, 2026

Summary

Remote MCP OAuth authorization is failing again at the authorization-session creation step. A newly paired Windows Remote Device comes online successfully, but MCP clients cannot complete OAuth. The /authorize endpoint returns HTTP 500 with:

json
{
  "error": "server_error",
  "error_description": "Failed to process authorization request: Failed to create OAuth session"
}

This appears to be a recurrence of #601 and #646. The failure was reproduced with both the default mcp-remote flow and a freshly registered OAuth client. No access tokens, refresh tokens, client secrets, account identifiers, device IDs, or private filesystem paths are included in this report.

Observation time

2026-09-12T03:34:12Z

Environment

Component Value
Remote Device host Windows desktop
Desktop Commander package @wonderwhy-er/[email protected]
Remote device command npx @wonderwhy-er/desktop-commander@latest remote
Remote device status Online after successful browser verification
MCP proxy [email protected]
MCP client host Ubuntu 24.04, Node.js 22.13.0
Browser used for account authorization Google Chrome
Remote MCP endpoint https://mcp.desktopcommander.app/mcp

Steps to reproduce

  1. On Windows, run:

    powershell
    npx @wonderwhy-er/desktop-commander@latest remote
  2. Complete browser verification. The browser shows Device verified, and the dashboard shows the Windows device as Online.

  3. Configure an MCP client through:

    bash
    npx -y mcp-remote https://mcp.desktopcommander.app/mcp
  4. Open the generated authorization URL.

  5. Observe that /authorize immediately returns HTTP 500 with Failed to create OAuth session.

Actual behavior

The Remote Device pairing succeeds, but client authorization fails before the authorization-code redirect. MCP tool discovery therefore times out and exposes no tools.

A direct unauthenticated MCP request returns HTTP 401, which is expected:

HTTP/2 401
{"error":"Unauthorized","message":"Authorization header required"}

The failure occurs specifically when creating the OAuth authorization session.

Expected behavior

The authorization endpoint should establish an OAuth session, allow the signed-in user to authorize the MCP client, redirect to the registered callback URI with an authorization code, and allow the client to exchange the code for tokens. MCP tools/list should then succeed while the Remote Device is online.

Diagnostics performed

1. OAuth discovery succeeds

GET https://mcp.desktopcommander.app/.well-known/oauth-authorization-server returns metadata advertising:

  • authorization_endpoint: https://mcp.desktopcommander.app/authorize
  • token_endpoint: https://mcp.desktopcommander.app/token
  • registration_endpoint: https://mcp.desktopcommander.app/register
  • PKCE method S256
  • scopes mcp:tools and desktop:auth
  • token endpoint methods none and client_secret_post

2. Dynamic client registration succeeds

A fresh client can be created through /register. The server returns a new client ID and matching registered localhost redirect URI. The newly issued client still fails at /authorize with the same HTTP 500 error.

3. Cached-client cleanup does not resolve the failure

The local ~/.mcp-auth/mcp-remote-v1 state was backed up, removed, and regenerated. The error remained unchanged. The previous state was restored afterward.

4. Static client information does not resolve the failure

mcp-remote@latest was tested with a newly registered client via --static-oauth-client-info. The authorization endpoint continued to return the same HTTP 500 error.

5. RFC 8707 resource indicators do not resolve the failure

The flow was tested both without an explicit resource and with the exact accepted resource:

https://mcp.desktopcommander.app/mcp

The accepted resource value still resulted in Failed to create OAuth session.

A trailing-slash resource was correctly rejected as invalid, confirming that request validation is active:

Invalid resource parameter. Expected one of: ...

6. Alternate advertised issuer fails identically

A newly registered client against https://auth.desktopcommander.app/register also received HTTP 500 from https://auth.desktopcommander.app/authorize with the same session-creation failure.

7. Protected-resource metadata remains nonconformant for strict clients

The following behaviors observed in #646 are still present:

  • GET /.well-known/oauth-protected-resource/mcp returns the HTML application instead of an RFC 9728 JSON document.
  • GET /.well-known/oauth-protected-resource returns JSON containing resource_server rather than the RFC 9728 resource member.
  • The HTTP 401 response from /mcp does not advertise protected-resource metadata through WWW-Authenticate.

A direct URL connector in another MCP client was rejected because the OAuth metadata was considered incomplete or unsupported. This may be related but is distinct from the HTTP 500 returned by /authorize.

Impact

The Windows Remote Device is successfully authenticated and online, but new MCP clients cannot authorize. Consequently, no file, process, terminal, or system-information tools can be discovered or called through Remote MCP.

Security and cleanup

All test client secrets and temporary OAuth files were deleted after reproduction. Existing local Desktop Commander and Claude Desktop settings were not modified. No destructive Desktop Commander operations were performed.

Request

Could you please check the backend logs for OAuth session creation around 2026-09-12T03:18Z–03:31Z and confirm whether the regression from #601/#646 has returned? It would also be helpful to verify the RFC 9728 protected-resource metadata and the WWW-Authenticate response from /mcp for strict MCP clients.

Related issues: #601, #646, and #600.

Source: wonderwhy-er/DesktopCommanderMCP