[Remote MCP] OAuth regression: /authorize returns HTTP 500 after device verification
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:
{
"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
On Windows, run:
npx @wonderwhy-er/desktop-commander@latest remoteComplete browser verification. The browser shows
Device verified, and the dashboard shows the Windows device asOnline.Configure an MCP client through:
npx -y mcp-remote https://mcp.desktopcommander.app/mcpOpen the generated authorization URL.
Observe that
/authorizeimmediately returns HTTP 500 withFailed 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/authorizetoken_endpoint:https://mcp.desktopcommander.app/tokenregistration_endpoint:https://mcp.desktopcommander.app/register- PKCE method
S256 - scopes
mcp:toolsanddesktop:auth - token endpoint methods
noneandclient_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/mcpThe 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/mcpreturns the HTML application instead of an RFC 9728 JSON document.GET /.well-known/oauth-protected-resourcereturns JSON containingresource_serverrather than the RFC 9728resourcemember.- The HTTP 401 response from
/mcpdoes not advertise protected-resource metadata throughWWW-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