Skip to content

bug: obs-mcp: headless startup depends on X11 #4464

Closed

Description

@zackees

Bug: headless MCP startup requires an X server

Parent: #4444. Operator-reported startup failure on a Wayland host with XDG_SESSION_TYPE=wayland, WAYLAND_DISPLAY=wayland-0, and stale DISPLAY=:0:

Error: XOpenDisplay failed during hotkey initialization (DISPLAY=:0)
error: obs_startup: obs_init_hotkeys failed
error: obs_startup failed

rust/obs-mcp/src/ffi/mod.rs:645 calls obs_startup without selecting a Unix platform. libobs/obs-nix-platform.c.h:20 defaults to X11; libobs/obs-nix-x11.c.h:243 opens DISPLAY. Selecting Wayland with no compositor is also unsafe today: libobs/obs-nix-wayland.c.h:394 dereferences the null platform display.

Expected: the MCP host starts on Wayland and in headless CI without any X server. initialize/tools/list must succeed; unavailable graphics should be reported through readiness state rather than prevent the control server from starting.

Proposed fix: choose the Unix platform before the self-hosted libobs starts, retain any owned display connection through shutdown, and use a display-free hotkey implementation when there is no native display. Preserve GUI platform selection, existing C tests, public C headers and obs-websocket compatibility.

RED sketch: add cases to the existing obs-tests-app MCP stdio module. Spawn the real --mcp binary with DISPLAY pointing at a nonexistent display, both with Wayland session variables and without a compositor. Require initialize/tools/list, scene operations and clean EOF shutdown. Native real-app verification belongs in bosn; final host tools/list smoke will use the operator's Wayland environment.

Activity

  1. added
    bug
    ready
    mcp
    on Nov 10, 2026
  2. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    Claiming: headless MCP startup without X. Plan: (1) RED real MCP-host stdio cases with an unreachable DISPLAY in the existing obs-tests-app binary; (2) GREEN platform selection/display lifetime and no-display hotkeys; (3) focused native tests and bosn smoke, then CI/merge queue. The fix branch starts at current origin/master. No public C headers or existing C tests will change. #4452/#4454 remain untouched while queued.

  3. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    Fixed by merged #4466. The real-host regression was RED with nonexistent X/Wayland displays, then GREEN in bosn. The rebuilt native CLI also passed initialize/tools/list on the Wayland host with DISPLAY=:0, exposing all 30 tools, plus structured stats and a satisfied wait. No startup XOpenDisplay failure remains. Physical device/GUI validation is tracked in #4446, #4448 and #4449.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmcpready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions