# Gloria Headless [![Docker Hub](https://img.shields.io/badge/Docker%20Hub-sh7vansh%2Fgloria--headless-2496ED?logo=docker&logoColor=white)](https://hub.docker.com/r/sh7vansh/gloria-headless) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) A containerized, headless Chromium environment designed specifically for AI agent automation via the Model Context Protocol (MCP). Unlike [Gloria](https://github.com/sh7vansh/gloria), which provides a full VNC-based desktop for simultaneous human and AI use, **Gloria Headless** is a lightweight, pure-API variant built strictly for background automation and server-side deployment. ``` AI ───▶ MCP (Port 8787) ───▶ Headless Chromium ──▶ Persistent Profile (/data) ``` --- ## Features - **AI-Ready MCP Server**: First-class MCP endpoint on `:8787/mcp` powered by [Chrome Bridge](https://github.com/sh7vansh/chrome-bridge). - **Headless Optimization**: Runs `chromium --headless=new` with minimal dependencies. No X11 display server, VNC, or window managers required. - **Persistent Storage**: Retains cookies, history, local storage, and downloads across restarts via a Docker volume. - **Ad Blocking**: Pre-configured with uBlock Origin Lite (Basic mode) for lightweight, prompt-free browsing, saving bandwidth and AI context window size. - **Lightweight & Fast**: Ideal for remote agents, homelabs, or cloud deployments where UI access is not needed. --- ## Quick Start ### Option 1: Docker Compose (Recommended) ```bash git clone https://github.com/sh7vansh/gloria-headless.git cd gloria-headless docker compose up -d ``` ### Option 2: Docker Run (Prebuilt Multi-Arch Image) ```bash docker run -d \ --name gloria-headless \ -p 8787:8787 \ -v gloria-headless-data:/data \ --shm-size=2gb \ --restart unless-stopped \ sh7vansh/gloria-headless:latest ``` ### Endpoints | Interface | URL | Auth | Description | |---|---|---|---| | **MCP Endpoint** | `http://localhost:8787/mcp` | None | AI agent interface (HTTP/SSE) | ## Remote AI Automation (MCP) By hosting Gloria Headless on a remote server, VPS, or homelab, agents gain persistent, 24/7 browser control without consuming local GUI system resources. ### MCP Client Setup Add Gloria Headless's endpoint to your MCP client configuration (Claude Desktop, Cursor, Antigravity, or custom agents): ```json { "mcpServers": { "gloria-headless": { "url": "http://:8787/mcp" } } } ``` **Use `localhost:8787/mcp` for local development, or your remote server/VPN IP for remote agents.** > [!WARNING] > The MCP endpoint is unauthenticated by default and grants direct control over the live Chromium session and its authenticated state. Run Gloria Headless on a private network, behind a VPN (e.g. Tailscale), or behind an authenticated reverse proxy. --- ## Configuration You can customize the container using the following environment variables (e.g., in `.env` if using Docker Compose, or via `-e` in `docker run`): | Environment Variable | Default | Description | |---|---|---| | `GLORIA_MCP_PORT` | `8787` | MCP proxy port | | `GLORIA_DATA` | `/data` | Persistent data mount path | --- ## Storage Layout All persistent data is stored in the Docker volume mounted at `/data`: ``` /data/ ├── chromium/profile/ # Browser cookies, logins, and session data └── downloads/ # Downloads directory ``` --- ## Acknowledgements - [Chrome Bridge](https://github.com/sh7vansh/chrome-bridge) — Native browser automation engine & MCP server - [uBlock Origin Lite](https://github.com/uBlockOrigin/uBOL-home) (GPLv3) — MV3 declarative ad blocker --- ## License [MIT](LICENSE)