Connecting Foundry VTT & Other VTTs (ACP v1)
Elthoria ships built-in Tactical Battle Boards and Hex World Maps inside elthoria web, and includes a real, installable Foundry VTT (v12 / v13) module (elthoria-acp-bridge) that connects Foundry directly to your local Elthoria Harness over Agent Client Protocol (ACP) v1 WebSockets — plus provider-neutral contracts for Owlbear Rodeo, Roll20, or custom browser VTTs.
How the Foundry VTT connection works
┌─────────────────────────────────────────────────────────────────────────┐
│ Foundry VTT (v12 / v13) — `elthoria-acp-bridge` Module (GM-only) │
│ • GM chat commands (`/elthoria`, `/elthoria-turn`, `/elthoria-ooc`, │
│ `/elthoria-recap`, `/elthoria-status`) + Token Controls button │
│ • Streams responses into a private GM whisper with Cancel & Reveal │
└───────────────────────────────┬─────────────────────────────────────────┘
│ ws://127.0.0.1:9188/acp?token=<secret>
│ (ACP v1 JSON-RPC 2.0 over localhost WS)
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Elthoria ACP WebSocket Bridge (`elthoria acp --ws`) │
│ • Pure-JDK loopback-only RFC 6455 bridge (127.0.0.1, token + Origin) │
│ • Pipes NDJSON bidirectionally to `kompile acp` + Elthoria MCP server │
│ • Enforces GM vs. PLAYER visibility (`elthoria.vtt-scene-sync.v1`) │
└─────────────────────────────────────────────────────────────────────────┘- 100% local & GM-only: The bridge binds strictly to
127.0.0.1and requires both a one-time auth token and an allowedOriginheader. Players in your Foundry world cannot see your token, run/elthoriacommands, or see GM whispers until you click Reveal to Players.
Step-by-Step: Installing the Foundry VTT Module (elthoria-acp-bridge)
Step 1: Install the module in Foundry VTT
Method A — 1-Click Manifest URL inside Foundry (Recommended)
- Open Foundry VTT Setup (the main home screen before launching a world).
- Click the Add-on Modules tab, then click Install Module.
- At the bottom of the Install Module dialog, paste this Manifest URL:text
https://elthoria-ai.github.io/elthoria-harness/foundry/module.json - Click Install. Foundry downloads and verifies
elthoria-acp-bridge.zipautomatically.
Method B — Manual ZIP Download (Offline / Self-Hosted Server)
- Download the packaged module ZIP:
- Extract the archive into your Foundry VTT
Data/modules/directory so thatmodule.jsonsits atData/modules/elthoria-acp-bridge/module.json:- macOS:
~/Library/Application Support/FoundryVTT/Data/modules/ - Windows:
%LOCALAPPDATA%\FoundryVTT\Data\modules\ - Linux:
~/.local/share/FoundryVTT/Data/modules/
- macOS:
- Restart Foundry VTT (or refresh Setup).
Method C — From Source or Installed Distribution (Developers)
If you cloned elthoria-harness or installed the portable distribution, you can symlink the module directory directly into Foundry's Data/modules/:
# From a source checkout:
ln -s /path/to/elthoria-harness/integrations/foundry-vtt/elthoria-acp-bridge \
~/.local/share/FoundryVTT/Data/modules/elthoria-acp-bridge
# Or from an installed distribution:
ln -s ~/.elthoria/components/elthoria/current/share/elthoria/integrations/foundry-vtt/elthoria-acp-bridge \
~/.local/share/FoundryVTT/Data/modules/elthoria-acp-bridgeStep 2: Enable the module in your Foundry world
- Launch your Foundry world and log in as Gamemaster.
- Open Game Settings (gear icon in the top-right sidebar) → Manage Modules.
- Check Elthoria GM — ACP v1 Bridge and click Save Module Settings (Foundry reloads the world).
Step 3: Start the local Elthoria ACP WebSocket bridge
In a terminal on your GM machine, start the bridge:
elthoria acp --ws --port 9188Elthoria binds strictly to 127.0.0.1:9188, generates a one-time random auth token, and prints:
Elthoria ACP v1 WebSocket bridge listening on ws://127.0.0.1:9188/acp
Auth token: <generated-token>
Connect URL: ws://127.0.0.1:9188/acp?token=<generated-token>TIP
Want a stable token across restarts, or running Foundry on a LAN hostname? Pass --token <your-secret> and/or --allow-origin:
elthoria acp --ws --port 9188 --token my-gm-secret --allow-origin http://foundry.local:30000Step 4: Configure the module settings in Foundry (GM-only)
- In Foundry, open Game Settings → Configure Settings → Elthoria GM — ACP v1 Bridge.
- Paste the Connect URL (
ws://127.0.0.1:9188/acp?token=<generated-token>) directly into Elthoria ACP WebSocket URL — or pastews://127.0.0.1:9188/acpinto the URL field and the token into Elthoria ACP Auth Token (both work). - Set Elthoria Campaign ID (e.g.
1, matching your campaign in Elthoria). - Leave Attach Active Foundry Scene Snapshot (GM-only) checked if you want Foundry's active scene grid and token positions sent privately alongside
/elthoriaprompts. - Click Save Changes.
Step 5: Verify & play right inside Foundry Chat
In Foundry's chat box (as GM), run:
/elthoria-connectYou should see a private GM whisper card confirming Status: Connected, your active ACP session ID, campaign ID, and active Foundry scene.
Built-in Foundry GM Chat Commands
| Command | What it does |
|---|---|
/elthoria <prompt> | Send an in-character or GM prompt with the active Foundry scene snapshot attached |
/elthoria-turn <action> | Run a grounded combat or action turn through Elthoria |
/elthoria-play [notes] | Orient or resume your active Elthoria campaign |
/elthoria-recap | Generate a spoiler-free recap (arrives as a private GM whisper — click Reveal to Players to share it!) |
/elthoria-ooc <question> | Ask an out-of-character rules, AC breakdown, or prep question without advancing the scene |
/elthoria-rules <query> | Look up mechanics or your player-safe bookshelf |
/elthoria-status | Show current bridge status, ACP session ID, campaign ID, and active Foundry scene |
/elthoria-connect / /elthoria-reconnect / /elthoria-disconnect | Connect, refresh token/session, or disconnect from the bridge |
/elthoria-cancel | Cancel an in-flight streaming response |
You can also click the Ask Elthoria GM wizard-hat icon in Foundry's Token Controls toolbar (left sidebar, GM-only) to send a prompt from a dialog.
- Streaming & spoiler safety: Responses stream live into a private GM whisper card showing tool progress and a Cancel button while running. Once finished, click Reveal to Players whenever you want to post that narration publicly to Foundry chat.
- Hidden tokens stay hidden: Hidden Foundry tokens are marked
hidden: trueon GM snapshots and automatically stripped on anyPLAYER-audience snapshot (extractSceneSnapshot('PLAYER')).
Troubleshooting
| Symptom | Cause & Fix |
|---|---|
Failed to connect / WebSocket rejected (401) | You restarted elthoria acp --ws, which generated a new random token. Paste the new Connect URL (or pass --token <fixed-secret> when launching) and run /elthoria-reconnect. |
| WebSocket rejected (403 Forbidden) | Your Foundry browser tab is opened on a hostname other than localhost/127.0.0.1 (for example http://192.168.1.50:30000). Restart the bridge with --allow-origin http://192.168.1.50:30000. |
Browser blocks ws://127.0.0.1 on an https:// Foundry host | Browsers treat http://localhost / ws://127.0.0.1 as potentially trustworthy in Chromium/Firefox, while Safari or strict proxies may block ws:// from an https:// page. Open Foundry locally on http://localhost:30000 (or reverse-proxy the bridge over wss:// on your GM machine). |
Nothing happens when a player types /elthoria | Expected — the module restricts all settings, toolbar buttons, and /elthoria* commands strictly to Gamemaster accounts. |
Optional: Connecting Owlbear Rodeo, Roll20, or Custom VTTs (Developers)
- ACP v1 over WebSocket (
elthoria acp --ws): Any browser VTT extension can reuse the zero-dependency ESM client inintegrations/foundry-vtt/elthoria-acp-bridge/scripts/acp-client.mjs(ElthoriaAcpClient,resolveConnectionTarget,extractFoundrySceneSyncSnapshot) to speak standard ACP v1 JSON-RPC 2.0 (initialize→session/new/session/resume→session/prompt, streamingsession/update,session/cancel). - ACP v1 over stdio (
elthoria acp): Connects desktop ACP clients directly to Elthoria's GM workspace. - Provider-neutral VTT contracts (
elthoria-integrations):VttCapabilities(foundry-vtt,owlbear-rodeo,roll20,elthoria-web)VttSceneSyncSnapshot(elthoria.vtt-scene-sync.v1) with fail-closedtoPlayerSafe()filteringVttSyncEvent(elthoria.vtt-event.v1) forSCENE_ACTIVATED,TOKEN_MOVED,INITIATIVE_UPDATED,CHAT_MESSAGE,ROLL_RESULT, andHP_UPDATEDVttBridgePortSPI for Java/JVM adapters
- Direct Foundry MCP servers: If you also want the AI GM to push direct Foundry actor/journal/token edits via MCP, you can mount any compatible Foundry MCP server alongside
elthoriain your Kompile MCP configuration.
Next steps
- Running Sessions, Maps & Prep — IC/OOC play, combat, stealth, and built-in maps
- CLI & Launcher Reference —
elthoria acpandelthoria acp --wsflags - Kompile ACP v1 Documentation ↗ — full upstream ACP v1 protocol surface