Renamed to hayone/craft-web-gateway (no new images here)
92
A front door for the storytold craft apps (PhotoCraft, VectorCraft, LightCraft, FilmCraft, EffectCraft and the rest) with an AI assistant built in.
/<app>/ from its own container, by URL or port./model, /effort, /mode,
/clear, /compact, /help).claude mcp add and codex mcp add commands and the steps for a
ChatGPT developer-mode app, so your own Claude, Claude Code, ChatGPT or Codex can drive several
tabs and apps at once.Works from any browser, an iPad included: the app runs in the tab, Claude runs on the server.
The gateway stands on its own. craft-vscode, which opens
the apps in VS Code panels, doesn't need it: the extension frames the app images directly, and the
:remote app images answer the editor themselves (EMBED_ORIGINS on each app container). Until
November 2026 the gateway's overlay did that part, with EMBED_ORIGINS and EMBED_FILES on the
gateway. The gateway now ignores those two settings and prints a warning when EMBED_ORIGINS is
set.
The gateway was called craft-ai-hub until November 2026, and craft-gateway for a day after that. The old GitHub addresses still lead here.
Internal names keep the old word "hub", so nothing breaks for running setups: the /_hub/ routes,
window.craftHub, the craft-hub:session message, the cookies and HUB_SECRET.
Every feature beyond the launcher and the proxy is optional. Environment variables turn each one on or off, so you run only what you need. The section "Configuration" lists every variable.
| Feature | On when | Turn it off |
|---|---|---|
| Launcher and proxy | always | |
| Assistant overlay (chat and the Connect tab) | RELAY_URL and MCP_KEY are set | Leave RELAY_URL empty |
| Claude chat | claude is in CHAT_PROVIDERS (the default) | CHAT_TOKENS=off, or leave claude out of CHAT_PROVIDERS |
| Codex chat | codex is in CHAT_PROVIDERS (the default) | CHAT_PROVIDERS=claude |
| A shared Claude account | CLAUDE_CODE_OAUTH_TOKEN is set | Leave it empty, or set CHAT_TOKENS=personal |
| Sign-in | BASIC_AUTH or REQUIRE_SIGN_IN=true | Leave both unset |
| Cloud storage in the apps' File menu | craft-mcp has its AUTH_* and STORAGE_S3_* settings | Leave those craft-mcp settings empty |
browser ──▶ craft-web-gateway ──▶ /<app>/ app containers (hayone/<app>:remote)
│ ──▶ /_relay/… craft-mcp: the tab's WebSocket and the MCP endpoints
└─ chat: Claude Code or Codex ──MCP──▶ craft-mcp ──▶ app CLI ──▶ the user's tab
:remote app images (built in hayone1/Docker_Images)
add the page API and MCP connector the overlay uses. Apps without them still open from the
launcher, without the assistant.Pick an example, copy its .env.example to .env, fill it in, and docker compose up -d:
| Example | For |
|---|---|
| basic-auth | Trying it out: everything on one machine, user names and passwords in BASIC_AUTH |
| caddy-https | Your own domain with automatic HTTPS (Caddy, Let's Encrypt) and basic auth |
| oauth2-proxy | Sign-in with your OpenID Connect provider (Google, Entra, Keycloak, Authentik, …) through oauth2-proxy |
| cloud-storage | Sign-in through craft-mcp plus personal and shared cloud folders in an S3 bucket, for Open and Save |
| external-apps | Apps that already run elsewhere (other ports or servers): just the hub and the relay |
| kubernetes | The hub, the relay and an app as Deployments, behind an Ingress |
Each one publishes only the front door; the apps and the relay stay on the private network.
CHAT_PROVIDERS (default claude,codex) lists the agents the composer offers. The model menu
groups their models; picking another agent's model starts a new chat.
Claude chats run on Claude subscription tokens from Claude Code. Create one on any computer signed in to Claude Code (Pro or Max plan):
claude setup-token
CHAT_TOKENS decides whose account a chat uses:
CHAT_TOKENS | |
|---|---|
personal | Everyone adds their own token in the overlay's Account tab. The default without a shared token. |
both | Their own token if they added one, otherwise the hub's CLAUDE_CODE_OAUTH_TOKEN. The default with one. |
shared | Everyone uses CLAUDE_CODE_OAUTH_TOKEN. |
off | No in-app chat; the Connect tab still works. |
A personal token stays in that person's browser: the hub encrypts it (AES-GCM, HUB_SECRET) into
an HttpOnly cookie that only /_hub/ receives, so neither the apps' scripts nor the hub's disk
ever hold it. People set it up once per browser, from a computer, and then chat from anywhere,
an iPad included.
Codex chats run on each person's own ChatGPT plan. In the overlay's Account tab:
auth.json: after codex login on a computer, paste ~/.codex/auth.json.The sign-in is kept in DATA_DIR, encrypted with a key that only that browser's HttpOnly cookie
holds, so the disk alone can't open it. Codex refreshes it as it goes, and the hub keeps the
newest copy. Mount a volume at DATA_DIR (/data in the image) to keep sign-ins and Codex's
chat sessions across restarts; sign-ins unused for 90 days are removed.
Codex runs with its shell, file edits, web search, plugins, browser and sub-agents switched off,
read-only in an empty folder and with none of the hub's environment, so the app's MCP tools are
all it can use. It reaches them through the hub (/_hub/mcp/…, from the hub itself only), which
applies the permission mode before each call.
| Variable | Default | |
|---|---|---|
APPS | (required) | name=url pairs: photocraft=http://photocraft:8080,vectorcraft=http://localhost:8082. Order is the launcher's. |
APP_HOST | https://{app}.example.org: each app is also served at the root of its own host, for example https://photocraft.example.org/. The proxy in front must pass the original host (Host or X-Forwarded-Host). | |
RELAY_URL | craft-mcp's internal URL. Without it there is no assistant. | |
MCP_KEY | The same value craft-mcp has. craft-mcp's PUBLIC_HOST must be <hub origin>/_relay. | |
CHAT_TOKENS | personal, or both with a shared token | Whose Claude account chats use (see above). |
CLAUDE_CODE_OAUTH_TOKEN | The hub's shared token. | |
HUB_SECRET | derived from MCP_KEY | Encrypts personal tokens and ChatGPT sign-ins. Changing it signs every browser out. |
CHAT_PROVIDERS | claude,codex | The agents chat offers, in the menu's order. |
CHAT_MODEL, CHAT_EFFORT | Claude Code's | Claude's defaults when the composer leaves them on Default and Auto. |
CHAT_MODELS | Opus, Sonnet, Haiku 5.5, Fable 5.1 | Claude's model menu, as JSON [{"value": "<model id>", "label": "<name>"}]. |
CODEX_MODEL, CODEX_EFFORT | Codex's | Codex's defaults. |
CODEX_MODELS | GPT-6 Luna, GPT-5.6 Terra, GPT-5.6 Luna | Codex's model menu, same JSON. |
DATA_DIR | /data in the image | ChatGPT sign-ins (encrypted) and Codex sessions. |
BASIC_AUTH | user:password pairs, comma separated. | |
REQUIRE_SIGN_IN | false | true signs people in through craft-mcp's own OpenID Connect client (its AUTH_* settings). |
PUBLIC_ORIGIN | from the request | https://<host>, used for the sign-in callback. An app's own host (APP_HOST) uses its own origin instead. |
PORT | 8080 |
Choose one:
/_relay/ through without sign-in: MCP clients and the tab's WebSocket
authenticate with their relay key, and claude.ai connectors can't sign in.BASIC_AUTH: built in. /_relay/ and /healthz stay open for the same reason.REQUIRE_SIGN_IN: if craft-mcp already signs people in for cloud storage, the hub can use
that session. Register <hub origin>/_storage/callback with the provider.Keep the hub private. Claude subscription tokens are for personal use: with a shared token, every chat on the hub uses that one plan.
| Path | |
|---|---|
/ | Launcher |
/<app>/… | The app, with the overlay injected into its pages |
/<app>/_assistant/session | Mints the tab's relay key (craft-mcp /mint) |
/<app>/_storage/…, /_storage/… | craft-mcp cloud storage and its sign-in |
/_hub/cloud.js | Cloud storage in the apps' File › Open and Save (see below) |
/_relay/… | craft-mcp: the tab's WebSocket, /<key>/<app>/mcp |
/_hub/overlay.js, /_hub/chat, /_hub/chat/permission, /_hub/token | The overlay, its chat and permission answers, and the person's own Claude token |
/_hub/codex, /_hub/codex/login | The person's ChatGPT sign-in (device code or auth.json) |
/_hub/mcp/<gate> | Codex's MCP connection to the tab, from the hub itself only |
/healthz | Health check |
On an app's own host (APP_HOST), the app's paths start at / instead of /<app>/: the app at
/, /_assistant/session and /_storage/…. The /_hub/ and /_relay/ paths stay the same.
The gateway adds both to the app pages; the app images carry neither. cloud.js lends craft-mcp's
cloud folders to the app as storage places (window.craftStoragePlaces), which the File › Open
and Save dialogs of the remote images list. Before sign-in, the list shows one place that signs in
when opened. The overlay makes the tab's relay connection (_assistant/session) and hands it to
the app's relay client (window.craftAssistant.use). Remote images from before November 14, 2026
did both themselves, and they still work with this gateway.
npm install
APPS=photocraft=http://localhost:4101 node server.mjs
Node 22. No build step: server.mjs (proxy, launcher, auth), chat.mjs (chat and permission
modes), claude.mjs (Claude Code), codex.mjs (Codex and ChatGPT sign-in), seal.mjs
(encryption), public/overlay.js (the overlay).
MIT. The craft apps themselves are © their authors under their own licenses (MIT or Apache-2.0); see storytold.
Content type
Image
Digest
sha256:ab37c08b1…
Size
464.8 MB
Last updated
5 days ago
docker pull hayone/craft-gateway