# bun-uia

An MCP server that hands your coding agent control over native Windows windows through UI Automation. Useful when the target app is a desktop program, not a browser.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 21
- Author: ObscuritySRL
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ObscuritySRL/bun-win32/tree/HEAD/packages/bun-uia
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/bun-uia

## What it does

bun-uia is a Bun-based MCP server that exposes Windows UI Automation to an AI agent. The agent can walk the element tree of a native window, read control state, and act on it. The author pitches it as Playwright for the Windows desktop.

It runs over stdio with `npx -y bun-uia`. Configuration comes through environment variables: `BUN_UIA_PROFILE`, `BUN_UIA_OS`, `BUN_UIA_ALLOW`, `BUN_UIA_DENY`, `BUN_UIA_CURSOR`. The allow and deny lists decide which applications the agent may touch. Skip them and the server still starts, but nothing scopes its reach across your machine.

Windows is the only supported target, since UI Automation lives there. On macOS or Linux there is no API to bind to, so the server has nothing to talk to. You need Node.js or Bun available for `npx` to work.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BUN_UIA_PROFILE`, `BUN_UIA_OS`, `BUN_UIA_ALLOW`, `BUN_UIA_DENY`, `BUN_UIA_CURSOR`, `BUN_UIA_FS_ROOT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env BUN_UIA_PROFILE=<BUN_UIA_PROFILE> --env BUN_UIA_OS=<BUN_UIA_OS> --env BUN_UIA_ALLOW=<BUN_UIA_ALLOW> --env BUN_UIA_DENY=<BUN_UIA_DENY> --env BUN_UIA_CURSOR=<BUN_UIA_CURSOR> --transport stdio bun-uia -- npx -y bun-uia
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add bun-uia --env BUN_UIA_PROFILE=<BUN_UIA_PROFILE> --env BUN_UIA_OS=<BUN_UIA_OS> --env BUN_UIA_ALLOW=<BUN_UIA_ALLOW> --env BUN_UIA_DENY=<BUN_UIA_DENY> --env BUN_UIA_CURSOR=<BUN_UIA_CURSOR> -- npx -y bun-uia
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "bun-uia": {
            "command": "npx",
            "args": [
                "-y",
                "bun-uia"
            ],
            "env": {
                "BUN_UIA_PROFILE": "<BUN_UIA_PROFILE>",
                "BUN_UIA_OS": "<BUN_UIA_OS>",
                "BUN_UIA_ALLOW": "<BUN_UIA_ALLOW>",
                "BUN_UIA_DENY": "<BUN_UIA_DENY>",
                "BUN_UIA_CURSOR": "<BUN_UIA_CURSOR>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "bun-uia": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "bun-uia"
            ],
            "env": {
                "BUN_UIA_PROFILE": "<BUN_UIA_PROFILE>",
                "BUN_UIA_OS": "<BUN_UIA_OS>",
                "BUN_UIA_ALLOW": "<BUN_UIA_ALLOW>",
                "BUN_UIA_DENY": "<BUN_UIA_DENY>",
                "BUN_UIA_CURSOR": "<BUN_UIA_CURSOR>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BUN_UIA_PROFILE=<BUN_UIA_PROFILE> -e BUN_UIA_OS=<BUN_UIA_OS> -e BUN_UIA_ALLOW=<BUN_UIA_ALLOW> -e BUN_UIA_DENY=<BUN_UIA_DENY> -e BUN_UIA_CURSOR=<BUN_UIA_CURSOR> bun-uia npx -y bun-uia
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- read the element tree of a native Windows window
- click a button in a desktop app from the agent
- restrict which applications the agent can reach
- script a GUI workflow without manual clicking
- pull control state out of a window as text

## Example prompts
- Connect to the Notepad window and list the elements inside it
- Find the Save button in the open window and click it
- Limit the agent to `calc.exe` and report what it can see

## 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
