Skip to main content

๐Ÿš€ agent2win

Universal Bridge Between Web / Cloud AI Agents & Windows OS

Control your Windows PC or Server directly from web-based AI platforms like ChatGPT, Gemini, Grok, Claude, or custom cloud agents.

License: MIT Python 3.9+ Platform: Windows API: REST & WebSocket


๐Ÿ’ก Turn Any Web AI Into a Windows Agent:
Any AI model or platform with web/API browsing capabilities (ChatGPT / Custom GPTs, Gemini, Grok, Claude, OpenAI Assistants, LangChain, CrewAI) can be transformed into an autonomous computer-use agent to control your local Windows PC or remote Windows Server via secure REST / WebSocket endpoints.


๐Ÿ“– Overview

agent2win is a lightweight, high-performance middleware server for Windows. It exposes a unified REST & WebSocket API, instantly accessible over the public internet through automatic Cloudflare or ngrok tunnels with zero router configuration.

Whether you are building custom autonomous agents or connecting conversational web AIs (chatgpt.com, gemini.google.com, grok.com) via Custom Actions / API tools, agent2win provides full control over your OS environment.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Web & Cloud AI Ecosystem                                         โ”‚
โ”‚ โ€ข chatgpt.com (Custom GPTs / Actions)   โ€ข gemini.google.com      โ”‚
โ”‚ โ€ข grok.com / xAI                        โ€ข claude.ai / Anthropic  โ”‚
โ”‚ โ€ข Autonomous Frameworks (LangChain, CrewAI, AutoGen, AutoGPT)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ”‚ HTTPS / WSS (API Key Auth)
                                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Cloudflare / ngrok Public Tunnel (Zero Port-Forwarding)          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ”‚
                                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ agent2win Server (:7770)                                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ€ข Screen & Window Capture       โ”‚ โ€ข Mouse & Keyboard Emulation   โ”‚
โ”‚ โ€ข Shell & Command Runner        โ”‚ โ€ข Virtual Desktop Isolation    โ”‚
โ”‚ โ€ข Filesystem & Registry         โ”‚ โ€ข Process & Service Manager    โ”‚
โ”‚ โ€ข Clipboard & Audio Controls    โ”‚ โ€ข Security & Approval Layer    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Key Features

  • ๐ŸŒ Web AI Compatibility: Turn web-based models (ChatGPT Actions, Gemini, Grok, Claude) into remote operators for your Windows machines.
  • โšก Zero-Config Public Tunnel: Instant public HTTPS endpoint generated automatically using Cloudflare Tunnel (cloudflared) or ngrok. No static IP or port forwarding required.
  • ๐Ÿ–ฅ๏ธ Virtual Desktop Isolation: Create dedicated hidden/secondary virtual desktops (/api/desktops). The agent works autonomously on Desktop 2 without interfering with your active tasks on Desktop 1.
  • ๐Ÿ“ธ Vision & Window Capture: Full display screenshots or targeted window-handle (hwnd) captures in base64 format for visual reasoning.
  • ๐Ÿ–ฑ๏ธ Hardware Input Emulation: Mouse click, drag, scroll, and keyboard typing with complete Unicode / international character support.
  • ๐Ÿ’ป OS & System Administration: Run PowerShell/CMD scripts, manage filesystem (read/write/search), list/kill processes, inspect Windows Services, and edit Registry keys.
  • ๐Ÿ”’ Comprehensive Security Layer: Token authentication (Bearer), real-time desktop approval prompts for risky commands, system tray killswitch, and audit logging.

โšก Quick Start

1. Install

Clone repository and install dependencies:

git clone https://github.com/yourusername/agent2win.git
cd agent2win
pip install -r requirements.txt

Or double-click install.bat on Windows.

2. Run Server

python main.py

Or double-click start.bat.

3. Connect Any AI Agent

The console displays your live public HTTPS tunnel:

๐ŸŒ Tunnel: https://xxxx-xxxx-xxxx.trycloudflare.com

Connect your AI agent (e.g. ChatGPT Custom Action schema, LangChain tool, or web agent) using this URL.


