# Netwright

An MCP server that lets an AI agent start a .NET desktop app, read its UI as text and walk through a scenario without taking your mouse.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 20
- Author: ricfanin
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ricfanin/netwright
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/mcp/netwright

## What it does

Netwright drives WPF and WinForms, .NET Framework 4.x included, plus WinUI 3 and .NET MAUI on Windows, through UI Automation. The agent launches a `.csproj` directly and picks up stdout, stderr and `Trace` output; a crash comes back with the exception and stack trace. UI snapshots arrive as tight text: unnamed layout panes collapse and grids are summarised row by row.

Actions run in the background. In an app Netwright started, a companion inside the app carries them out, so the window never jumps to the foreground. Key presses and right-clicks are separate tools that briefly borrow focus and hand it back. Each action first waits for its target to be enabled and visible, then waits for the UI to settle, which removes sleep calls from async flows. Failures return an error code with a hint on the next step.

You need Windows 10 or 11 and the .NET 10 SDK; your own apps can target any .NET version. `desktop_expect` handles retrying assertions, and `desktop_export_test` writes the session out as a C# test on Netwright.Testing for xUnit, NUnit or MSTest. It is slower per call than coordinate-based tools — a form flow takes about 1.8 s against 0.6 s — but the response already carries the result, so fewer calls are needed.

## Requirements
- Environment variables: `NETWRIGHT_ALLOW` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- launch a WPF app from its `.csproj` and capture console output
- read a window's UI as compact text instead of a screenshot
- fill in a form and submit it while you keep working
- wait out an async screen without sleeps in the script
- turn a walked-through flow into a C# regression test

## Example prompts
- Launch `src/Orders/Orders.csproj`, open the order screen and show me the UI snapshot
- Check `#chkTerms`, click `#btnSave` and confirm the modal window appears
- Export this session as a regression test on xUnit

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
