New advertisers: 50% off your first month with code FIRSTMONTHSee slots
gaoshang212 avatar

Wpf Lens

gaoshang212/wpflens

Inspects, diagnoses, and drives running WPF apps: visual trees, bindings, screenshots, and input.

GitHub stars
1
tools
38
transport
STDIO
last updated
Nov 16, 2026
View on GitHub

What it does

  • Inspects with wpf_get_visual_tree, wpf_find_elements, and wpf_get_element_properties, and diagnoses with wpf_get_binding_errors, wpf_evaluate_binding, and wpf_report
  • Drives input with wpf_click_element, wpf_drag, wpf_touch_gesture, wpf_set_text, and wpf_send_keys, which change application state
  • Requires Windows and a running WPF app; attaches by process, with optional DLL injection via auto_inject
  • Designed for debugging bindings, verifying UI behavior, and scripting WPF UI tests from an AI agent

Tools

38 tools

Public tool metadata for what this MCP can expose to an agent.

wpf_list_processesList all running WPF applications

List all running WPF applications

No parameter schema in public metadata yet.

wpf_attachAttach to a WPF application (supports `auto_inject` for DLL injection)

Attach to a WPF application (supports `auto_inject` for DLL injection)

No parameter schema in public metadata yet.

wpf_get_visual_treeGet the visual tree hierarchy (default depth: 25, max: 100)

Get the visual tree hierarchy (default depth: 25, max: 100)

No parameter schema in public metadata yet.

wpf_get_element_propertiesGet all dependency properties of an element

Get all dependency properties of an element

No parameter schema in public metadata yet.

wpf_find_elementsQuery elements by exact AutomationId, type, x:Name, visible text, property values and visibility; results include text, automation id, enabled/visible state and screen bounds

Query elements by exact AutomationId, type, x:Name, visible text, property values and visibility; results include text, automation id, enabled/visible state and screen bounds

No parameter schema in public metadata yet.

wpf_find_elements_deepSame query filters without result limit, across all windows including adorners/popups

Same query filters without result limit, across all windows including adorners/popups

No parameter schema in public metadata yet.

wpf_capture_screenshotCapture a specific control, Window or rendered Popup content by handle (returns image); mode='screen' reads pixels within that target's rectangle; full_content=true with render mode captures scrollable content

Capture a specific control, Window or rendered Popup content by handle (returns image); mode='screen' reads pixels within that target's rectangle; full_content=true with render mode captures scrollable content

No parameter schema in public metadata yet.

wpf_reportAggregate current binding/validation errors, UI state counts and recent binding traces, with explicit scan limits and coverage

Aggregate current binding/validation errors, UI state counts and recent binding traces, with explicit scan limits and coverage

No parameter schema in public metadata yet.

wpf_recordStart, stop, inspect or clear a workflow recording with stable selectors

Start, stop, inspect or clear a workflow recording with stable selectors

No parameter schema in public metadata yet.

wpf_get_recordingStart, stop, inspect or clear a workflow recording with stable selectors

Start, stop, inspect or clear a workflow recording with stable selectors

No parameter schema in public metadata yet.

wpf_assertAssert a dependency-property value; successful assertions are included in active recordings

Assert a dependency-property value; successful assertions are included in active recordings

No parameter schema in public metadata yet.

wpf_replayReplay a workflow against a fresh app, stopping at the first failed step

Replay a workflow against a fresh app, stopping at the first failed step

No parameter schema in public metadata yet.

wpf_export_testExport a stopped recording as a runnable xUnit project or workflow JSON

Export a stopped recording as a runnable xUnit project or workflow JSON

No parameter schema in public metadata yet.

wpf_get_bindingsGet data bindings for an element (includes MultiBinding, converter, StringFormat)

Get data bindings for an element (includes MultiBinding, converter, StringFormat)

No parameter schema in public metadata yet.

wpf_get_binding_errorsList all captured binding errors

List all captured binding errors

No parameter schema in public metadata yet.

wpf_clear_binding_errorsClear the captured binding errors list

Clear the captured binding errors list

No parameter schema in public metadata yet.

wpf_get_data_contextGet DataContext type, properties, INPC status, and inheritance chain

Get DataContext type, properties, INPC status, and inheritance chain

No parameter schema in public metadata yet.

wpf_get_resourcesEnumerate resource dictionaries

Enumerate resource dictionaries

No parameter schema in public metadata yet.

wpf_get_stylesGet applied styles and templates

Get applied styles and templates

No parameter schema in public metadata yet.

wpf_watch_propertyMonitor a property for changes

Monitor a property for changes

No parameter schema in public metadata yet.

wpf_evaluate_bindingExplain why a property has its value — value source, and for bindings a hop-by-hop path resolution pinpointing where a broken binding fails

Explain why a property has its value — value source, and for bindings a hop-by-hop path resolution pinpointing where a broken binding fails