๐Ÿค– Using With Web AIs (ChatGPT, Gemini, Grok, Claude)

ChatGPT Custom GPTs / Actions

  1. Open ChatGPT -> Create a GPT -> Configure -> Add Action.
  2. Set Server URL to your tunnel address (https://xxxx.trycloudflare.com).
  3. Set Authentication to API Key (Bearer token) if configured.
  4. Import endpoints from AGENT_PROTOCOL.md to let ChatGPT inspect your screen, run commands, and click UI elements.

Gemini, Grok & Cloud Agents

Pass the public tunnel URL and API endpoints into your agent execution loop. The agent can take screenshots (/api/screen), process images with vision models, and issue input commands (/api/mouse/click, /api/keyboard/type).


๐Ÿ› ๏ธ CLI Options

Flag Description
--port <PORT> Server port (Default: 7770)
--host <IP> Bind IP address (Default: 0.0.0.0)
--key <SECRET> Set Bearer token for API authentication
--unrestricted Disable action approval prompts (โš ๏ธ use carefully)
--tunnel <PROVIDER> Tunnel provider (cloudflared or ngrok)
--no-tunnel Local-only mode (disables tunnels)
--no-tray Disable Windows system tray icon
--settings Open graphical configuration GUI

๐Ÿ“ก API Reference Overview

Full protocol specifications available in AGENT_PROTOCOL.md.

๐Ÿ–ฅ๏ธ Virtual Desktops (Background Mode)

  • POST /api/desktops/setup โ€” Create agent virtual desktop.
  • POST /api/desktops/switch_agent โ€” Switch active view to agent desktop.
  • POST /api/desktops/switch_user โ€” Switch active view back to user desktop.

๐Ÿ“ธ Screen & Windows

  • GET /api/screen โ€” Full desktop screenshot (Base64 JPEG).
  • GET /api/windows โ€” List active windows with handles (hwnd) and coordinates.
  • POST /api/windows/screenshot โ€” Capture specific window by hwnd.
  • POST /api/windows/focus โ€” Bring window to foreground.

๐Ÿ–ฑ๏ธ Mouse & Keyboard

  • POST /api/mouse/click โ€” {"x": 500, "y": 300, "button": "left"}
  • POST /api/mouse/scroll โ€” {"clicks": -5}
  • POST /api/keyboard/type โ€” {"text": "Hello World", "unicode": true}
  • POST /api/keyboard/hotkey โ€” {"keys": ["ctrl", "c"]}

๐Ÿ’ป Shell & Filesystem

  • POST /api/command โ€” {"cmd": "dir C:\\", "timeout": 10}
  • GET /api/fs/list?path=C:\ โ€” List directory contents.
  • POST /api/fs/read โ€” Read file contents.
  • POST /api/fs/write โ€” Write file contents.

๐Ÿ”’ Security & Approvals

  • Safe Mode (Default): Critical actions (destructive shell commands, file deletions, registry writes, system reboot/shutdown) trigger desktop approval prompts.
  • Unrestricted Mode (--unrestricted): Disables interactive confirmation for headless/autonomous agents.
  • Audit Logs: All executions recorded in logs/audit.log.
  • Tray Killswitch: Pause or stop the server directly from the Windows taskbar.

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent2win-1.0.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent2win-1.0.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file agent2win-1.0.0.tar.gz.

File metadata

  • Download URL: agent2win-1.0.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for agent2win-1.0.0.tar.gz
Algorithm Hash digest
SHA256 28fdf593898a73da92f8b76fbda142eb245c5016445d8666e7dc8d645086b88a
MD5 375dc38c6f043437fde9b490ded5a653
BLAKE2b-256 988861f5b1a9dd7c21058d9f87164330436f7e5084379dd993e566eb37146d1b

See more details on using hashes here.

File details

Details for the file agent2win-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: agent2win-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for agent2win-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0379a01710b6c96b5e38ab742501766f57ed22c276e30a8fe96d69f74ef764
MD5 e1d9b8a1e252f7cecf0c75a574420cd0
BLAKE2b-256 08be5e0837ce073776069ef663a058ff3c31c6730b9d4109bebd07ad15d85378

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page