# faze79/WPFVisualTreeMcp [Health: Active]

**Category:** 🖥️ OS Automation  
**Repository:** https://github.com/faze79/WPFVisualTreeMcp  
**GitHub Stars:** 23  
**Views:** 11  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/faze79-wpfvisualtreemcp

## Description
⃣ 🏠 🪟 - Inspect, debug and drive running WPF (.NET desktop) apps: visual tree, dependency properties, data bindings and binding errors, DataContext, and screenshots with open popups/menus included, plus clicking, item selection, text input and keyboard shortcuts. Auto-injects into any running WPF process (x64/x86) with no source changes. dotnet tool install -g WpfVisualTreeMcp

## Tools
Capabilities this server exposes over MCP:

- **wpf_list_processes** — List all running WPF applications
- **wpf_attach** — Attach to a WPF application (supports `auto_inject` for DLL injection)
- **wpf_get_visual_tree** — Get the visual tree hierarchy (default depth: 25, max: 100)
- **wpf_get_element_properties** — Get all dependency properties of an element
- **wpf_find_elements** — 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
- **wpf_find_elements_deep** — Same query filters without result limit, across all windows including adorners/popups
- **wpf_capture_screenshot** — Capture a screenshot of the window or element (returns image); `mode='screen'` includes popups and menus; `full_content=true` with render mode captures scrollable content
- **wpf_report** — Aggregate current binding/validation errors, UI state counts and recent binding traces, with explicit scan limits and coverage
- **wpf_record** — Start, stop, inspect or clear a workflow recording with stable selectors
- **wpf_assert** — Assert a dependency-property value; successful assertions are included in active recordings
- **wpf_replay** — Replay a workflow against a fresh app, stopping at the first failed step
- **wpf_export_test** — Export a stopped recording as a runnable xUnit project or workflow JSON
- **wpf_get_bindings** — Get data bindings for an element (includes MultiBinding, converter, StringFormat)
- **wpf_get_binding_errors** — List all captured binding errors
- **wpf_clear_binding_errors** — Clear the captured binding errors list
- **wpf_get_data_context** — Get DataContext type, properties, INPC status, and inheritance chain
- **wpf_get_resources** — Enumerate resource dictionaries
- **wpf_get_styles** — Get applied styles and templates
- **wpf_watch_property** — Monitor a property for changes
- **wpf_evaluate_binding** — Explain **why** a property has its value — value source, and for bindings a hop-by-hop path resolution pinpointing where a broken binding fails
- **wpf_explain_triggers** — 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
- **wpf_snapshot** — Capture an element subtree's state (layout, visibility, brushes, text) under a label
- **wpf_diff** — Diff two snapshots — measure exactly what a change moved (property from→to, added/removed)
- **wpf_set_property** — Live-edit** a dependency property at runtime (type-converted), to test a change without rebuilding. *State-changing, reversible.*
- **wpf_revert_property** — Undo `wpf_set_property` edits (one, filtered, or all) — restores the prior binding/value/default.
- **wpf_highlight_element** — Visually highlight an element
- **wpf_click_element** — Click a control by handle or AutomationId** — pass `automation_id="form.clear"` directly; optional `root_handle` scopes lookup and duplicate IDs fail. UI Automation invoke by default, `physical=true` for a real OS mouse click, `click_type='double'/'right'` for double/right clicks. *State-changing.*
- **wpf_move_mouse** — Move/hover** at a local point without clicking. Available from v0.17.0.
- **wpf_scroll** — Wheel input** vertically or horizontally; the app decides whether to scroll or zoom. Available from v0.17.0.
- **wpf_drag** — Drag with the mouse** — source and target elements or relative displacement, local points, left/right/middle button, gradual movement and release cleanup. *State-changing.*
- **wpf_touch_gesture** — Native touch** — tap, long press, swipe, two-finger pinch and rotation inside a visible element. Requires application touch support. *State-changing.*
- **wpf_select_item** — Select an item** in a ComboBox/ListBox/ListView/TabControl by visible text or index — works with virtualized items. *State-changing.*
- **wpf_wait_for** — Wait** until an element is visible/exists/enabled/hidden, polling in the target app — no sleep-and-retry loops.
- **wpf_set_text** — Set text/value** of a TextBox/ComboBox/PasswordBox — UI Automation `IValueProvider.SetValue` by default, `physical=true` to type via OS keyboard input. *State-changing.*
- **wpf_send_keys** — Send a keyboard shortcut** (`Ctrl+S`, `Alt+F4`, `F5`, `Enter`, ...) to an element or the focused window. *State-changing.*
- **wpf_get_layout_info** — Get layout information
- **wpf_export_tree** — Export visual tree to XAML or JSON

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/faze79/WPFVisualTreeMcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
dnx WpfVisualTreeMcp                        # runs the MCP stdio server
```

## Documentation

## What faze79/WPFVisualTreeMcp does

faze79/WPFVisualTreeMcp exposes a running WPF desktop application's UI through the Model Context Protocol. It is intended for Windows-based inspection, debugging, and UI automation, including applications built for .NET Framework 4.7.2, 4.8, or 4.8.1 and applications built for .NET 8, .NET 9, or .NET 10. Both x86 and x64 WPF processes are supported.

The server can discover WPF applications, attach to a selected process, and inspect its visual hierarchy. Agents can search for controls by AutomationId, type, `x:Name`, visible text, property values, or visibility. Deep searches extend across windows, adorners, and popups. Returned element data includes text, identifiers, enabled and visible state, and screen bounds.

## How it works

After attachment, the server operates against the live process rather than a project or source tree. Automatic injection can be enabled during `wpf_attach`, allowing inspection without adding code to the target application. Screenshots can target a window or element; screen capture includes open popups and menus, while full-content rendering can include scrollable content.

Diagnostic tools inspect dependency properties, bindings, converters, `StringFormat`, `MultiBinding`, binding errors, DataContext inheritance, resources, styles, and templates. `wpf_evaluate_binding` traces how a value was resolved and can identify the point where a binding path fails. Trigger inspection reports the conditions, current values, active state, and setters for style and control-template triggers.

For interaction, the server can invoke or physically click controls, move the mouse, scroll, drag between elements or points, edit dependency properties, highlight elements, and monitor property changes. State-changing actions include property edits, clicks, and drags. Edits can be reverted to the previous binding, value, or default.

## Setup and configuration

Install the global tool with `dotnet tool install -g WpfVisualTreeMcp`, or download and extract the Windows package from the project's latest release. The packaged executable requires a .NET 8, 9, or 10 Desktop Runtime. Register the executable as an MCP server using the client’s standard stdio configuration; for example, Claude Code can launch `WpfVisualTreeMcp.Server.exe` with no arguments from `.mcp.json`.

The executable also provides a command-line interface, including a help command and an update command. Start the MCP client after registration, launch the WPF application, and use `wpf_list_processes` followed by `wpf_attach` to select a target.

## Tools and capabilities

- Inspect visual trees, dependency properties, DataContext values, bindings, binding errors, resources, styles, and templates.
- Search controls with exact identifiers, type, name, text, property values, and visibility filters.
- Capture element, window, screen, and scrollable-content screenshots.
- Diagnose binding resolution and trigger behavior, then watch properties for changes.
- Record workflows, assert dependency-property values, replay against a fresh application, and export stopped recordings as xUnit projects or workflow JSON.
- Exercise live controls with clicks, mouse movement, scrolling, dragging, highlighting, and reversible property edits.

## Limitations and notes

The server targets running WPF applications on Windows; it is not a general web or cross-platform UI inspector. Physical mouse input and other state-changing operations can alter the target application. Popup and menu coverage depends on using the appropriate screen or deep-search modes, while touch behavior depends on the application's input support. The separate `WpfVisualTreeMcp.Automation` C# package provides an SDK for attaching to processes and driving inspection or input from .NET test projects.

_Full upstream README: https://allmcps.com/mcp/faze79-wpfvisualtreemcp/readme_

