| name | agent-rdp |
| description | Controls Windows Remote Desktop sessions for automation, testing, and remote administration. Use when the user needs to connect to Windows machines via RDP, take screenshots, click, type, or interact with remote Windows desktops. |
| allowed-tools | Bash(agent-rdp:*) |
Windows Remote Desktop Control with agent-rdp
Quick start
agent-rdp connect --host <ip> -u <user> -p <pass> --enable-win-automation
agent-rdp automate snapshot -i
agent-rdp automate click "@e5"
agent-rdp automate fill "@e7" "Hello"
agent-rdp disconnect
Core workflow
- Connect with automation:
agent-rdp connect --host <ip> -u <user> -p <pass> --enable-win-automation
- Snapshot:
agent-rdp automate snapshot -i (get accessibility tree with refs)
- Act:
agent-rdp automate click @e5 or agent-rdp automate fill @e7 "text"
- Repeat: snapshot → act → snapshot → act...
Troubleshooting
Element not in snapshot with -i
Try without -i flag - some elements aren't marked as interactive but are still actionable:
agent-rdp automate snapshot
agent-rdp automate snapshot -d 5
Element not in accessibility tree at all
Some UI elements (WebView content, certain dialogs, toast notifications) don't appear in the accessibility tree. Use OCR as a last resort:
- Take screenshot to identify what you need:
agent-rdp screenshot -o screen.png
- Use locate to find coordinates:
agent-rdp locate "Button Text"
- Click using returned coordinates:
agent-rdp mouse click <x> <y>
Commands
Connection
agent-rdp connect --host 192.168.1.100 -u Admin -p secret
agent-rdp connect --host 192.168.1.100 -u Admin --password-stdin
agent-rdp connect --host 192.168.1.100 --width 1920 --height 1080
agent-rdp connect --host 192.168.1.100 --drive /tmp/share:Share
agent-rdp disconnect
Screenshot
agent-rdp screenshot
agent-rdp screenshot -o desktop.png
agent-rdp screenshot --format jpeg
Mouse
agent-rdp mouse click 500 300
agent-rdp mouse right-click 500 300
agent-rdp mouse double-click 500 300
agent-rdp mouse move 100 200
agent-rdp mouse drag 100 100 500 500
Keyboard
agent-rdp keyboard type "Hello World"
agent-rdp keyboard press "ctrl+c"
agent-rdp keyboard press "alt+tab"
agent-rdp keyboard press "ctrl+shift+esc"
agent-rdp keyboard press "win+r"
agent-rdp keyboard press enter
agent-rdp keyboard press escape
agent-rdp keyboard press f5
Scroll
agent-rdp scroll up --amount 3
agent-rdp scroll down --amount 5
agent-rdp scroll left
agent-rdp scroll right
Clipboard
agent-rdp clipboard set "Text to paste"
agent-rdp clipboard get
Drive mapping
agent-rdp connect --host <ip> -u <user> -p <pass> --drive /local/path:DriveName
agent-rdp drive list
Session management
agent-rdp session list
agent-rdp session info
agent-rdp --session work connect ...
agent-rdp --session work screenshot
Wait
agent-rdp wait 2000
Locate (OCR)
agent-rdp locate "Cancel"
agent-rdp locate "Save*" --pattern
agent-rdp locate --all
agent-rdp locate "OK" --json
Returns text lines with bounding boxes and center coordinates for clicking:
Found 1 line(s) containing 'Cancel':
'Cancel' at (650, 420) size 45x14 - center: (672, 427)
To click the first match: agent-rdp mouse click 672 427
UI Automation
agent-rdp connect --host 192.168.1.100 -u Admin -p secret --enable-win-automation
agent-rdp automate snapshot
agent-rdp automate snapshot -i
agent-rdp automate snapshot -c
agent-rdp automate snapshot -d 5
agent-rdp automate snapshot -s "~*Notepad*"# Scope to a window/element
agent-rdp automate snapshot -f
agent-rdp automate snapshot -i -c -d 3
agent-rdp automate click "#SaveButton"
agent-rdp automate click "@e5"
agent-rdp automate click "@e5" -d
agent-rdp automate select "@e10"
agent-rdp automate select "@e5" --item "Option 1"
agent-rdp automate toggle "@e7"
agent-rdp automate toggle "@e7" --state on
agent-rdp automate expand "@e3"
agent-rdp automate collapse "@e3"
agent-rdp automate context-menu "@e5"
agent-rdp automate focus <selector>
agent-rdp automate get <selector>
agent-rdp automate fill <selector> "text"
agent-rdp automate clear <selector>
agent-rdp automate scroll <selector> --direction down --amount 3
agent-rdp automate window list
agent-rdp automate window focus "~*Notepad*"
agent-rdp automate window maximize
agent-rdp automate window minimize
agent-rdp automate window restore
agent-rdp automate window close "~*Notepad*"
agent-rdp automate run "notepad.exe"
agent-rdp automate run "Start-Process ms-settings:" --wait
agent-rdp automate run "calc.exe"
agent-rdp automate run "Get-Process" --wait --process-timeout 5000
agent-rdp automate wait-for <selector> --timeout 5000
agent-rdp automate wait-for <selector> --state visible
agent-rdp automate status
Selector syntax:
@e5 or @5 - Reference number from snapshot (e prefix recommended)
#SaveButton - Automation ID
.Edit - Win32 class name
~*pattern* - Name with wildcard
File - Element name (exact match)
Snapshot output format:
- Window "Notepad" [ref=e1, id=Notepad]
- MenuBar "Application" [ref=e2]
- MenuItem "File" [ref=e3]
- Edit "Text Editor" [ref=e5, value="Hello"]
JSON output
Add --json for machine-readable output:
agent-rdp --json clipboard get
agent-rdp --json session info
agent-rdp --json automate snapshot
Example: Open PowerShell and run command
agent-rdp connect --host 192.168.1.100 -u Admin -p secret
agent-rdp wait 3000
agent-rdp keyboard press "win+r"
agent-rdp wait 1000
agent-rdp keyboard type "powershell"
agent-rdp keyboard press enter
agent-rdp wait 2000
agent-rdp keyboard type "Get-Process"
agent-rdp keyboard press enter
agent-rdp screenshot --output result.png
agent-rdp disconnect
Example: File transfer via mapped drive
agent-rdp connect --host 192.168.1.100 -u Admin -p secret --drive /tmp/transfer:Transfer
agent-rdp keyboard press "win+r"
agent-rdp wait 500
agent-rdp keyboard type "\\\\tsclient\\Transfer"
agent-rdp keyboard press enter
Example: Automate Notepad with UI Automation
agent-rdp connect --host 192.168.1.100 -u Admin -p secret --enable-win-automation
agent-rdp automate run "notepad.exe"
agent-rdp wait 2000
agent-rdp automate snapshot -i
agent-rdp automate fill "@e5" "Hello from automation!"
agent-rdp automate expand "File"
agent-rdp wait 500
agent-rdp automate click "Save As..."
agent-rdp automate wait-for "#FileNameControlHost" --timeout 5000
agent-rdp automate fill "#FileNameControlHost" "test.txt"
agent-rdp automate click "#1"
Environment variables
export AGENT_RDP_HOST=192.168.1.100
export AGENT_RDP_PORT=3389
export AGENT_RDP_USERNAME=Administrator
export AGENT_RDP_PASSWORD=secret
export AGENT_RDP_SESSION=default
agent-rdp connect
Debugging with WebSocket streaming
agent-rdp --stream-port 9224 connect --host 192.168.1.100 -u Admin -p secret
agent-rdp view --port 9224
Tips
Prefer automate fill over keyboard type when automation is enabled—it's lossless (no dropped characters) and faster.
Opening applications
Use automate run to launch apps directly:
agent-rdp automate run "notepad.exe"
agent-rdp automate run "calc.exe"
agent-rdp automate run "Start-Process ms-settings:" --wait
agent-rdp automate run "explorer.exe C:\\"
Limitations
IMPORTANT: Read these limitations carefully before attempting automation tasks.
UI Automation cannot access WebViews
- The Windows Start menu search, Edge browser content, Electron app content, and other WebView-based UIs are NOT accessible via
automate snapshot.
- Workaround: Use
Win+R (Run dialog) or automate run to launch programs directly instead of navigating through the Start menu.
UI Automation cannot handle UAC dialogs
- User Account Control elevation prompts run on a secure desktop isolated from UI Automation.
- UAC dialogs will NOT appear in
automate snapshot output.
- Workaround: Use
locate command (OCR) to find button text and mouse click to interact. This is unreliable but may work for simple Yes/No dialogs.
OCR (locate) is not highly reliable
- The
locate command uses OCR which can misread characters, miss text entirely, or return imprecise coordinates.
- Use it as a last resort when UI Automation cannot access elements.
- Always verify coordinates before clicking critical buttons.
DO NOT estimate coordinates from screenshots (Claude only)
- Claude models in non-computer-use mode (like Claude Code) are very bad at pixel counting.
- Do NOT look at a screenshot and try to guess coordinates - the estimates will likely be wrong.
- Note: Gemini models are generally good at pixel coordinate estimation.
- If you need vision-based coordinate detection with Claude, the user must implement a harness using Claude's Computer Use Tool.
Recommended workflow when UI Automation fails
- First, always try
automate snapshot (with and without -i flag)
- If element not found, try
locate "text" to find via OCR
- Use coordinates from
locate output with mouse click
- Never estimate coordinates by looking at screenshots