screen-use

screen-use

Enables AI agents to see, locate UI elements, and operate any Windows desktop app through natural language, using accessibility-tree matching with optional vision-model fallback, plus an autonomous visual loop with introspection and meta-learning.

Category
访问服务器

README

🖥️ screen-use

browser-use, but for the entire desktop.

Give any AI Agent eyes 👀 and hands 🖐️ on Windows — let Claude, Kimi, Cursor or your own agent see the screen, find UI elements, and operate any desktop app through natural language. No selectors. No scripts that break when the UI changes.

License: MIT Python 3.10+ Platform: Windows MCP

demo

👆 Cross-app autonomy: the agent reads the result from Calculator, activates Notepad, and types it in — every step decided by the VLM watching the screen (see the live thought stream at the bottom).

<details> <summary>🎬 More demos</summary>

Single-app agent loop (VLM computes 78 × 9 by itself):

agent loop demo

Scripted cross-app (Calculator → Notepad):

cross-app demo

Single-app precision clicking:

calculator demo

</details>

Why

Traditional RPA records selectors — and breaks the moment a page changes. browser-use (32k⭐) solved this for browsers. screen-use brings the same idea to the entire desktop: Excel, SAP clients, ERP software, even legacy Win32 programs.

Traditional RPA screen-use
Locating elements Recorded selectors, break easily Understands UI via Accessibility tree + Vision models
Scope Browser or specific apps only Any desktop app
Authoring Professional developers Natural language
Cost Expensive enterprise software Open source, local-model friendly

How it works

Your Agent (Claude / Kimi / Cursor / custom)   ← does the planning
        │  MCP or Python SDK
        ▼
┌─────────────────────────────────────────────┐
│ screen-use                                  │
│  Visual Loop ──► observe→think→act→verify   │
│  Introspection──► difficulty playbook        │
│  Meta-learning──► experience & vocab memory  │
│  Perception ──► UIA tree + screenshots (SoM)│
│  Locating   ──► strategy chain:             │
│                 ⓪ learned vocab mapping     │
│                 ① UIA text match (0 cost)   │
│                 ② Set-of-Mark + VLM         │
│  Action     ──► mouse / keyboard            │
└─────────────────────────────────────────────┘

VLM is optional, not required. The locating strategy chain hits most targets with pure Accessibility-tree text matching — zero model calls, millisecond latency. A vision model (cloud or local via Ollama) only kicks in for UIA-blind UIs.

Quickstart

git clone https://github.com/tongriyaotxt/screen-use.git
cd screen-use
pip install -r requirements.txt

As a Kimi CLI plugin (recommended)

One command — Kimi instantly gets all 14 desktop tools:

kimi mcp add --transport stdio screen-use -- <path-to-python.exe> -m screen_use.mcp_server
kimi mcp test screen-use   # verify the connection

Optionally install the bundled usage-strategy skill, which teaches Kimi the optimal tool-selection playbook:

mkdir -p ~/.kimi/skills/screen-use && cp skills/screen-use/SKILL.md ~/.kimi/skills/screen-use/

Then just tell Kimi: "Open Calculator and compute 123 × 456" or "Read what's in my Notepad".

As a generic MCP Server

