win-nav
win-nav
Stable CLI + MCP bridge for fluid QA testing and lawful, assisted desktop automation on native Windows applications (Windows Forms .NET 8, WPF, WinUI 3, and hybrid apps with WebView2, packaged via Velopack) via Microsoft UI Automation.
π Sister Project Reference
win-nav is the Windows Desktop counterpart to pwa-nav (designed for Firefox PWAs).
Both projects share the exact same clean design patterns, JSON Schema 2020-12 contracts, ephemeral eN snapshot references, semantic @id targets, dry-run safety gates, and MCP stdio tool interfaces. If you already know how to drive pwa-nav for web apps, you already know how to drive win-nav for native desktop software.
Related MCP server: Netwright
π‘ Why win-nav?
Classic desktop automation tools rely on:
Fragile pixel coordinates: Breaks immediately on display scaling (DPI 125%/150%), resolution changes, or OS theme shifts.
Slow, unreliable OCR: High token overhead, prone to misreading text.
External heavyweight drivers: WinAppDriver / Appium requiring complex setup, elevation, or developer mode.
win-nav takes a better path:
Direct UI Automation (UIA3 / FlaUI): Attaches directly to the application's native accessibility tree. Reads real
AutomationId,Name,ControlType, and patterns without modifying the target application.Velopack-Native: Seamlessly detects and resolves apps installed under
%LocalAppData%\<App>\current\<App>.exe.Traverses Embedded WebViews: Interacts effortlessly with embedded Chromium / Microsoft Edge WebView2 controls inside desktop forms.
Token-Efficient Screen Maps: Pre-mapped windows expose clean semantic
@idtargets (@BtnAbrirTicket), allowing agents to operate in ~200 tokens per action without taking full DOM/UIA trees.Dry-Run by Default: Safe pair-programming; all mutations require explicit
--armedapproval.
π Live-Verified Example (Velopack & WinForms)
win-nav has been validated against real enterprise .NET 8 Windows Forms applications packaged with Velopack (such as Sigestran.exe). Here is a real sample of controls extracted in milliseconds via UI Automation:
Type AutomationId Name ClassName
---- ------------ ---- ---------
Button BtnAbrirTicket BtnAbrirTicket C1.Win.Input.C1Button
Button BtnTicketsPendientes BtnTicketsPendientes C1.Win.Input.C1Button
Button BtnControlTower BtnControlTower C1.Win.Input.C1Button
Button BtnRefreshCashe BtnRefreshCashe C1.Win.Input.C1Button
Pane CbSelectUser WindowsForms10.Window...
β Edit Search WindowsForms10.Edit
β Button BtnDropDown WindowsForms10.Button
Pane Manual Usuario Manual Usuario Chrome_WidgetWin_1 (WebView2)
β Hyperlink Logo Manual Usuario BrowserRootViewπ Quick Start
Prerequisites
Windows 10/11
Node.js 22 LTS
.NET 8 SDK / Runtime
Installation
git clone https://github.com/SebassContreras/win-nav.git
cd win-nav
pnpm install
pnpm buildπ οΈ CLI Usage
1. Interactive Snapshot Loop (Exploration)
Capture active controls into .agent/snapshot.json:
# Snapshot active process
win-nav snapshot -p Sigestran -i
# Inspect available controls (e1, e2, ...)
# Click an element (dry-run preview)
win-nav click e1
# Armed execution (actually executes click)
win-nav click e1 --armed2. Screen Map Navigation (Semantic)
Drive known screens using declarative @id selectors:
# Inspect current window capabilities (~200 tokens)
win-nav snapshot --screen
# Click semantic button
win-nav click '@BtnAbrirTicket' --armed
# Fill text into an edit field
win-nav fill '@Search' "administrador" --armed
# Run a declarative multi-window journey
win-nav journey nuevo-ticket usuario="Juan" --armedPowerShell Tip: Always wrap semantic targets in single quotes (
'@BtnAbrirTicket') to prevent PowerShell from interpreting@as a splatting variable.
π€ Model Context Protocol (MCP) Server
Connect win-nav directly to Claude Desktop, Antigravity, Cursor, or any MCP client.
Configuration (mcpServers)
{
"mcpServers": {
"win-nav": {
"command": "node",
"args": ["C:/Users/scontreras/Documents/GitHub/win-nav/dist/mcp.js"]
}
}
}Exposed MCP Tools
win_snapshot: Captures interactive UI elements for a target window.win_click: Clicks control by ref (e1) or semantic ID (@id), requiringarmed: true.win_fill: Types text into an edit box or combo.win_qa: Evaluates assertions (assert:visible,assert:text).win_learn: Learns a new window and adds it toscreens/<app>.screens.json.
π Safety & Security
Strict Dry-Run Default: Mutations require explicit
--armedflag.Sensitive Fields Barrier: Password controls (
IsPassword == true) throw exit code 11 (sensitive_target) and instruct the user to type them manually.Emergency Kill-Switch: The presence of file
.agent/killor envWIN_NAV_KILL_SWITCHimmediately terminates execution (exit code 7).Process Allow-List: Navigation and attachment are gated by
.agent/allow.json(exit code 6).
π Exit Codes
Exit Code | Code Name | Description |
|
| Command completed successfully. |
|
| Operation or QA assertion failed. |
|
| Missing or malformed CLI arguments. |
|
| Snapshot expired. Re-run |
|
| Target window or process not found. |
|
| Process not allow-listed in |
|
| Emergency kill switch active ( |
|
| Control disabled, hidden, or offscreen. |
|
| Action or window settle timed out. |
|
| Sensitive password field requested. Fill manually. |
|
| Semantic |
|
| Active window not mapped; run |
|
| Multi-window transition assertion failed. |
π License
MIT Β© Sebastian Contreras
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Eyes and hands on real Windows PCs β observe, click, type via Glasswarp API.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Real desktops for AI agents, on machines you choose: screenshot, type, click, hire more agents.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to control Windows GUI by listing and focusing windows, capturing element snapshots via UIA/OCR/CDP, performing clicks/inputs/scrolls, verifying changes, waiting for screen updates, taking screenshots, and obtaining visual descriptions.2-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to launch, inspect, and operate WPF, WinForms, and WinUI desktop applications through UI Automation, with compact snapshots, background actions, state verification, and export to regression tests.22MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to drive Windows desktop automation β opening and interacting with applications, native UI controls, keyboard/mouse input, files, processes, clipboard, and Chrome/Edge browsing via UI Automation and CDP. All actions pass through a safety policy with human approval, emergency stop, and deterministic verification.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to inspect and drive Windows desktop applications text-first through the UI Automation tree, reading interactive elements and performing element-level actions (click, invoke, set value, type, drag, menu and window/app lifecycle) without relying on screenshots or coordinates. Actions are dry-run by default and pass an internal confirmation gate with snapshot binding and an audit log, while deterministic waits/verifications and an explicit screenshot or OCR fallback cover self-drawn surfaces.1MIT