
Netwright
io.github.ricfanin由 GitHub 帳號 ricfanin 發布v2.1.0更新於 Oct 24, 2026
Playwright-style automation of .NET desktop apps (WPF, WinForms, WinUI) for AI agents.
概覽
Netwright 讓 AI 助理透過 UI Automation 啟動、檢視並操作 .NET 桌面應用程式(WPF、WinForms、WinUI),並把驗證過的流程匯出成 C# 測試。
- 可以做什麼
- 啟動、附加、關閉 .exe 或 .csproj 應用程式並查看狀態,列出與管理視窗,截圖並讀取應用程式日誌(stdout、stderr、trace)。
- 適用情境
- 當你希望助理探索、操作或回歸測試 Windows .NET 桌面應用程式時使用:填寫表單、走完流程、驗證介面狀態,並把驗證過的作業階段轉成 C# 測試。
- 執行需求
- 需要 Windows 10/11 與 .NET 10 SDK;受測應用程式可鎖定任何 .NET 或 .NET Framework 版本。透過 stdio 在本機執行,可用 dnx 或全域 dotnet 工具安裝。未宣告驗證或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Netwright,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
Formerly WPF-MCP. Version 2.0 is a rewrite; see Migrating from WPF-MCP 1.x.
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 andTraceoutput, 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.
- From exploration to regression tests.
desktop_expectverifies state, anddesktop_export_testturns the session into a C# test on Netwright.Testing (xUnit, NUnit or MSTest).
Benchmark
Same scenarios, same Fixture App, same token encoding for every server (full methodology and all numbers in benchmarks/results):
¹ Windows-MCP summarizes the whole desktop instead of the app's UI tree; its grid snapshot does not include the rows. ² Its actions work at screen coordinates with the real mouse, so scripted flows were not run.
Tokens are counted with o200k_base as a proxy for Claude's tokenizer. Netwright's actions are slower per call: the form flow takes ~1.8 s against ~0.6 s, because each action waits for the UI to settle. In exchange the response already contains the result, so the agent needs fewer calls and far fewer tokens.
Install
Requires Windows 10/11 and the .NET 10 SDK. Your apps can target any .NET or .NET Framework version.
Claude Code
Any MCP client (Claude Desktop, Cursor, VS Code, Copilot…)
Prefer a global tool? Run dotnet tool install -g Netwright and use "command": "netwright". To restrict which apps an agent may touch, add "--", "--allow", "MyApp*" to the args. See the Integration Guide for all options.
Tools
Full reference: docs/TOOLS_REFERENCE.md.
Supported UI technologies
Other Windows apps (Win32, Qt, Electron…) often work because Netwright speaks plain UI Automation, but they are not supported.
Automation works best when your app sets AutomationProperties.AutomationId (WPF/WinUI) or Name (WinForms) on the controls you care about. See Making your app automation-friendly.
Regression tests without an agent
dotnet add package Netwright.Testing. This is the code desktop_export_test writes for you.
How it works
Netwright captures each window with one cached UI Automation query. Windows are found with Win32, only about 20 properties are requested, and offscreen elements are filtered inside the provider. From that capture it renders filtered text, resolves Selectors in memory, and diffs trees by RuntimeId to build Change Reports. Details and measurements: docs/ARCHITECTURE.md. Vocabulary: CONTEXT.md. Decisions: docs/adr.
Migrating from WPF-MCP 1.x
The package is now Netwright (command netwright), replacing WpfMcp.Server (wpf-mcp).
Contributing
Issues and PRs are welcome. See CONTRIBUTING.md. Build and test with .\scripts\build.ps1 -Integration, and measure with .\scripts\benchmark.ps1.
License
MIT
來源:README.md,提交 16f0987
工具
0版本歷史
2- v2.1.0最新Oct 9, 2026
- v2.0.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分