Skip to content

The local server

Allgreen’s interface is a web page served by a small server on your computer. The desktop app starts it and shows it in its window; allgreen ui starts it and opens it in your browser. This page explains how that server keeps other programs and other web pages out.

The server listens on 127.0.0.1 only, the address of your own computer: other computers on your network cannot reach it. It uses port 4747, or another free port if that one is taken.

Each time the server starts, it makes a new session token: 32 random bytes. The page the app opens carries it in its address (?token=…), and every request for your data must present it. A request without the right token is refused.

  • Requests for data (/api/…) send the token in a header.
  • Screenshots, videos and traces are loaded by the page directly, which cannot send a header: for them alone, and for reading only, the token may be in the address.
  • The interface itself (its page, scripts and styles) needs no token: it holds none of your data.

A web page you visit in your browser could try to send requests to 127.0.0.1. The server refuses them:

  • Host check. A request must be addressed to 127.0.0.1:<port> or localhost:<port>. This stops DNS rebinding, a trick where a web site makes its own name point to your computer to reach local servers.
  • Origin check. When a request says which page sent it, that page must be the server’s own. A request from any other site is refused, token or not.

Data answers are never cached, and a failed request is logged without its message, which could hold a secret.

The server gives only the files a run’s report names: its screenshots, videos and traces. The other files of a run, such as the saved sign-in session, are not served.

In the desktop app, an AI app reaches the app through a small program it starts, allgreen mcp --app (the command the Connect an AI page gives). That program finds the open app through a connection file, mcp.json, in the app’s data folder.

  • The file holds the server’s address, a token of the AI’s own and the app’s process number. It is written when the app starts and removed when it quits.
  • On macOS and Linux, it is readable by your user account only. On Windows, it is protected by your user folder’s permissions.
  • If the app is closed, or its process is gone, the AI is told “The Allgreen app is not open”.

With the command line (allgreen mcp without --app), there is no server and no connection file: the AI app starts Allgreen and talks to it directly, on your computer.

The desktop app’s window shows only two kinds of pages: its own server’s pages, on 127.0.0.1 at the server’s port, and a local page shown while the server starts. Any other link opens in your usual browser, and only web links (http and https) open there.

The app’s pages may ask the desktop app for three things only:

  • pick a folder, with your system’s folder picker;
  • open a web link in your usual browser;
  • bring the window to the front, when an AI shows you a page.

Nothing else: the window’s pages cannot run programs or read files themselves. The server runs as your user account, in its own process, and stops when you quit the app.

The desktop app keeps its data in ~/Library/Application Support/Allgreen on macOS, and %LOCALAPPDATA%\Allgreen\data on Windows: its list of projects, the runs, the browsers it installed, the connection file and a log of the server (logs/allgreen.log, rewritten at each launch). Your secrets are not in it: they are in the keychain.