Screenshot returns undecodable image on VM/RDP desktops after the first capture
Author: SIMON-WORLDCreated Aug 9, 2026Updated Aug 28, 2026
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
Screenshotonce: returns a valid desktop image. - Perform UI actions (open an app, type), then call
Screenshotagain: returns "undecodable image". - Retrying 10+ times, including forcing
pillowanddxcambackends, 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
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.
Source: CursorTouch/Windows-MCP