# WPF Locator Doctor

> WPF Locator Doctor is an open-source MCP server for developer tools. Scores how testable a WPF app is and suggests the AutomationId fixes UI tests need. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Windows, Linux, macOS
- **Repository:** https://github.com/swechhap/wpf-locator-doctor
- **MCP Registry name:** io.github.swechhap/wpf-locator-doctor
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Automation testers often spend hours hunting for usable element locators in WPF screens, and tests break when IDs are missing, duplicated or renamed. This MCP server runs a testability scorecard that grades each screen and the whole app from 0 to 100, flagging controls without AutomationIds, machine-generated IDs, repeated IDs and custom controls that test tools cannot see.

It works in two modes. A source scan reads XAML and C# files on any operating system and returns exact file and line fixes. On Windows, the live tools attach to a running app through UI Automation, show the screen as test tools see it, rank locators that match exactly one element, and can click, type, wait and take screenshots.

It suits WPF test engineers and the developers who work with them, and it is designed to be driven from AI assistants such as Claude Code, Copilot or Cursor.

## Features

- **Testability scorecard:** Scores each screen and the whole app across ID coverage, ID quality, uniqueness, visibility and readable names.
- **Source-level fix suggestions:** Returns exact XAML edits with unique proposed AutomationIds for the problems it finds.
- **Baseline comparison:** Checks whether AutomationIds from an earlier report have disappeared.
- **Live locator ranking:** On Windows, ranks locators for a running app and checks that each matches exactly one element.
- **Live app interaction:** Opens, clicks, types into, and waits on controls in a running WPF app, with screenshots.
- **Invisible control detection:** Finds custom controls that do not expose themselves to UI Automation.

## Good for

- Scoring a WPF project's testability before writing UI automation tests
- Adding missing AutomationIds to the worst-scoring screen through an AI assistant
- Finding a stable locator for a button in a running app on Windows
- Catching duplicated or machine-generated IDs in code review
- Blocking a build when the testability score drops below a threshold

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add wpf-locator-doctor -- dnx wpf-locator-doctor-mcp --yes
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add wpf-locator-doctor -- dnx wpf-locator-doctor-mcp --yes
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.wpf-locator-doctor]
command = "dnx"
args = ["wpf-locator-doctor-mcp", "--yes"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user wpf-locator-doctor dnx -- wpf-locator-doctor-mcp --yes

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "wpf-locator-doctor": {
      "command": "dnx",
      "args": [
        "wpf-locator-doctor-mcp",
        "--yes"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 3 of 14 tools read data; 11 names don't say. From the server's own tool labels and tool names; not verified by us.

- `score_source`: Scores the testability of a WPF project's source.
- `list_problems` (name suggests: reads): Lists testability problems found in a project.
- `suggest_xaml_fixes`: Suggests exact XAML line edits with unique new AutomationIds.
- `compare_to_baseline`: Checks that AutomationIds from an earlier report still exist.
- `explain_rules` (name suggests: reads): Explains each testability rule.
- `open_app`: Starts or attaches to a running WPF app on Windows.
- `snapshot_screen`: Shows the screen as UI test tools see it.
- `recommend_locators`: Ranks locators for an element in a running app.
- `check_locator` (name suggests: reads): Checks that a locator matches exactly one element.
- `act`: Clicks, types or otherwise acts on a control in a running app.
- `wait_for`: Waits for a control or condition in a running app.
- `take_screenshot`: Captures a screenshot of a running app.
- `score_live_app`: Scores the testability of a running app.
- `close_app`: Closes an app started through the server.

## FAQ

### Which operating systems are supported?

The source tools run on any OS, while the live tools that drive a running app require Windows with an unlocked desktop.

### How do I install WPF Locator Doctor?

Use NuGet package wpf-locator-doctor-mcp with dnx, or download the Windows win-x64 zip or mcpb package from the releases page.

### Does WPF Locator Doctor need a .NET version?

The NuGet source scan requires the .NET SDK version 10 or newer.

### Is WPF Locator Doctor open source?

It is released under the MIT licence.

### Is WPF Locator Doctor free?

Yes. WPF Locator Doctor is open source, so you can use and self-host it for free.

### How do I add WPF Locator Doctor to Claude Code?

Run this command in your terminal: claude mcp add wpf-locator-doctor -- dnx wpf-locator-doctor-mcp --yes

### What are the best alternatives to WPF Locator Doctor?

The closest alternatives to WPF Locator Doctor are Wpf Lens, Wpf Visual Tree, MCP Test Utils, k11 Appium QA and UIAutomationMcp.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Wpf Lens](https://ai-powered.com/mcp/wpf-lens): Wpf Lens is an open-source MCP server for developer tools.
- [Wpf Visual Tree](https://ai-powered.com/mcp/wpf-visual-tree): Wpf Visual Tree is an open-source MCP server for developer tools.
- [MCP Test Utils](https://ai-powered.com/mcp/mcp-test-utils): MCP Test Utils is a free MCP server for developer tools.
- [k11 Appium QA](https://ai-powered.com/mcp/k11-appium-qa): k11 Appium QA is an open-source MCP server for developer tools.
- [UIAutomationMcp](https://ai-powered.com/mcp/uiautomationmcp): UIAutomationMcp is an open-source MCP server for developer tools.
- [Uisight](https://ai-powered.com/mcp/uisight): Uisight is an open-source MCP server for developer tools.
- [WpfPilot MCP](https://ai-powered.com/mcp/wpfpilot-mcp): WpfPilot MCP is an open-source MCP server for developer tools.
- [XamlMcp](https://ai-powered.com/mcp/xamlmcp): XamlMcp is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/wpf-locator-doctor
