som-window-mcp

v0.3.1
som-window-mcp Checked 2 days ago Published 13 days ago

Read-only MCP server that lets AI agents see Windows desktop UI: window list, UI Automation tree, and occlusion-proof screenshots.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_windows

List visible top-level windows, foreground first. Returns hwnd, process name, rect in physical screen pixels, whether the window is covered by another window (occluded), and whether it can only be read by an elevated server (elevated). Titles are localized by Windows. Use the hwnd with get_ui_tree and capture_window. hwnds are stable for the lifetime of a window but change when the app is restarted.

ParameterTypeDescription
include_desktopboolean

get_ui_tree

Read the UI Automation tree of one window as a compact text list. `window` is an hwnd from list_windows (e.g. "132456") or a unique part of a title or process name (e.g. "notepad"). ambiguous matches are an error, not a guess. Returns one line per interactive element: path, control type, name, automation id, screen rect. Invisible and zero-size elements are dropped. max_depth defaults to 8 and the walk is breadth-first, because shallow depth limits hide real controls (a calculator loses its keypad at depth 4, Explorer hides the file list at depth 6). max_node…

ParameterTypeDescription
window *string
include_containersboolean
include_textboolean
max_depthinteger
max_nodesinteger

inspect_element

Read the full content of one element, identified by a path. Call get_ui_tree first, then pass the path of the element you care about (for example "0.4.0.1"). Use this for elements that hold a lot of content - a document, a table, a long list, an edit field - where numbering every row would waste the whole mark budget. Returns the element's type, name, screen rect, its value or text (up to max_chars), and a summary of its immediate children. That child summary is usually enough to understand a table without capturing or marking it. Paths are positional: if the…

ParameterTypeDescription
path *string
window *string
max_charsinteger

capture_window

Capture one window's pixels, including while it is covered. Uses PrintWindow, which asks the window to render itself, so the window does not need to be in the foreground: a window hidden behind your terminal still captures cleanly and only that window's content is in the image. Returns an image plus a text block with the window title, the image size, and `origin` - the screen coordinate of image pixel (0,0), so any pixel can be mapped back to a screen position. max_side downscales large windows to keep image tokens sane (0 disables). Read-only. Minimised wind…

ParameterTypeDescription
window *string
max_sideinteger

capture_som

Capture a window with numbered marks on every interactive element. This is the tool to use when you need to understand *where* things are, not just *what* they are. The accessibility tree decides the boxes, so marks are pixel-exact and never hallucinated, and every mark in the legend carries a real screen rect. Prefer this over capture_window when you plan to act on the result: answer with a mark number, or use the rect directly and skip vision entirely. max_marks caps how many controls are numbered (dense toolbars get crowded); the highest-value controls are…

ParameterTypeDescription
window *string
max_marksinteger
max_sideinteger