fvtt-mcp-molten5e
Enables AI assistants to read and edit live D&D 5e Foundry VTT worlds and manage Molten-hosted server lifecycle via the Model Context Protocol.
README
fvtt-mcp-molten5e
A D&D 5e–only, Molten Hosting–optimized Model Context Protocol server for Foundry VTT, driven by Claude Code. It lets an AI assistant read and edit a live Foundry world (actors, items, journals, scenes, compendia, combat…) and manage a Molten-hosted server's lifecycle and files.
This is the tool/engine layer of a larger AI co-DM project. It is a maintained fork of adambdooley/foundry-vtt-mcp ("Foundry MCP Bridge"), stripped to D&D 5e only (ComfyUI map-generation and all non-5e systems removed) and extended with a Molten-Hosting lifecycle/file tool group. It tracks upstream loosely, not commit for commit.
Status: work in progress. Scaffold + dependency hardening + the Molten "Plane B" tool group are done. Wiring into Claude Code and the live end-to-end test against a real Molten world are in progress. See
docs/PLAN.mdfor the roadmap anddocs/HANDOFF.mdfor current state.
Why this shape
Managed Foundry hosts (like Molten) don't expose a general control API and you can't run a process next to the game server. So the bridge runs as a Foundry module in the GM's own browser, which connects out to an MCP server on the GM's PC (bound to localhost). Claude Code talks to that local MCP server.
The browser↔localhost hop uses WebRTC (DTLS data channel, localhost-exception HTTP signaling on
:31416, Google STUN) rather than a plain WebSocket — this is what lets a page served over HTTPS
reach localhost without a mixed-content block or a local TLS cert. It is load-bearing, not bloat.
Claude Code ──stdio──> MCP server (your PC, localhost)
│ WebRTC data channel (DTLS)
▼
Foundry module (GM's browser tab)
│ Foundry's own socket
▼
Foundry VTT world (Molten-hosted)
Two-plane model
- Plane A — the live bridge. World data (actors, items, journals, scenes, compendia, combat, ownership, dice). Goes through the browser module over the WebRTC bridge while the server is awake.
- Plane B — Molten lifecycle & files. Talks to Molten's own endpoints directly (no bridge):
wake a slept server via the Magic URL, watch the sleep-warning socket, keep a session awake, and
upload/serve static assets over WebDAV. See
docs/DESIGN.md§4.
Safety rule baked in: a running world's database (LevelDB stores under Data/worlds/<world>/data/)
must never be written over the file channel — that corrupts it. Plane-B file ops are restricted
to static assets; bulk DB edits are an offline-only flow (stop → backup → unpack → edit → pack →
start). The Molten management panel is never scripted (their ToU forbids it); only WebDAV, the
Foundry server, and the Magic-URL GET are automated.
Repository layout
packages/
mcp-server/ @foundry-mcp/server — the MCP server (Plane A tools + Plane B molten/ group)
foundry-module/ @foundry-mcp/module — the Foundry browser module (the bridge endpoint)
shared/ @foundry-mcp/shared — types/protocol shared by both
docs/ DESIGN.md, PLAN.md, HANDOFF.md, tool specs
upstream/ archived original (Adam's) README + docs, for reference
research/ cached Molten Hosting wiki dump + the fetch script
scripts/ dev/maintenance scripts (MCP schema smoke test)
Requirements
- Node.js 18+ (developed on 24). On Windows, if Node isn't on
PATH, use the full path tonode.exe(see wiring below). - Foundry VTT 14.x with the D&D 5e system, hosted on Molten (Elite tier assumed for the Plane-B sleep/wake behavior).
Build
npm install
npm run build # builds shared, server, and module
Individual workspaces: npm run build:shared, npm run build:server, npm run build:foundry.
Tests: npm test (server unit tests run on vitest).
Wire into Claude Code
Register the built MCP server in your Claude Code config. Copy
.mcp.json.example to a .mcp.json Claude Code reads (project-scoped, or your
~/.claude.json mcpServers) and set absolute paths:
{
"mcpServers": {
"foundry-molten5e": {
"command": "C:/Program Files/nodejs/node.exe",
"args": ["C:/path/to/fvtt-mcp-molten5e/packages/mcp-server/dist/index.js"]
}
}
}
- Use an absolute path to
dist/index.js(Claude Code may launch the server from any directory). - On Windows, point
commandat the fullnode.exepath if Node isn't onPATH. - The server loads its
.envfrom the repo root regardless of working directory.
Then install the @foundry-mcp/module build into your Foundry world and enable the bridge. (The live
install + smoke test is the current in-progress step — see docs/PLAN.md Phase 3.)
Configuration
Copy .env.example to .env (gitignored) and fill in your instance:
- Non-secret, per-instance:
MOLTEN_SERVER_URL,MOLTEN_WORLD_ID,MOLTEN_WEBDAV_URL,MOLTEN_FILEBROWSER_URL. The committed defaults are neutralyour-server/your-worldplaceholders. - Secrets (never commit — env only):
MOLTEN_MAGIC_KEY(wake-server),MOLTEN_WEBDAV_PASSWORD(upload-asset),MOLTEN_ADMIN_KEY. Read them from your Molten panel → Server Details. Each tool reports which variable to set if its secret is missing.
Tools
38 tools total: 33 Foundry (Plane A) + 5 Molten (Plane B).
Plane A covers world introspection and editing — characters/actors, items & compendium search, journals/quests, scenes, combat/encounters, ownership, dice rolls, and 5e-specific helpers (e.g. NPC creation). Plane B adds:
| Tool | What it does |
|---|---|
wake-server |
GET the Magic URL (?s=<key>) to boot a slept server — the only allowed control automation |
sleep-watch |
Subscribe to Molten's shutdown-warning socket to learn when sleep is imminent |
keep-awake |
Generate light activity so the idle timer doesn't sleep the server mid-session |
upload-asset |
WebDAV PUT a file under Data/ (assets only; refuses live-world DB paths) |
asset-url |
Map a Data/-relative path to its public HTTPS URL (pure, no network) |
asset-urlis fully implemented; the other four Plane-B tools are stubs pending the live Molten integration (Phase 3) and return a clearly-labelled[STUB]response describing their endpoint and safety rules.
Credits & license
MIT, inherited from the upstream project. This is a fork of
adambdooley/foundry-vtt-mcp by Adam Dooley — the
WebRTC bridge architecture and the bulk of the Foundry tool surface are his work. The original
project README and docs are preserved under docs/upstream/. See
LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.