ok-use
Controls the user's own Firefox browser windows, letting an agent read page text, locate and act on elements, and fall back to screenshots and foreground clicks while using the user's existing tabs and logins.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ok-use
An MCP server that gives a coding agent (Claude Code, Codex, …) computer use on Windows. It replaces the built-in computer-use tool with one that works on any app, without per-app permission tiers. The workflow is the same (screenshot → act → screenshot), and it adds per-window background control (the user keeps their mouse and keyboard) and an elevated (admin) mode.
Install (instructions for coding agents)
If a user asks you to install this repository, first ask them one question: "Install bug-fix updates
automatically? Feature releases always ask first." Then run these two commands in PowerShell, passing
fixes for yes or off for no, and tell the user to restart the agent (or start a new session):
uv tool install --force ok-useok-use setup --auto-update fixesok-use setup opens one UAC prompt. Tell the user to approve it; you can't click it yourself.
If uv is missing, install it first with
powershell -ExecutionPolicy Bypass -c "irm https://astral.sh/uv/install.ps1 | iex". If ok-use is not
found right after installing, run it as & "$env:USERPROFILE\.local\bin\ok-use.exe" setup.
What setup does:
Registers the scheduled task
OK Use MCP, which can start the server as administrator later without another UAC prompt. This is the step that needs the UAC approval.Adds the
ok-usestdio server to Claude Code (~/.claude.json, user scope) and to Codex (~/.codex/config.toml), for each one it finds.Installs the ok-use skill for Claude Code (scripting with
ok_use.client).Denies Claude Code's built-in computer use (
mcp__computer-usein~/.claude/settings.json), so the agent uses ok-use in its place.
After that, the agent starts ok-use on demand like any stdio MCP server. The stdio process is a small
bridge: it starts the elevated server through the task, relays the agent's messages to it over
loopback HTTP with a bearer token, and starts it again if it has exited. The elevated server exits
after 30 minutes without requests.
Command | |
| what is installed and running |
| skip the task (no UAC prompt): ok-use runs with the agent's own privileges |
| configure only this agent ( |
| leave the built-in computer use enabled |
| also start the elevated server at every logon |
| remove the task and the agent config, then run |
| check for new releases now ( |
| install the latest bug-fix release (or VERSION) once no agent is using ok-use |
| reinstall the Claude Code skill |
| upgrade to the latest release by hand |
For other MCP clients, ok-use config prints the stdio entry.
Updates
Users stay on the version they installed. ok-use never upgrades itself to a new feature release.
Bug-fix (patch) releases (1.0.0 → 1.0.3) install automatically if the user chose
--auto-update fixes. A detached helper waits until no agent is using ok-use (Windows locks a running Python environment's files), then runsuv tool install --force ok-use==X.Y.Z.Feature releases (1.0 → 1.1) and major releases (1.x → 2.0) are only reported, in
get_status,ok-use statusandok-use update. While the version is 0.y.z, each 0.y counts as a feature release.The check runs at most once a day, in the background when an agent starts ok-use. It reads PyPI and
updates.jsonin this repository.The Claude Code skill follows the installed version: after an upgrade, the next agent start rewrites it.
Pin a version to opt out of everything:
uv tool install --force ok-use==0.1.1.Development checkouts (
uv pip install -e .) never update themselves.
Maintainers: follow semantic versioning. Release fixes only as patches and anything that changes tools or
behaviour as a feature release. To make agents tell users about an important release, add it to
updates.json on main:
{"important": {"0.1.3": "fixes clicks landing in the wrong window"}}Related MCP server: com-use-mcp
Development
uv venv --python 3.12; uv pip install -e .
.\.venv\Scripts\python.exe -m ok_use --local # stdio in this process (the agent's privileges)
.\.venv\Scripts\python.exe -m ok_use --http # HTTP on 127.0.0.1:8791 + bearer token
.\.venv\Scripts\python.exe -m ok_use --elevate # HTTP, relaunched as administrator (UAC)The HTTP token is generated once and kept in %APPDATA%\ok-use\settings.json (or pass --token, or
set OKUSE_TOKEN). A running HTTP server writes its URL and token to %APPDATA%\ok-use\server.json.
The server started by the task logs to %APPDATA%\ok-use\server.log.
Choosing a method
The server's instructions tell the agent to call inspect_window once per new app. It reports what kind of
app the window is and the tools to use for it:
Kind | Typical apps | Method |
| Win32, WinForms, WPF, WinUI, Explorer, Office, Qt 6 |
|
| Electron and other Chromium-based apps | the accessibility tools first; |
| apps exposing only a few elements | try |
| games, GPU-rendered or custom-drawn apps, Qt 5 without accessibility | screenshot → click/key/type_text/drag → screenshot; |
| the user's own Edge/Chrome/Firefox with their tabs and logins |
|
| ok-use's own Playwright browser | Playwright scripts ( |
| an admin app while the server isn't elevated | run |
Why the accessibility tools come first: a filtered find_elements result costs tens of tokens and a
whole window's tree a few hundred, where a screenshot costs about 1,500-2,500. They also work while the
window is covered, and element_action needs no coordinates. Both reading and actions run in the
background: the user's foreground window is never taken. Classic Win32 controls are driven with window
messages and everything else (Chromium pages and browsers included) through MSAA. UI Automation's own
action methods would activate the target window, so element_action refuses when no background path
exists, unless allow_focus_change=True (then ok-use puts the user's window back right after).
Web tasks that don't need the user's own browser go to ok-use's Playwright browser (see Browser automation). Attaching Playwright to the user's running browser is the last resort: it needs the browser restarted with a remote-debugging port, and the user has to approve the connection each time.
Scripts and the agent skill
For multi-step work, an agent can write a short Python script instead of making one MCP call per action.
Every tool is a method of ok_use.client, running through the same elevated server:
from ok_use.client import connect
ok = connect() # the elevated server after `ok-use setup`, else in-process; connect(local=True) forces in-process
print(ok.inspect_window(window="Notepad")["kind"])
for line in ok.find_elements(window="Notepad", interactive_only=True)["elements"][:10]:
print(line) # e12 button "Settings" @[x, y, w, h]
print(ok.element_text(window="Notepad")["text"][:300])
ok.screenshot(window="Notepad", max_size=800, path="shot.png") # images go to filesA script saves model round trips, and lets a check run right before the action that depends on it. Tool
errors raise ok_use.client.ToolError.
ok-use setup also installs a Claude Code skill (~/.claude/skills/ok-use/SKILL.md) that teaches this:
the API, the per-app method guide and patterns (verify then act, wait for a state), with this install's
Python filled in. The skill's description is only a few lines, so it adds little to every session; its body
loads when an agent uses it. ok-use uninstall removes it.
Tools
Group | Tools |
Choose |
|
Accessibility |
|
Observe |
|
Mouse |
|
Keyboard |
|
Windows |
|
System |
|
Browser |
|
Targets and coordinates. Without window, actions use the screen and real input (SendInput), and
x, y are pixels of the latest screen screenshot (scaled to max_size, default 1568 on the long edge).
With window (an hwnd, a title substring, pid:1234 or process:notepad.exe), the screenshot is that
window's client area and coordinates are relative to it. DPI-unaware windows are handled in their own
logical pixels.
Background mode (the default when window is given) captures with PrintWindow (the window may be
covered) and posts mouse/keyboard messages to the control under the point, so the user's cursor, focus
and keyboard are untouched. It works for classic Win32, WinForms, WPF and many other apps. Games and
some Chromium/Electron content read raw input and ignore posted messages; use mode="foreground" for
those. Modifier chords (ctrl+s) are reliable only in foreground mode. Minimized windows cannot be captured.
Admin level. Windows blocks input from a normal process into an elevated one (UIPI). list_windows
marks those windows controllable: false. After ok-use setup, the stdio bridge runs every tool in the
elevated server, so the agent can drive elevated apps, and run_command, launch and kill_process
run as administrator. get_status reports elevated. Agents that share the elevated server also share
its screenshot coordinate frames. UAC prompts on the secure desktop can't be automated.
Browser automation (Playwright)
For web tasks that don't need the user's own browser, the preferred way is a Playwright for Python script that the agent writes and runs itself with ok-use's Python, not the screen tools and not a browser MCP. (For the user's own browser, see Choosing a method.) Playwright is installed with ok-use. Scripts don't launch a fresh browser each time: they connect over CDP to a persistent browser session that stays open between scripts, so tabs, page state, cookies and logins carry over.
from ok_use.browser import session
with session() as s: # reuses the running "default" browser, or starts it
page = s.page # an open tab; s.find_page("github") / s.new_page(url) for others
page.goto("https://example.com")
print(page.title())
# leaving the block only disconnects; the browser keeps running for the next script.\.venv\Scripts\python.exe script.py
.\.venv\Scripts\python.exe -m ok_use browser start [--name work] [--channel auto|msedge|chrome|chromium] [--headless] [--url URL]
.\.venv\Scripts\python.exe -m ok_use browser status # running sessions and their CDP URLs
.\.venv\Scripts\python.exe -m ok_use browser stop [--name work]
.\.venv\Scripts\python.exe -m ok_use browser delete --name work # stop and remove the profile
.\.venv\Scripts\python.exe -m ok_use browser env # what the playwright_env tool returnsSessions: each
--namehas its own profile in%LOCALAPPDATA%\ok-use\browsers\<name>and its own debugging port on 127.0.0.1.channel="auto"uses installed Edge, else Chrome, else Playwright's bundled Chromium (python -m playwright install chromium).An already-open browser (last resort):
session(cdp_url="http://127.0.0.1:9222")attaches to any Chromium browser started with--remote-debugging-port. For the user's everyday browser, that means restarting it and the user approving the connection each time, so agents should use the accessibility tools on that window instead. Chrome and Edge refuse a debugging port on the user's default profile, so use a session (or a dedicated--user-data-dir) for logins you want to keep.Don't call
browser.close()in a script: it would close the shared browser. Usebrowser stop.Privileges: a session browser runs with the privileges of whatever started it. Start it from the agent's normal shell, not from an elevated one.
Mixing with ok-use tools: the session browser is an ordinary window, so the window tools can handle what Playwright can't reach (permission prompts, native file dialogs).
Layout
File | Contents |
| ctypes layer: DPI awareness, windows, capture, |
|
|
| MCP tools, HTTP transport (stateless, idle exit), CLI |
| stdio entry point: relays to the elevated server, starting it through the task |
| the on-demand scheduled task that runs the server elevated |
|
|
| Bearer-token middleware and loopback socket binding |
|
|
| the update policy: daily check, patch auto-install, notices |
| the Claude Code skill text that |
| UI Automation: |
|
|
| Playwright sessions: persistent CDP browsers, |
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
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Let AI see and use your own Windows PC with your permission: screen, apps, mouse and keyboard.
Give your AI hands on every computer you own. Remote control of your Windows, Mac and Linux machines from one ChatGPT, Claude or Cursor chat — even from your phone. Ask it to find out why the office server is crawling, update every PC in the house, sort out your mom's laptop from another city, or ship the site from your work machine while you're on a train. It runs commands and reads and writes files; screenshots are a beta you can request. You decide what each computer allows, and you can cut any of them off in a second.
Windows computers for AI agents. Office, desktop apps, browser tasks, testing and file transfer.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to control Windows GUI applications like a human using screen capture, OCR, mouse and keyboard input, and window management, with safety levels and memory.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to see and operate a Windows PC through mouse, keyboard, screenshots, OCR, window control, and shell commands.-
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to drive any Windows desktop app through window-relative, token-efficient tools, with optional DeepSeek-powered vision.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to observe and drive Windows desktop applications in the background through UI Automation and Win32 messages, without taking over the user's mouse, keyboard, or foreground window. Every action is read back and verified, and outward actions are held for explicit confirmation.6MIT