Foundry API Bridge connects your Foundry VTT world to AI assistants and to a public REST API through foundry-mcp.com. Claude, ChatGPT, Codex, Cursor, VS Code, Gemini CLI, Windsurf, Cline or any client that speaks the Model Context Protocol can read your campaign and act in it: roll dice, run combat, write journals, move tokens, import from compendiums.
The module runs only in the Game Master's browser. It opens an outgoing WebSocket connection to the server, receives commands, executes them in Foundry with GM permissions and sends the results back. Nothing runs on players' clients, nothing listens for incoming connections on your machine, and your world data is not stored on the server: commands pass through and results go straight back.
WHAT THE ASSISTANT CAN DO (121 tools)
- World: world-info, roll-dice
- Actors (7): actor-list, actor-get, actor-filter, actor-create, actor-create-from-compendium, actor-update, actor-delete
- Actor inventory (7): item-list, item-create, item-create-from-compendium, item-update, item-delete, dnd5e-item-use, dnd5e-item-activate (Midi-QOL compatible)
- World items (5): world-item-filter, world-item-get, world-item-create, world-item-update, world-item-delete
- Folders (5): folder-list, folder-get, folder-create, folder-update, folder-delete
- Active effects (5): effect-list, effect-create, effect-update, effect-delete, effect-toggle-status
- D&D 5e rolls (6): dnd5e-roll-skill, dnd5e-roll-save, dnd5e-roll-ability, dnd5e-roll-attack, dnd5e-roll-damage, roll-perception
- Pathfinder 2e (14): pf2e-roll-skill, pf2e-roll-save, pf2e-roll-perception, pf2e-list-strikes, pf2e-roll-strike, pf2e-roll-strike-damage,
pf2e-cast-spell, pf2e-use-consumable, pf2e-post-item, pf2e-get-conditions, pf2e-set-condition, pf2e-increase-condition,pf2e-decrease-condition, pf2e-remove-condition - Chat (6): chat-send, chat-list, chat-update, chat-delete, chat-export, chat-clear
- Journals (12): journal-folder-list, journal-list, journal-search, journal-get, journal-create, journal-update, journal-delete, journal-show, journal-page-get, journal-page-create, journal-page-update, journal-page-delete
- Handouts (2): handout-template-list, handout-template-get
- Roll tables (7): roll-table-list, roll-table-get, roll-table-roll, roll-table-reset, roll-table-create, roll-table-update, roll-table-delete
- Scenes (4): scene-list, scene-get, scene-activate, scene-set-door-state
- Tokens (5): token-list, token-create, token-move, token-update, token-delete
- Combat (14): combat-get, combat-create, combat-start, combat-delete, combat-next-turn, combat-previous-turn, combat-set-turn, combat-add-combatant, combat-remove-combatant, combat-roll-initiative, combat-roll-all-initiative, combat-set-initiative, combat-set-combatant-defeated, combat-toggle-combatant-visibility
- Compendiums (11): compendium-list, compendium-browse, compendium-search, compendium-page-search, compendium-document-get, compendium-document-get-raw, uuid-resolve, dnd5e-compendium-filter-actors, dnd5e-compendium-filter-items, pf2e-compendium-filter-actors, pf2e-compendium-filter-items
- Game clock and UI (9): world-time-get, world-time-advance, world-time-set, game-pause, game-resume, game-pause-get, ui-notify, canvas-pan, canvas-ping
Code mode: Claude Code and Codex can also write a short TypeScript script against a typed foundry.* API and run it in a sandbox on the server, so bulk edits and multi-step tasks finish in one call. See foundry-mcp.com/code.
REST API: the same module serves the public REST API at api.foundry-mcp.com (documentation at api.foundry-mcp.com/docs) for bots, scripts and custom tools.
GAME SYSTEMS
The core tools are system-agnostic. Rolls, item use, conditions and compendium filters have dedicated versions for D&D 5e (dnd5e-*) and Pathfinder 2e (pf2e-*); each works only in a world running that system.
ACCESS AND TIERS
A Patreon account is enough to start. Access follows your membership: without one you get world info and dice rolls; a free member gets actors, inventory and world items, folders, active effects, actor rolls and chat; Adventurer adds journals and roll tables; Dungeon Master adds scenes and doors, tokens, combat, compendiums and imports, world time, pause and UI helpers. Locked tools stay visible to the assistant and answer with the tier that unlocks them. Membership changes reach the server automatically. Details: foundry-mcp.com.