@@ -9,14 +9,14 @@ This demonstrates CUP's core value: **one protocol, every OS**. Claude sees iden
99```
1010┌──────────────────────────────────────────────┐
1111│ Claude Code / MCP Client │
12- │ "Open Notepad on windows , type hello, │
13- │ then open Notes on mac and paste it" │
12+ │ "Open Notepad on screen 1 , type hello, │
13+ │ then open Notes on screen 2 and paste it" │
1414└──────────────────┬───────────────────────────┘
1515 │ MCP (stdio)
1616┌──────────────────▼───────────────────────────┐
1717│ mcp_server.py (MCP bridge) │
18- │ Exposes snapshot, action, find tools │
19- │ for each connected machine │
18+ │ Screen 1 = windows, Screen 2 = mac │
19+ │ Tools: snapshot, action, find, screenshot │
2020└──────┬──────────────────────────┬────────────┘
2121 │ WebSocket │ WebSocket
2222┌──────▼──────┐ ┌─────▼────────────┐
@@ -26,6 +26,8 @@ This demonstrates CUP's core value: **one protocol, every OS**. Claude sees iden
2626└─────────────┘ └──────────────────┘
2727```
2828
29+ Each connected machine is a numbered ** screen** (1, 2, 3...). Every tool accepts a ` screen ` parameter — either the number or the friendly name.
30+
2931## Files
3032
3133| File | Purpose |
@@ -79,23 +81,39 @@ Add to your Claude Code MCP config:
7981}
8082```
8183
82- Replace the paths and IPs for your setup. If you're running Claude Code on your Windows machine, ` windows ` can point to ` localhost ` .
84+ Replace the paths and IPs for your setup. Machines are numbered as screens (1, 2, 3...) in the order listed .
8385
8486### 4. Talk to Claude
8587
8688Now just ask Claude Code naturally:
8789
8890```
89- "What apps are open on both machines?"
91+ "What apps are open on all screens?"
92+
93+ "Take a snapshot of screen 1"
9094
91- "Open Notepad on windows and type 'Hello from Mac', then open TextEdit on mac and type 'Hello from Windows'"
95+ "Open Notepad on windows and type 'Hello from Mac',
96+ then open TextEdit on mac and type 'Hello from Windows'"
9297
93- "Take a snapshot of the foreground window on mac "
98+ "Click the Submit button on screen 2 "
9499
95- "Click the Submit button on windows "
100+ "Take a screenshot of screen 1 "
96101```
97102
98- Claude sees the CUP tools (` snapshot_machine ` , ` act_on_machine ` , etc.) and uses them to interact with both machines.
103+ ## Available Tools
104+
105+ | Tool | Description |
106+ | ------| -------------|
107+ | ` list_screens() ` | List all connected screens with number, name, OS |
108+ | ` snapshot(screen) ` | Capture foreground window's UI tree |
109+ | ` snapshot_app(screen, app) ` | Capture a specific app by title |
110+ | ` snapshot_desktop(screen) ` | Capture desktop icons/widgets |
111+ | ` overview(screen) ` | List open windows (near-instant) |
112+ | ` action(screen, action, ...) ` | Click, type, press keys, scroll, etc. |
113+ | ` find(screen, query/role/name/state) ` | Search the last tree for elements |
114+ | ` open_app(screen, app_name) ` | Open an app by name (fuzzy match) |
115+ | ` screenshot(screen, region_*) ` | Capture a PNG screenshot |
116+ | ` snapshot_all(scope) ` | Snapshot all screens in parallel |
99117
100118## Standalone Agent (alternative)
101119
@@ -117,16 +135,16 @@ python agent.py windows=ws://localhost:9800 mac=ws://192.168.1.30:9800
117135
118136```
119137# Cross-OS text relay
120- "Copy the title of the focused window on Windows and type it into the terminal on Mac "
138+ "Copy the title of the focused window on screen 1 and type it into the terminal on screen 2 "
121139
122140# Parallel app launch
123- "Open a text editor on both machines and type today's date in each"
141+ "Open a text editor on all screens and type today's date in each"
124142
125143# Cross-OS comparison
126- "Take a snapshot of both machines and tell me what apps are running on each"
144+ "Snapshot all screens and tell me what apps are running on each"
127145
128146# Multi-step workflow
129- "On Windows , open Chrome and navigate to example.com. On Mac , open Safari and navigate to the same URL."
147+ "On windows , open Chrome and navigate to example.com. On mac , open Safari and navigate to the same URL."
130148```
131149
132150## Using the client library directly
@@ -139,6 +157,7 @@ with RemoteSession("ws://192.168.1.10:9800") as win:
139157 print (win.snapshot(scope = " overview" ))
140158 win.open_app(" notepad" )
141159 tree = win.snapshot(scope = " foreground" )
160+ png = win.screenshot() # full screen PNG bytes
142161
143162# Multiple machines in parallel
144163with MultiSession({
@@ -163,4 +182,4 @@ The cup_server uses a simple JSON-RPC protocol over WebSocket:
163182{"id" : 1 , "result" : " # CUP 0.1.0 | windows | 1920x1080\n ..." }
164183```
165184
166- Methods: ` snapshot ` , ` action ` , ` press ` , ` find ` , ` overview ` , ` open_app ` , ` batch ` , ` info `
185+ Methods: ` snapshot ` , ` snapshot_desktop ` , ` action ` , ` press ` , ` find ` , ` overview ` , ` open_app ` , ` screenshot ` , ` batch ` , ` info `
0 commit comments