Summary
Screenshot becomes unreliable on VM/RDP-hosted interactive desktops after the first successful capture: subsequent calls return an image the MCP client reports as "undecodable image" (empty/invalid bytes), while Snapshot and window listing keep working.
Environment
- Windows 11 VM guest (VMware/VirtualBox) driven through an RDP-hosted interactive session
- Codex Desktop 26.803.5235.0 with windows-mcp 0.8.5 via
uvx windows-mcp serve
- Python 3.14, screenshot backend
auto (dxcam -> mss -> pillow)
Reproduction
- Start a session with the MCP server and call
Screenshot once: returns a valid desktop image.
- Perform UI actions (open an app, type), then call
Screenshot again: returns "undecodable image".
- Retrying 10+ times, including forcing
pillow and dxcam backends, produces the same result.
- Note: the same environment cannot use Windows.Graphics.Capture at all (
SetIsBorderRequired failed 0x80004002), which is typical for VMs/RDP without full WDDM capture support.
Workaround found
Setting server env WINDOWS_MCP_SCREENSHOT_BACKEND=mss and WINDOWS_MCP_DISABLE_FLASH=1, then restarting the server, makes captures stable afterwards.
Suspected causes
- The always-on-top orange-red flash overlay window (rendered after capture) may break subsequent captures on capture-unfriendly environments.
- The
auto backend fallback may not handle a dxcam partial-initialization failure that produces empty frames instead of raising an exception, so it never falls through to mss/pillow.
Expected behavior
Screenshot should either fail loudly with a useful error and automatically fall back to a working backend, or remain stable across repeated calls.
Summary
Screenshotbecomes unreliable on VM/RDP-hosted interactive desktops after the first successful capture: subsequent calls return an image the MCP client reports as "undecodable image" (empty/invalid bytes), whileSnapshotand window listing keep working.Environment
uvx windows-mcp serveauto(dxcam -> mss -> pillow)Reproduction
Screenshotonce: returns a valid desktop image.Screenshotagain: returns "undecodable image".pillowanddxcambackends, produces the same result.SetIsBorderRequired failed 0x80004002), which is typical for VMs/RDP without full WDDM capture support.Workaround found
Setting server env
WINDOWS_MCP_SCREENSHOT_BACKEND=mssandWINDOWS_MCP_DISABLE_FLASH=1, then restarting the server, makes captures stable afterwards.Suspected causes
autobackend fallback may not handle a dxcam partial-initialization failure that produces empty frames instead of raising an exception, so it never falls through to mss/pillow.Expected behavior
Screenshotshould either fail loudly with a useful error and automatically fall back to a working backend, or remain stable across repeated calls.