No parameter schema in public metadata yet.

wpf_explain_triggersEvaluate Style and ControlTemplate triggers against the current state and attribute a property's value to the style setter / active trigger that set it

Evaluate Style and ControlTemplate triggers against the current state and attribute a property's value to the style setter / active trigger that set it

No parameter schema in public metadata yet.

wpf_snapshotCapture an element subtree's state (layout, visibility, brushes, text) under a label

Capture an element subtree's state (layout, visibility, brushes, text) under a label

No parameter schema in public metadata yet.

wpf_diffDiff two snapshots — measure exactly what a change moved (property from→to, added/removed)

Diff two snapshots — measure exactly what a change moved (property from→to, added/removed)

No parameter schema in public metadata yet.

wpf_set_propertyLive-edit a dependency property at runtime (type-converted), to test a change without rebuilding. State-changing, reversible.

Live-edit a dependency property at runtime (type-converted), to test a change without rebuilding. State-changing, reversible.

No parameter schema in public metadata yet.

wpf_revert_propertyUndo wpf_set_property edits (one, filtered, or all) — restores the prior binding/value/default.

Undo wpf_set_property edits (one, filtered, or all) — restores the prior binding/value/default.

No parameter schema in public metadata yet.

wpf_highlight_elementVisually highlight an element

Visually highlight an element

No parameter schema in public metadata yet.

wpf_click_elementClick a control by handle or AutomationId, with UI Automation invoke by default, physical=true for a real OS mouse click, and double/right click types. State-changing.

Click a control by handle or AutomationId, with UI Automation invoke by default, physical=true for a real OS mouse click, and double/right click types. State-changing.

No parameter schema in public metadata yet.

wpf_move_mouseMove/hover at a local point without clicking. Available from v0.17.0.

Move/hover at a local point without clicking. Available from v0.17.0.

No parameter schema in public metadata yet.

wpf_scrollWheel input vertically or horizontally; the app decides whether to scroll or zoom. Available from v0.17.0.

Wheel input vertically or horizontally; the app decides whether to scroll or zoom. Available from v0.17.0.

No parameter schema in public metadata yet.

wpf_dragDrag with the mouse between source and target elements or by relative displacement, with local points, button choice, gradual movement and release cleanup. State-changing.

Drag with the mouse between source and target elements or by relative displacement, with local points, button choice, gradual movement and release cleanup. State-changing.

No parameter schema in public metadata yet.

wpf_touch_gestureNative touch — tap, long press, swipe, two-finger pinch and rotation inside a visible element. Requires application touch support. State-changing.

Native touch — tap, long press, swipe, two-finger pinch and rotation inside a visible element. Requires application touch support. State-changing.

No parameter schema in public metadata yet.

wpf_select_itemSelect an item in a ComboBox/ListBox/ListView/TabControl by visible text or index, working with virtualized items. State-changing.

Select an item in a ComboBox/ListBox/ListView/TabControl by visible text or index, working with virtualized items. State-changing.

No parameter schema in public metadata yet.

wpf_wait_for_elementWait until an element is visible/exists/enabled/hidden, polling in the target app

Wait until an element is visible/exists/enabled/hidden, polling in the target app

No parameter schema in public metadata yet.

wpf_set_textSet text/value of a TextBox/ComboBox/PasswordBox via UI Automation IValueProvider.SetValue by default, or physical=true to type via OS keyboard input. State-changing.

Set text/value of a TextBox/ComboBox/PasswordBox via UI Automation IValueProvider.SetValue by default, or physical=true to type via OS keyboard input. State-changing.

No parameter schema in public metadata yet.

wpf_send_keysSend a keyboard shortcut (Ctrl+S, Alt+F4, F5, Enter, ...) to an element or the focused window. State-changing.

Send a keyboard shortcut (Ctrl+S, Alt+F4, F5, Enter, ...) to an element or the focused window. State-changing.

No parameter schema in public metadata yet.

wpf_get_layout_infoGet layout information

Get layout information

No parameter schema in public metadata yet.

wpf_export_treeExport visual tree to XAML or JSON

Export visual tree to XAML or JSON

No parameter schema in public metadata yet.

Readme

WpfLens

English | 简体中文

Build Release License: MIT MCP Compatible

Inspect, diagnose, and automate running WPF applications.

WpfLens gives AI agents access to the visual tree, bindings, properties, screenshots and input actions through MCP. It also provides a CLI (wpflens) and a C# SDK (WpfLens.Automation). Automatic injection lets you inspect applications without changing their source.

Based on faze79/WPFVisualTreeMcp, with upstream baseline v0.20.0. The first WpfLens release is 0.21.0.


View the full README on GitHub

Details

Repository
github.com/gaoshang212/wpflens
Categories
Testing & QA, Developer Tools
Package
WpfLens.Mcp
Transport
STDIO
Registry
MCP registry, active

Similar to Wpf Lens

More Testing & QA