๐ 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.
๐ก 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) orngrok. 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/harikasinkaya/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)
๐ Direct Prompt to Connect Any Web AI
Copy and paste this prompt directly into ChatGPT, Gemini, Grok, Claude, or any web AI with browsing/fetching capabilities:
Read the official agent2win control protocol from this URL:
https://raw.githubusercontent.com/harikasinkaya/agent2win/refs/heads/main/AGENT_PROTOCOL.md
You are now an autonomous Windows controller agent.
My agent2win server URL is: <PASTE_YOUR_TUNNEL_URL_HERE>
My API key is: <PASTE_YOUR_API_KEY_OR_LEAVE_EMPTY>
Please inspect the system info, capture the screen, and follow my instructions to control my Windows machine.
ChatGPT Custom GPTs / Actions
- Open ChatGPT -> Create a GPT -> Configure -> Add Action.
- Set Server URL to your tunnel address (
https://xxxx.trycloudflare.com). - Set Authentication to API Key (Bearer token) if configured.
- Import endpoints from
AGENT_PROTOCOL.mdto 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 byhwnd.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent2win-1.0.5.tar.gz.
File metadata
- Download URL: agent2win-1.0.5.tar.gz
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
981d63b4d3c99df08b9d5238c6ef9ed5b63ed2e61fb413f1b9dc55878f3ba977
|
|
| MD5 |
8ab4bbd5db8ac39f83ab09c23a8697cf
|
|
| BLAKE2b-256 |
f2e4ed188f70447999cd3964fd56abe8496febd1a82a56be9ee37c8a8e76a3fe
|
File details
Details for the file agent2win-1.0.5-py3-none-any.whl.
File metadata
- Download URL: agent2win-1.0.5-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15cbb3ec23b2f65f558b0d7489c652cb7546a25b4f3700f0b2d0549621b106f4
|
|
| MD5 |
b187d6392e35a6ca8ca4106fa85beb90
|
|
| BLAKE2b-256 |
12b1bcbfde8804d3173e2bc62d154e6f5e81737f2eff14ecca28f5f6accddeff
|