Skip to main content
Glama

Foundry MCP Server

A Windows-first Model Context Protocol server for Foundry Virtual Tabletop v14. It gives an MCP client a permissioned, multi-world view of Foundry through a local Windows host and a GM-authorized browser companion. Docker-hosted Foundry uses the same browser companion and Windows host; only the module-install path changes to the container's writable User Data bind mount.

What it can do

Area

MCP capabilities

Important boundary

Connections

Enumerate connected worlds and require an explicit connectionId when more than one world is eligible.

A successful empty list proves transport, not a live Foundry connection.

Objects

Discover document types and every runtime Actor/Item subtype; list, get, dry-run, create, and update root, embedded, or writable compendium documents; enumerate Scenes, RollTables, Playlists, Cards, Macros, and unknown system fields.

Foundry permissions and explicit host capability grants both apply; locked or non-writable packs fail closed.

Images/assets

Enumerate FilePicker sources, broad image formats, and image references; upload validated images; generate deterministic images or opt in to OpenAI Images; attach a destination-writable asset to a document.

Local files are denied until an absolute root is allowlisted. Remote imports are SSRF-filtered. There is no public delete tool.

Journal sessions

Start, append to, list, and read idempotent JournalEntry/JournalEntryPage-backed sessions with links and attribution.

Session mutations require separate grants.

Background intelligence

Capture permitted events, reconcile pre-existing world state, search/timeline/changed-since, build bounded context packs, and expose provenance/status.

Private-content capture defaults off; restricted Actor, Item, and Journal content is filtered by default.

MCP surface

27 tools, five enumerable foundry:// resources, and five bounded read-only prompts for campaign, recap, encounter, NPC, and change-review workflows.

Prompt text grants no mutation authority. See the generated-surface reference for exact schemas.

Related MCP server: FoundryMCP

Start here

Runtime shape

MCP client
  -> stdio adapter
  -> current-logon Windows named pipe
  -> local Windows host + SQLite intelligence store
  -> authenticated loopback ws:// bridge (or reviewed wss:// proxy)
  -> GM browser companion
  -> Foundry public APIs and FilePicker providers

The companion authenticates with a per-user DPAPI-protected pairing secret and an HMAC challenge. The host binds its browser bridge to loopback and checks the exact Foundry page Origin. Docker does not require the Docker socket and does not move desktop secrets into the container.

Build from source

Requirements are Windows 10/11, Node.js 22+, pnpm 9.15.0, and PowerShell 7 (Windows PowerShell 5.1 is also exercised for the setup scripts).

pnpm install --frozen-lockfile
pnpm build
pnpm typecheck
pnpm lint

The CLI package exposes the foundry-mcp executable when installed or linked. In a source checkout, create a session-local command after building:

$FoundryMcpCli = (Resolve-Path -LiteralPath .\packages\cli\dist\bin.js).Path
function foundry-mcp { & node $FoundryMcpCli @args }

Then create the loadable Foundry module directory and versioned ZIP:

foundry-mcp build-module --output .\release

The builder packages only module.json and the self-contained browser bundle. Continue with the Windows or Docker guide instead of copying package build directories into Foundry by hand.

Security and privacy defaults

  • Configuration precedence is built-in defaults < JSON config < environment < CLI flags.

  • The checked-in config example uses a stable loopback port, exact Origins, 30-day event retention, private-content capture off, and an empty localAssetRoots denylist.

  • Pairing and provider credentials are accepted outside command-line arguments and protected with current-user DPAPI on the Windows production path.

  • Mutations are denied until explicitly granted per connection, Foundry role, and capability; denials and committed outcomes are audit logged with secret redaction.

  • Deterministic image generation is local. OpenAI Images is optional, requires an explicit provider key and ai:network grant, and sends credentials only to the official HTTPS Images endpoint.

Development

pnpm test
pnpm test:e2e

Tests use fake Foundry globals, real local pipe/WebSocket transports where noted, and no redistributed Foundry code. A licensed Foundry desktop/container, real browser TLS route, external provider call, and cross-user Windows account test remain manual evidence boundaries; do not describe mock coverage as a live Foundry pass.

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

0Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    A
    maintenance
    Connects Claude Desktop to Foundry VTT for AI-powered campaign management, enabling natural language interaction with game data including quest creation, character management, compendium searches, and dice rolling. Provides 20 MCP tools for seamless integration between Claude and your tabletop RPG sessions.
    66
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables direct interaction with FoundryVTT virtual tabletop servers via native WebSocket protocol. Supports retrieving, creating, modifying, and deleting game documents like actors, items, scenes, and journal entries without requiring additional modules.
    12
    7
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    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.
    100
    MIT

View all related MCP servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jakemctigue/foundry-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server