wpf_wait_for
Wait until an element is visible/exists/enabled/hidden, polling in the target app — no sleep-and-retry loops.
How to use it
wpf_wait_for is exposed by the WPFVisualTreeMcp MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the wpf_wait_for tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install WPFVisualTreeMcp
claude mcp add wpf-visual-tree -- C:/path/to/WpfVisualTreeMcp/publish/WpfVisualTreeMcp.Server.exeOther tools in WPFVisualTreeMcp (27)
Attach to a WPF application (supports autoinject for DLL injection)
Capture a screenshot of the window or element (returns image); mode='screen' captures real on-screen pixels including open popups, dropdowns and context menus
Clear the captured binding errors list
Click a control — UI Automation invoke (Invoke/Toggle/Select/ExpandCollapse) by default, physical=true for a real OS mouse click (auto-scrolls into view), clicktype='double'/'right' for double/right clicks. State-changing.
Diff two snapshots — measure exactly what a change moved (property from→to, added/removed)
Explain why a property has its value — value source, and for bindings a hop-by-hop path resolution pinpointing where a broken binding fails
Evaluate Style and ControlTemplate triggers against the current state (condition, current value, active, setters) — 'why doesn't this trigger fire?'; and attribute a property's value to the style setter / active trigger that set it
Export visual tree to XAML or JSON
Query elements by type, x:Name, visible text, property values and visibility; results include text, automation id, enabled/visible state and screen bounds
Same query filters without result limit, across all windows including adorners/popups
List all captured binding errors
Get data bindings for an element (includes MultiBinding, converter, StringFormat)
Get DataContext type, properties, INPC status, and inheritance chain
Get all dependency properties of an element
Get layout information
Enumerate resource dictionaries
Get applied styles and templates
Get the visual tree hierarchy (default depth: 25, max: 100)
Visually highlight an element
List all running WPF applications
Undo wpfsetproperty edits (one, filtered, or all) — restores the prior binding/value/default.
Select an item in a ComboBox/ListBox/ListView/TabControl by visible text or index — works with virtualized items. State-changing.
Send a keyboard shortcut (Ctrl+S, Alt+F4, F5, Enter, ...) to an element or the focused window. State-changing.
Live-edit a dependency property at runtime (type-converted), to test a change without rebuilding. State-changing, reversible.
Set text/value of a TextBox/ComboBox/PasswordBox — UI Automation IValueProvider.SetValue by default, physical=true to type via OS keyboard input. State-changing.
Capture an element subtree's state (layout, visibility, brushes, text) under a label
Monitor a property for changes