[BUG] Linux Claude Desktop: spawns MCP subprocesses without DISPLAY/XAUTHORITY, breaking OAuth browser login

Status Open
Reported on v2.1.198
Maintainer reply None cached
Activity 0 comments · opened Jul 31, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

On Linux, an OAuth-protected MCP server configured through the mcp-remote bridge can never complete its first-time login. Desktop launches the mcp-remote child process with a stripped environment (only PATH — no DISPLAY or XAUTHORITY), so the bridge's xdg-open call has no X display to render to. No browser tab ever appears, the login can't be completed, and Desktop kills the connection after its 60-second handshake timeout.

Current Outcome

No browser window appears.
Desktop marks the server failed. ~/.config/Claude/logs/main.log:

[LocalMcpServerManager] Failed to connect to test-mcp: MCP error -32001: Request timed out { timeout: 60000 }

mcp-remote logs Browser opened automatically even though nothing opened (~/.config/Claude/logs/mcp-server-test-mcp.log), because its xdg-open fails silently with no display.

Root cause / evidence

The Desktop-spawned mcp-remote process has no display environment. Comparing /proc/<pid>/environ:

Desktop-spawned mcp-remote (broken): only PATH present — no DISPLAY, no XAUTHORITY.
A normal terminal in the same X session: DISPLAY=:1, XAUTHORITY=/run/user/1000/gdm/Xauthority.
Running the identical npx mcp-remote http://localhost:8000/mcp from a shell that does have DISPLAY/XAUTHORITY opens the browser correctly and the login completes and caches a token. So the only difference is the missing display environment on the child Desktop spawns.

Environment

Claude Desktop 1.24012.9 (Electron 42.7.0), Linux build
Ubuntu 24.04.3 LTS, kernel 7.0.0-28-generic
Session: X11, GNOME (XDG_SESSION_TYPE=x11)
Bridge: npx mcp-remote@0.1.37, Node v22.14.0, npx 9.2.0

What Should Happen?

The OAuth login page opens in the user's browser (as on macOS/Windows), the user authorizes, and the connector attaches.

Error Messages/Logs

Steps to Reproduce

Desktop Config:

{
  "mcpServers": {
    "test-mcp": { "command": "npx", "args": ["mcp-remote", "http://localhost:8000/mcp"] }
  }
}

(Remote MCP server is FastMCP behind an OIDC/OAuth proxy; any OAuth-gated remote MCP server reproduces it.)

Steps to reproduce

  1. On Linux/X11, configure an OAuth-protected remote MCP server via mcp-remote as above.
  2. Start Claude Desktop and let it connect to the server.
  3. Observe: no browser tab opens; the connector fails to attach.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.198

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