Skip to main content
Glama
README.md
# Winsight

**A local MCP server for Windows desktop automation through compact text observations.**

[![Windows 10/11](https://img.shields.io/badge/platform-Windows%2010%20%2F%2011-0078D6)](INSTALL.md)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-3776AB)](pyproject.toml)
[![MIT License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

Winsight is a local Model Context Protocol (MCP) server. It lets an AI agent inspect and operate Windows apps through Windows UI Automation, the accessibility interface used by screen readers. Instead of identifying every button from an image, the agent receives controls it can address directly:

```text
w1 "Calculator" CalculatorApp.exe
e1 button "Clear"
e2 button "Seven"
e3 text "Display is 0"
```

After an action, Winsight returns changed elements. For longer tasks, the agent can submit several steps in one call and check the resulting UI state. Screenshots and OCR are available when an app's accessibility tree is insufficient.

## Installation

You need Windows 10/11, Python 3.10+ and an MCP client that can launch a local process. Use a normal signed-in desktop account.

```powershell
git clone https://github.com/hegdeadithyak/winsight-mcp.git
cd winsight-mcp
py -3 scripts/setup_agent.py --client codex
```

The setup command installs into an isolated environment, runs machine checks and prints configuration for your client. It does not edit client settings. Merge the printed configuration, restart the MCP connection and give your agent [AGENTS.md](AGENTS.md) and the [skill](skills/winsight/SKILL.md).

Substitute `claude-code`, `claude-desktop`, `cursor`, `vscode` or `json` for `codex` as needed. [Installation and troubleshooting](INSTALL.md).

Try this first:

> Use Winsight to list my open windows and inspect Calculator. Describe its controls without clicking or typing.

## How it works

1. `list_windows` identifies an app window.
2. `snapshot` returns visible controls, stable element ids and state flags.
3. `run` executes a flow using selectors such as `button "Save"`.
4. `expect` checks the resulting visible state; the reply reports completion, changes and failures.

```json
{
  "window": "Calculator",
  "steps": [
    {"click": "button \"Clear\""},
    {"click": "button \"Three\""},
    {"click": "button \"Plus\""},
    {"click": "button \"Seven\""},
    {"click": "button \"Equals\"", "expect": "text \"Display is 10\""}
  ]
}
```

Labels depend on the app version and language. Inspect the actual controls before choosing selectors. [Usage guide](docs/usage.md).

## Features

- **Contextual targets:** scope a selector within a named document or container.
- **Stale-element recovery:** check identity and ancestor context before reusing a target.
- **Verified outcomes:** distinguish input delivery from an observed result.
- **Timeout isolation:** quarantine unfinished worker calls and block later input dispatch after cancellation.
- **Compact observations:** deduplicate runtime identities, return changes and batch workflows to reduce repeated context.

[Architecture and failure handling](docs/architecture.md) explains the tradeoffs. These mechanisms reduce risk; they do not make arbitrary app actions transactional.

## Evidence and limitations

Published evidence includes a GPT Calculator pilot, ten complex multi-app tasks, an earlier ten-task Claude session, engine CPU profiles and token-size measurements. Results include failures and tasks where screenshots were faster. Permissions, versions and timing methods differ between studies; actual billed token usage was unavailable. See the [task tables, token measurements and limitations](docs/benchmarks.md).

UI Automation coverage varies. Canvas apps, games and remote desktops may need screenshots. Physical input may require foreground focus. A signed-in interactive desktop is required. Elevation and some protected windows impose additional restrictions. An already dispatched action cannot be recalled when a timeout occurs.

## Privacy and control

The server runs locally, but observations returned to your AI client can be sent to that client's model provider. Treat desktop text as sensitive. Debug traces and learned workflow examples may retain app content locally. Debugging cannot expose a model's private reasoning. Review logs before sharing. [Privacy guide](docs/privacy.md).

## Contribute

Report a reproducible issue using scratch data, improve client setup, or add regression coverage for an accessibility failure. [Contributing](CONTRIBUTING.md) includes development commands and reporting guidance.

## Documentation

| Guide | Contents |
|---|---|
| [Installation](INSTALL.md) | Requirements, client configuration, updates and troubleshooting |
| [Agent instructions](AGENTS.md) | Setup and operating conventions for AI agents |
| [Usage](docs/usage.md) | Observations, selectors, workflows and recovery |
| [Architecture](docs/architecture.md) | Target identity, caching, execution and timeout handling |
| [Privacy](docs/privacy.md) | Data flow, local traces and tool approvals |
| [Benchmarks](docs/benchmarks.md) | Complex tasks, pilots, token measurements and limitations |

Source: [hegdeadithyak/winsight](https://github.com/hegdeadithyak/winsight-mcp). Licensed under [MIT](LICENSE).