← Discover MCPs and Agents
w
MCPAI & MLGitHub

wpf-buddy-mcp

MCP server that lets AI agents drive, test, and inspect WPF desktop applications through UI Automation. Attach to any running WPF app, explore screens autonomously, explain UI state, and generate regression tests — all via natural language through the Model Context Protocol.

Links

README

From the repo.

WpfBuddy MCP

WpfBuddy MCP Server

The MCP server that understands WPF applications — not just pixels.

.NET 8 MCP FlaUI License Tools


Attach to any WPF app. Inspect its UI tree semantically. Automate workflows without coordinates. Generate tests. Diagnose binding errors. All through natural language via MCP.


Why This Exists

Generic Windows automation tools can click and type. This server understands WPF.

Generic Automation MCPWpfBuddy MCP
"Click at position (340, 220)""Click the Save button"
"Read pixels from screen""Get the UI tree with AutomationIds"
"Something failed""The Save button is disabled because SaveCommand.CanExecute returns false — the Name property is empty"
"Here's a screenshot""Here's the element tree, its bindings, validation state, and DataContext"

Core Differentiator

Given any WPF screen, inspect it semantically, automate a workflow without raw coordinates, explain WPF-specific failures, record the workflow, replay it deterministically, and export a maintainable automated test.


Quick Start

Prerequisites

  • .NET 8 SDK
  • Windows 10/11 (UI Automation is Windows-only)

Build & Run

dotnet build WpfBuddyMcp.sln
dotnet run --project src/WpfBuddy.Mcp.Server

Connect Your MCP Client

VS Code (GitHub Copilot)

Add to .vscode/mcp.json:

{
  "mcpServers": {
    "wpfbuddy-mcp": {
      "command": "dotnet",
      "args": ["run", "--project", "src/WpfBuddy.Mcp.Server/WpfBuddy.Mcp.Server.csproj"]
    }
  }
}
Claude Code

Add to claude_code_config.json:

{
  "mcpServers": {
    "wpfbuddy-mcp": {
      "command": "dotnet",
      "args": ["run", "--project", "C:/path/to/src/WpfBuddy.Mcp.Server/WpfBuddy.Mcp.Server.csproj"]
    }
  }
}

What Can It Do?

Attach & Inspect

"Attach to WPFapp and show me the main window structure"

The server attaches to any running WPF process, captures the full automation tree, and returns a semantic representation — control types, AutomationIds, names, patterns, states.

Automate Without Coordinates

"Click 'New Project', fill in Name as 'Test Project', then click Save"

All actions use semantic selectors (AutomationId → Name → ControlType), never raw screen coordinates. Selectors self-heal when the UI changes.

Record & Generate Tests

"Record what I'm doing, then export it as an xUnit test"

Records UI interactions as a workflow, validates selector stability, and exports production-ready xUnit + FlaUI test code with Page Object classes.

Diagnose WPF Issues

"Why is the Submit button disabled?"

With the optional in-process probe, inspects ViewModel command state, binding errors, DataContext properties, and validation — answering the "why" that generic tools cannot.

Accessibility Audit

"Run an accessibility check on this window"

Checks for missing names, keyboard accessibility, tab order, control patterns, and generates a report with recommendations.


Tool Categories

CategoryToolsDescription
Session15Attach, launch, detach, window management
Snapshot15UI tree capture, element queries, diff
Action27Click, type, select, drag, context menu, slider
Wait15Wait for state, visibility, value, dialog, navigation
Assertion16Assert state, text, grid, accessibility, snapshot
Selector11Build, validate, rank, heal, detect brittle
DataGrid & Tree16Grid rows/columns/cells, tree expand/select
Recording16Record, replay, pause, optimize, explain failures
Test Generation8Page objects, smoke tests, accessibility tests
Screenshot8Capture, annotate, compare, highlight
Accessibility9Audit names, tab order, keyboard, patterns
Policy & Safety10Capabilities, dry-run, redaction, audit
Reporting6Testability scores, diagnostics, export
Clipboard & Env7Clipboard, culture, theme, screen info
Probe (MVVM)7Connect/status/health for in-process probe
MVVM Diagnostics11ViewModel, bindings, commands, validation
Diagnostics5Environment, runtime, and system diagnostics
202Total tools

Full tool reference: docs/tools-reference.md


Architecture

┌─────────────────────────────────────────────────────────┐
│  MCP Client (VS Code Copilot, Claude Code, etc.)        │
└─────────────────────┬───────────────────────────────────┘
                      │ stdio (JSON-RPC)
┌─────────────────────▼───────────────────────────────────┐
│  WpfBuddy.Mcp.Server  (.NET 8)                          │
│                                                         │
│  ┌───────────────┐  ┌────────────┐  ┌─────────────────┐ │
│  │ SessionManager│  │ UiaAdapter │  │ SelectorBuilder │ |
│  │(attach/detach)│  │(FlaUI UIA3)│  │(heal/rank/build)│ |
│  └───────────────┘  └────────────┘  └─────────────────┘ │
│  ┌─────────────┐  ┌────────────┐  ┌─────────────────┐   │
│  │ Recording   │  │ Screenshot │  │   AuditLog      │   │
│  │  Service    │  │  Service   │  │                 │   │
│  └─────────────┘  └────────────┘  └─────────────────┘   │
│  ┌─────────────────────────────────────┐                │
│  │         ProbeClient (IPC)           │                │
│  └───────────────┬─────────────────────┘                │
└──────────────────┼──────────────────────────────────────┘
                   │ Named Pipe
