RN

ricfanin/netwright

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 4 forks 质量 75 趋势 43MIT

Playwright-style automation for .NET desktop apps: an MCP server that lets AI agents see, operate and test WPF, WinForms and WinUI apps.

概览

Netwright is an MCP server that lets AI agents see and operate WPF, WinForms and WinUI apps: they launch your project, read the UI as compact text, act without stealing your mouse, verify the result, and turn the verified flow into a regression test. Formerly . Version 2.0 is a rewrite; see Migrating from WPF-MCP 1.x. - Works with WPF, WinForms (.NET and .NET Framework 4.x) and WinUI/MAUI through UI Automation. It launches straight from a .csproj, captures stdout/stderr and Trace output, and reports crashes with the exception and stack trace. - - Snapshots are filtered to what an agent needs: unnamed layout panes are collapsed, and grids are summarized row by row. - Actions answer with a of what appeared, disappeared or changed, so the agent rarely needs another snapshot. - Refs (e12) stay valid across snapshots.

README

以下为原文 README 节选,完整内容请查看原文。

Netwright

Playwright-style automation for .NET desktop apps. Netwright is an MCP server that lets AI agents see and operate WPF, WinForms and WinUI apps: they launch your project, read the UI as compact text, act without stealing your mouse, verify the result, and turn the verified flow into a regression test.

▶ Watch it with sound

Formerly WPF-MCP. Version 2.0 is a rewrite; see Migrating from WPF-MCP 1.x.

> desktop_app action=launch project=src/Orders/Orders.csproj
Launched Orders.exe (pid 9120, WPF, launched by Netwright)
- window "Orders" [e1]

> desktop_snapshot
- window "Orders" [e1]
  - textbox "Customer" [e4] #txtCustomer
  - combobox "Country" [e5] #cmbCountry collapsed
  - checkbox "Accept terms" [e6] #chkTerms unchecked
  - button "Save" [e7] #btnSave disabled

> desktop_set_state target=#chkTerms checked=true
checked checkbox "Accept terms" [e6] #chkTerms
~ checkbox "Accept terms" [e6] #chkTerms checked
~ button "Save" [e7] #btnSave

> desktop_click target=#btnSave
clicked button "Save" [e7] #btnSave
+ window "Confirm" [e9] modal
  + text "Save order 42?"
  + button "Yes" [e10]

Why Netwright

  • Made for .NET apps. Works with WPF, WinForms (.NET and .NET Framework 4.x) and WinUI/MAUI through UI Automation. It launches straight from a .csproj, captures stdout/stderr and Trace output, and reports crashes with the exception and stack trace.
  • Cheap in tokens.
    • Snapshots are filtered to what an agent needs: unnamed layout panes are collapsed, and grids are summarized row by row.
    • Actions answer with a Change Report of what appeared, disappeared or changed, so the agent rarely needs another snapshot.
    • Refs (e12) stay valid across snapshots.
  • Stays out of your way. Actions run in the background: in apps Netwright launches, a small companion performs them inside the app, so it never takes the foreground and bound fields commit like a real edit. You keep working while the agent tests. Key presses and right-clicks are explicit, briefly take focus, and give it back.
  • Reliable by default.
    • Every action waits until its target is enabled and on screen.
    • It then waits for the UI to settle, so async screens don’t need sleeps.
    • Failures come back as error codes with a hint about what to do next.
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "netwright": { "command": "dnx", "args": ["Netwright", "--yes"] } } }