fvtt-mcp-molten5e

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.

Category
访问服务器

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.md for the roadmap and docs/HANDOFF.md for 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 to node.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 command at the full node.exe path if Node isn't on PATH.
  • The server loads its .env from 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 neutral your-server/your-world placeholders.
  • 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-url is 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选