Add to claude_desktop_config.json (or any MCP-compatible agent's config):

{
  "mcpServers": {
    "screen-use": {
      "command": "python",
      "args": ["-m", "screen_use.mcp_server"],
      "cwd": "path/to/screen-use"
    }
  }
}

Then just tell your agent: "Open Calculator and compute 123 × 456."

As a Python SDK

from screen_use import ScreenUse

tools = ScreenUse()

tools.click_element("Save")            # locate + click, one call
tools.type_text("Hello, 你好")          # Unicode-safe (clipboard paste)
tools.hotkey("ctrl", "s")

# Atomic tools for vision-capable agents:
elements = tools.list_ui_elements()    # id, name, type, bbox — no model needed
shot = tools.screenshot(annotate=True) # Set-of-Mark annotated screenshot
tools.click(500, 300)

Autonomous task loop

One call, full autonomy — the agent sees, decides, acts and self-corrects:

tools.run_task("打开计算器,算 25 乘以 4")   # observe → think → act → verify

Introspection (困难分类反思): when the loop gets stuck, it classifies the difficulty — no effect / repeat loop / consecutive failures / missing elements / unexpected popup — and reflects with a targeted prompt playbook, then adjusts strategy.

Meta-learning (元学习): successful runs are remembered. Similar past tasks are recalled as experience hints, and learned vocabulary mappings (e.g. "乘号" → Multiply by) become the strategy chain's new first level. It literally gets better the more you use it. Memory lives in ~/.screen_use/.

Tools (14)

Atomic (zero model dependency): screenshot · list_ui_elements · click · double_click · right_click · click_element_id · type_text · hotkey · press · scroll

High-level: find_element (strategy-chain locating) · click_element (locate + click) · read_screen (VLM screen Q&A) · run_task (autonomous visual loop)

Vision model (optional)

Only needed when your agent has no vision AND the target app is UIA-blind. Copy .env.example to .env:

Preset Config Models
Local (free, private) VISION_PROVIDER=ollama qwen3-vl, qwen2.5vl, llama3.2-vision
OpenAI VISION_PROVIDER=openai + key gpt-4o
Qwen VISION_PROVIDER=qwen + key qwen-vl-max

Without any VLM configured, atomic tools and UIA matching still work fully.

Safety

  • 🚨 Failsafe: slam your mouse to the top-left corner to abort instantly
  • ✅ confirm_callback hook to approve every action (SDK)
  • 🧪 ScreenUse(dry_run=True) records actions without executing

Extensibility

screen-use is designed as a set of replaceable layers — every tier can be extended without touching the core:

Layer Extension point How
Vision model VisionProvider ABC Implement pick_element() + ask_about_screen() (2 methods) — any OpenAI-compatible endpoint works out of the box via .env
Tools SDK facade Add a method to ScreenUse → expose in mcp_server.py with one @mcp.tool() decorator
Locating Strategy chain Insert your own level (e.g. OpenCV template matching) in find_element() — earlier levels win
Actions Executor Add drag, IME input, global hotkey hooks... dry_run support comes free
Platform perception/ seam Port uia_tree.py + screen.py to macOS Accessibility API or Linux AT-SPI — the rest of the stack is platform-agnostic
Memory ExperienceStore Swap JSONL for SQLite/vector DB; the meta-learning loop only depends on record_trace/recall/learn_mapping/recall_mapping
Introspection reflect.py playbook Add a StuckType + prompt template; classification is pure functions, easy to unit test
Host agents MCP Any MCP-compatible host (Claude, Kimi CLI, Cursor, your own) gets all 14 tools instantly

Safety hooks are part of the interface too: confirm_callback for human-in-the-loop approval, dry_run for simulation, PyAutoGUI failsafe for emergency stop.

Roadmap

  • [x] UIA + SoM locating strategy chain
  • [x] MCP Server (14 tools)
  • [x] Local VLM support (Ollama)
  • [x] Autonomous visual loop (run_task)
  • [x] Introspection playbook & meta-learning memory
  • [ ] wait_for_element / auto-verification primitives
  • [ ] Drag & drop
  • [ ] VLM raw-coordinate fallback + OpenCV template matching (UIA-blind apps)
  • [ ] macOS (Accessibility API) & Linux support
  • [ ] PyPI release

Contributions welcome — see issues for good first tasks.

Development

pytest tests -q                        # 61 unit tests, no desktop/VLM needed
python examples/demo_calculator.py     # end-to-end demo (real clicks!)
python examples/mcp_client_demo.py     # MCP handshake + tool list

License

MIT


<details> <summary>🇨🇳 中文说明</summary>

screen-use = 桌面版 browser-use:让任何 AI Agent 获得看屏幕、操作桌面应用的能力。

  • 不是传统 RPA:不录制 selector,通过无障碍树 + 视觉模型理解 UI,界面变了也不怕
  • 跨一切桌面应用:Excel、SAP、ERP 客户端、老旧 Win32 程序
  • 自然语言驱动:click_element("保存按钮") 一句话搞定
  • VLM 可选:策略链第一级是纯 UIA 文本匹配(零模型、毫秒级),视觉模型只在盲区兜底,支持本地 Ollama 保护隐私

接入方式、工具列表、安全配置与上文英文版一致。

</details>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选