┌──────────────────▼──────────────────────────────────────┐
│  Target WPF Application                                 │
│  ┌─────────────────────────────────────┐                │
│  │  WpfBuddy.Mcp.Probe (NuGet)         │                │
│  │  • ViewModel inspection             │                │
│  │  • Binding error capture            │                │
│  │  • Command state                    │                │
│  │  • Validation errors                │                │
│  │  • Dispatcher status                │                │
│  └─────────────────────────────────────┘                │
└─────────────────────────────────────────────────────────┘

Project Structure

wpf-buddy-mcp/
├── WpfBuddyMcp.sln
├── src/
│   ├── WpfBuddy.Mcp.Server/       # MCP server (main project)
│   │   ├── Program.cs                # Entry point, DI registration
│   │   ├── Services/                 # Core services
│   │   │   ├── SessionManager.cs     # Process attach/detach
│   │   │   ├── UiaAdapter.cs         # FlaUI wrapper
│   │   │   ├── SelectorBuilder.cs    # Selector generation & healing
│   │   │   ├── RecordingService.cs   # Workflow recording
│   │   │   ├── ScreenshotService.cs  # Screen capture
│   │   │   ├── ProbeClient.cs        # Named pipe IPC client
│   │   │   └── AuditLog.cs           # Action audit trail
│   │   ├── Tools/                    # MCP tool implementations
│   │   │   ├── SessionTools.cs
│   │   │   ├── SnapshotTools.cs
│   │   │   ├── ActionTools.cs
│   │   │   ├── WaitTools.cs
│   │   │   ├── AssertionTools.cs
│   │   │   ├── SelectorTools.cs
│   │   │   ├── DataGridTools.cs
│   │   │   ├── RecordingTools.cs
│   │   │   ├── TestGenerationTools.cs
│   │   │   ├── ScreenshotTools.cs
│   │   │   ├── AccessibilityTools.cs
│   │   │   ├── PolicyTools.cs
│   │   │   ├── ReportingTools.cs
│   │   │   ├── ClipboardTools.cs
│   │   │   ├── DiagnosticsTools.cs
│   │   │   ├── ProbeTools.cs
│   │   │   └── MvvmTools.cs
│   │   └── Models/                   # Data models
│   └── WpfBuddy.Mcp.Probe/        # In-process probe (NuGet package)
│       ├── ProbeHost.cs              # Named pipe server + WPF inspection
│       └── WpfBuddy.Mcp.Probe.csproj
└── docs/                             # Documentation

Safety & Security

PrincipleImplementation
Scoped executionOnly operates on the attached application — no OS-wide access
Audit trailEvery mutating action is logged with timestamp, tool name, and parameters
Dry-run modewpf_preview_action shows what would happen without executing
RedactionConfigurable rules to mask sensitive field values in snapshots
Policy engineControl destructive actions, coordinate fallback, timeouts, retries
No shell accessNo file system, registry, or process management tools

Optional: In-Process Probe

For deep WPF diagnostics (bindings, ViewModel, commands), install the probe NuGet in your target app:

dotnet add package WpfBuddy.Mcp.Probe
// In App.xaml.cs
protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
    ProbeHost.Start();  // Listens on named pipe automatically
}

Then from MCP: wpf_probe_connect → full MVVM diagnostics available.

Probe setup guide: docs/probe-setup.md


Tech Stack

ComponentTechnology
Runtime.NET 8 (net8.0-windows)
MCP SDKModelContextProtocol 0.2.0-preview.1
UI AutomationFlaUI.UIA3 4.0.0
Transportstdio (JSON-RPC)
DI/HostingMicrosoft.Extensions.Hosting 8.0.1
SerializationSystem.Text.Json 8.0.5
IPCNamed Pipes (System.IO.Pipes)

Documentation

DocumentDescription
docs/tools-reference.mdComplete tool reference with parameters and examples
docs/probe-setup.mdIn-process probe installation and usage guide
docs/architecture.mdDetailed architecture and design decisions
docs/examples.mdReal-world usage examples and workflows

Contributing

  1. Fork & clone
  2. dotnet build WpfBuddyMcp.sln
  3. Make changes
  4. Ensure build passes: dotnet build
  5. Submit PR

License

MIT

Collected info

  • 30 stars
  • 2 forks
  • Language: C#
  • Source updated: 9/10/2026

Config for your environment

Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.

Tool

OS

Config file: ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server": {
      "url": "{MCP_ENDPOINT_URL}"
    }
  }
}

Paste into mcpServers in the config file. Restart Cursor after saving.

If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.