๐ŸชŸ Windows MCP Server

March 22, 2026 ยท View on GitHub

License .NET Platform CI LLM Tests

Windows automation that actually works. Uses the Windows UI Automation API to find buttons by name, not pixels. Tested with real AI models before every release.

Why This Exists

Screenshot-based automation doesn't work reliably. Vision models guess wrong, coordinates break when windows move or DPI changes, and you burn through thousands of tokens on retry loops. We tried it (check the commit history) โ€” it failed too often to be useful.

Windows MCP Server asks Windows directly: "What buttons exist in this window?" Windows knows. It's deterministic.

How It Works

# 1. Find the window
window_management(action='find', title='Notepad') โ†’ handle='123456'

# 2. Click elements by name
ui_click(windowHandle='123456', nameContains='Save')

# 3. Type into fields
ui_type(windowHandle='123456', controlType='Edit', text='Hello World')

# 4. Fallback for games/canvas โ€” screenshot + mouse
screenshot_control(windowHandle='123456') โ†’ element coordinates
mouse_control(action='click', x=450, y=300)

Same command works every time. Any machine. Any DPI. Any theme.

Browsers follow the same semantic flow: launch msedge.exe or chrome.exe, then use ui_find, ui_click, and ui_type on links, buttons, and fields exposed through UIA names and ARIA labels.

Key Features

  • ๐Ÿง  Semantic UI โ€” Find elements by name, not coordinates. Works regardless of DPI, theme, or window position.
  • ๏ฟฝ Multi-Monitor โ€” Full support for multiple displays with per-monitor DPI scaling.
  • ๐Ÿงช LLM-Tested โ€” 54 tests with real AI models (GPT-4.1, GPT-5.2). 100% pass rate required for release.
  • ๐Ÿ’ป Broad App Support โ€” Tested against classic Windows apps, modern Windows 11 apps, and Electron apps (VS Code, Teams, Slack). Chromium browser pages follow the same ARIA-driven pattern, but browser chrome remains best-effort.
  • ๐Ÿ”„ Full Fallback โ€” Screenshot + mouse + keyboard for games and custom controls.
  • ๐Ÿช™ Token Optimized โ€” Short property names, JPEG screenshots, auto-scaling. ~60% fewer tokens than standard JSON.

Installation

VS Code Extension โ€” Install from Marketplace. Works with GitHub Copilot automatically.

Plugin (GitHub Copilot CLI / Claude Code) โ€” Install the shared plugin bundle in plugin/:

copilot plugin install sbroenne/mcp-windows:plugin

For local Claude Code development:

claude --plugin-dir .\plugin

On first use, the plugin downloads the current standalone release into plugin\bin\.

Standalone โ€” Download from Releases. Add to your MCP config:

{ "servers": { "windows": { "command": "path\\to\\Sbroenne.WindowsMcp.exe" } } }

Tools

ToolPurpose
ui_clickClick buttons, checkboxes, menu items by name
ui_typeType into text fields
ui_findDiscover elements in a window (with timeout/retry)
ui_readRead text from elements (with OCR fallback)
file_saveSave files via Save As dialog
screenshot_controlGet element metadata (image optional)
window_managementFind, activate, move, resize windows
mouse_controlCoordinate-based clicks (fallback for games)
keyboard_controlHotkeys and key sequences
appLaunch applications

Full reference: FEATURES.md

โš ๏ธ Caution

This MCP server controls your Windows desktop. Use responsibly.

Known Limitations

UAC & Elevated Processes โ€” Windows security prevents any non-elevated process from interacting with UAC prompts or elevated (Administrator) windows. This is a fundamental Windows security boundary, not an MCP limitation.

ScenarioWhat HappensWorkaround
winget install triggers UACAI cannot click the UAC promptRun terminal as Administrator first
App running as AdministratorUI automation tools return ElevatedWindowActive errorRun MCP server elevated, or use the app non-elevated
UAC prompt appearsAI cannot interact with secure desktopUser must manually approve

See FEATURES.md for details.

Testing

dotnet test                                      # All tests
dotnet test --filter "FullyQualifiedName~Unit"   # Unit only

Framework coverage: Tests run against WinForms, WinUI 3, Electron apps, and real Chromium browser app windows by default. The Chromium smoke stack now exercises both Edge and Chrome (when installed) across a deterministic local page and a required public-web slice (demo.playwright.dev/todomvc) using the same semantic-first UI Automation model with isolated browser state and browser-window-only cleanup.

dotnet test .\tests\Sbroenne.WindowsMcp.Tests\Sbroenne.WindowsMcp.Tests.csproj --filter "FullyQualifiedName~ChromiumBrowser"

LLM tests: 54 tests with real AI models (GPT-4.1, GPT-5.2). 100% pass rate required for release.

cd tests/Sbroenne.WindowsMcp.LLM.Tests
uv run pytest -v

Requires Azure OpenAI access. See LLM Tests README.

Documentation

DocumentDescription
FEATURES.mdComplete tool reference โ€” all actions, parameters, examples
CONTRIBUTING.mdBuild instructions, coding guidelines, PR process
LLM Tests READMEHow to run LLM integration tests
Release SetupAzure OIDC and GitHub Actions configuration

License

MIT โ€” see LICENSE

Contributing

See CONTRIBUTING.md