Skip to main content
Glama
AxonDesk Edge Hub

AxonDesk Edge Hub

by 20apps-forge
README.md
# AxonDesk

> **AxonDesk is a free, open-source MCP bridge that lets ChatGPT, Claude, Cursor, and other AI agents run commands and manage files on Windows desktops — hosted on Cloudflare Edge with built-in hardware guardrails.**

[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Status](https://img.shields.io/badge/status-early%20development-orange)](#what-is-axondesk)
[![Platform](https://img.shields.io/badge/agent-Windows%20x64-0078d4?logo=windows&logoColor=white)](agent/)
[![Edge](https://img.shields.io/badge/edge-Cloudflare%20Workers-f38020?logo=cloudflare&logoColor=white)](hub/wrangler.jsonc)

AxonDesk connects AI assistants to your computers through a permanent, self-hostable Model Context Protocol (MCP) endpoint — no heavy local runtimes, no expiring quick tunnels, and no RAM/CPU spikes that can freeze your PC.

---

## Table of Contents

- [What is AxonDesk?](#what-is-axondesk)
- [Why AxonDesk?](#why-axondesk)
- [Features](#features)
- [Architecture](#architecture)
- [Repository Structure](#repository-structure)
- [Quickstart](#quickstart)
- [Connecting AI Clients](#connecting-ai-clients)
- [Examples](#examples)
- [Security Model](#security-model)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Author & Contact](#author--contact)
- [License](#license)

---

## What is AxonDesk?

AxonDesk is a two-part system:

1. **AxonDesk Edge Hub** (`hub/`) — a serverless MCP server and compact multi-device dashboard running on **Cloudflare Workers** with **SQLite-backed Durable Objects**. It exposes a permanent Streamable HTTP MCP URL and serves an installable React PWA.
2. **AxonDesk Desktop Agent** (`agent/`) — a standalone Windows executable (`AxonDesk.exe`, Python + Nuitka) designed for a small memory footprint that connects **outbound** over WebSocket, executes AI-requested tools under strict hardware guardrails, and auto-reconnects on network drops.

> **Status:** Early development. The dashboard UI, worker, and agent scaffolds are in place and the wire protocol is frozen in `project/ARCHITECTURE.md`; runtime wiring is being implemented phase by phase. See `MEMORY.md` for current phase status.

Together they let AI assistants act on real desktops: run commands, read/write files, list directories, and receive drag-and-drop file uploads — safely.

## Why AxonDesk?

Existing setups run local Node.js MCP wrappers (`supergateway` + `desktop-commander`) plus `cloudflared`, spawning multiple heavy processes (~150–250+ MB idle RAM), offer no hardware limits, and break when free tunnels expire.

AxonDesk replaces that stack with:

- **One native `.exe` agent** holding a persistent `wss://` connection to Cloudflare Edge.
- **A 5-layer hardware guardrail** that keeps host PCs responsive under any AI workload.
- **A stable custom-domain MCP URL** — saved once in ChatGPT/Claude, survives reconnects.
- **A multi-device dashboard** to manage many PCs from one place, on desktop or mobile.

## Features

### Multi-Device Management
- Register, rename, pause (emergency kill-switch), or revoke any number of PCs from one dashboard.
- Each device gets an isolated MCP endpoint: `/mcp/<device_id>?token=<device_token>`.
- Live status: online / degraded / offline / paused, with last-heartbeat timestamps.

### Live Hardware Telemetry
- Real-time CPU %, RAM %, RAM used/total (MB), OS info, and agent state per device.
- 10-second heartbeats; offline detection after missed beats.

### Hardware-Guarded Command Execution (`execute_command`)
- **Pre-execution circuit breaker** — rejects commands when RAM > 85% or CPU > 90% (sustained), returning an exact reason.
- **Low-priority subprocesses** — Windows `BELOW_NORMAL_PRIORITY_CLASS` so agent work never starves the desktop.
- **Single-task semaphore** (`max_concurrent = 1`) — overlapping AI calls queue instead of piling up.
- **Hard timeout** — 15s default, 30s max; hung process trees killed via `taskkill /T /F`.
- **Output caps** — stdout/stderr capped at 32 KB.

### Safe Filesystem Operations
- `get_system_info`, `read_file`, `write_file`, `list_directory`, `delete_path`.
- File reads capped at 100 KB / 500 lines per call to prevent memory bloat.
- Controlled deletion only through the explicit `delete_path` tool.

### Drag-and-Drop File Transfer
- Upload files from the PWA `Dropzone` straight to a target folder on any connected PC.
- Chunked transfer over the Durable Object WebSocket bridge with SHA-256 verification and per-file exact status.

### MCP Server (Streamable HTTP)
- JSON-RPC 2.0 endpoint at `/mcp/:deviceId` compatible with ChatGPT, Claude, Cursor, VS Code Copilot/Cline, and any MCP client.
- Token auth via `?token=` or `Authorization: Bearer`; hub stores only `sha256(token)`.
- Tools: `get_system_info`, `execute_command`, `read_file`, `write_file`, `list_directory`, `delete_path`.

### Installable PWA Dashboard
- Compact, high-density developer-tool UI — light & dark themes, reload-safe URLs, mobile bottom-nav layout.
- Global toast notifications displaying the **exact, unmodified** backend/agent messages.
- Offline-capable app shell via service worker.

### Command Logs & Exact Reporting
- Every tool call logged with duration, status, and error details in Durable Object SQLite.
- Dashboard `/logs` page streams execution history; toasts never mask errors.

## Architecture

```
ChatGPT / Claude / Cursor ──MCP──> Cloudflare Worker (Hono + Durable Object) <──WSS── AxonDesk.exe (Windows agent)
                                              │
                                              └── Static PWA Dashboard (React, installable)
```

- **Edge:** Cloudflare Workers + SQLite Durable Objects (`AxonHubDO`) with WebSocket Hibernation — fits the free tier.
- **Agent:** Python 3.12 (`websockets`, `psutil`, `asyncio`, `pystray`+`pillow` tray) compiled to a single `.exe` via Nuitka.
- **Dashboard:** React + Vite, component-driven UI frozen by `project/UI_DESIGN_SYSTEM.md`.

Full wire protocol, SQLite schema, and guardrail spec: [`project/ARCHITECTURE.md`](project/ARCHITECTURE.md).

## Repository Structure

```
axondesk/
├── AGENTS.md                    # Strict UI/architecture guardrails for AI agents
├── MEMORY.md                    # Persistent project memory & phase status
├── README.md                    # You are here
├── LICENSE                      # MIT
├── AUTHORS.md                   # Author & company details (Vib Tools)
├── CONTRIBUTING.md              # How to contribute
├── CHANGELOG.md                 # Release history
├── SECURITY.md                  # Vulnerability reporting
├── project/                     # Frozen specs + living dev docs (source of truth)
│   ├── MISSION_AND_FEATURES.md  # A-to-Z product & engineering spec
│   ├── ARCHITECTURE.md          # Schema, WSS protocol, MCP tools, guardrails
│   ├── UI_DESIGN_SYSTEM.md      # Design tokens & component contract
│   └── MANIFEST.md              # Doc index
├── notes/                       # Dev-time plans & phase logs
├── docs/                        # End-user guides
├── hub/                         # Edge Hub + dashboard
│   ├── public/                  # PWA manifest, service worker, icons
│   ├── src/                     # React app (ui/ layout/ sections/ pages/ router/ lib/ styles/)
│   ├── worker/                  # Hono routes + AxonHubDO Durable Object + MCP tools
│   ├── wrangler.jsonc
│   └── package.json
└── agent/                       # Windows desktop agent
    ├── agent.py
    ├── config.example.json
    ├── requirements.txt
    └── build.bat                # Nuitka one-click build → AxonDesk.exe
```

## Quickstart

### 1. Deploy the Edge Hub

```bash
cd hub
npm install
npm run build
npm run deploy        # wrangler deploy → Cloudflare Workers (Free plan works)
```

Set secrets for admin actions:

```bash
npx wrangler secret put ADMIN_KEY
```

Point a custom domain (e.g. `mcp.yourdomain.com`) at the worker for permanent MCP URLs.

### 2. Install the Desktop Agent

```bash
cd agent
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
copy config.example.json config.json   # edit hub_ws_url + device_id + device_token
python agent.py
```

Or build the standalone binary with `build.bat` → `AxonDesk.exe` (place `config.json` beside it).

### 3. Connect an AI Client

In the PWA dashboard: **Add Device** → copy the generated `device_id`, `device_token`, and MCP URL.

**ChatGPT:** Settings → Connectors → Add custom MCP server → paste URL → No authentication.

**Claude / other MCP clients:** use the Streamable HTTP URL directly:

```
https://mcp.yourdomain.com/mcp/<device_id>?token=<device_token>
```

Enable **Always Allow** for unattended automation.

## Examples

**Remote project check (from your phone):**
> *"Check D:\Projects on Home-PC, find the latest error log, and summarize the last 50 lines."*

ChatGPT → `list_directory` + `read_file` over WSS → agent returns capped output → summary delivered.

**Hardware protection:**
> Trigger a heavy build while RAM is at 88% → the agent's circuit breaker returns `CircuitBreakerTriggered: System RAM at 88.4% (limit 85.0%). Command aborted to prevent system freeze.` — your PC stays responsive.

**Mobile file delivery:**
> Open the PWA on mobile → select `Office-PC` → drop `invoice.pdf` → chunks stream over WSS → exact toast confirms bytes written.

## Security Model

- **Token auth** — the hub stores only `sha256(device_token)`; MCP accepts `?token=` or `Authorization: Bearer`.
- **Outbound-only agent** — nothing listens on your PC; the agent dials out.
- **5-layer hardware guardrails** — circuit breaker, low-priority execution, single-task semaphore, hard timeout + process-tree kill, output/file caps. See `project/ARCHITECTURE.md` §5.
- **Exact transparency** — original error strings surface in toasts and logs, never masked.
- **Local secrets** — `agent/config.json` and `.dev.vars` are git-ignored; never commit tokens.

Report vulnerabilities privately — see [`SECURITY.md`](SECURITY.md).

## Documentation

| Document | Contents |
|---|---|
| [`project/MISSION_AND_FEATURES.md`](project/MISSION_AND_FEATURES.md) | A-to-Z mission, personas, features, examples — **source of truth** |
| [`project/ARCHITECTURE.md`](project/ARCHITECTURE.md) | SQLite schema, WSS protocol, MCP endpoints, guardrails |
| [`project/UI_DESIGN_SYSTEM.md`](project/UI_DESIGN_SYSTEM.md) | Frozen design tokens & component contract |
| [`AGENTS.md`](AGENTS.md) | Mandatory rules for AI coding agents |
| [`MEMORY.md`](MEMORY.md) | Project memory & phase status |
| [`docs/`](docs/) | End-user guides |

## Contributing

Contributions are welcome — see [`CONTRIBUTING.md`](CONTRIBUTING.md). Keep pull requests focused and respect the frozen specs in `project/` and the UI rules in `AGENTS.md`.

## Author & Contact

**AxonDesk** is developed by **Vib Tools** — builders of practical desktop apps, self-hosted software, automation tools, and developer utilities for real workflows.

- Website: https://vib.tools/
- GitHub: https://github.com/vibtoolshq
- General: hello@vibtools.io · Support: support@vibtools.io
- Phone/WhatsApp: +880 1795-470603 (GMT+6)
- HQ: 5660 Kochakata, Nageswari, Kurigram, Rangpur, Bangladesh

## License

MIT © Vib Tools — see [`LICENSE`](LICENSE).