mcpField
D
DOS2 Game Master

DOS2 Game Master

Local
github.com/o-shabashovOther0Updated 1d ago

About DOS2 Game Master

DOS2 Game Master is an MCP server for preparing and running Game Master campaigns in Divinity: Original Sin 2 – Definitive Edition. It edits campaign files with backups and can control a running game through a bridge mod for Script Extender.

Key features

  1. 01Read and edit campaign content
  2. 02Create NPC and item templates
  3. 03Manage vignettes, notes, and journals
  4. 04Back up and restore campaigns
  5. 05Inspect live characters and spawn or move them
  6. 06Run Lua on the game server

Use cases

  1. 01Prepare campaign scenes and NPC templates
  2. 02Add map notes and journal entries
  3. 03Spawn or reposition characters during play
  4. 04Restore campaign files after edits

MCP support

Exposes campaign-file and live-game tools to MCP clients. Live control uses a bridge mod with Script Extender; the mod exchanges commands through files rather than network sockets.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository
Packages
mcpbdos2-gm-mcp.mcpb

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

dos2-gm-mcp

CI

English · Русский

An MCP server that lets an AI assistant prepare and run Game Master mode campaigns in Divinity: Original Sin 2 – Definitive Edition.

It works on two layers:

  • Campaign files. Reads and edits a GM campaign on disk: NPC and item templates, vignettes with your own art, map stickies, the journal, scene atmosphere, add-on mods. Every write makes a backup first.
  • Live game. Talks to the running game through a tiny bridge mod for Norbyte's Script Extender: list who is on the level, spawn an NPC from a template, move, rename, level up, hide and show, or run any Lua on the game server.

A village scene dressed and populated through the server

Overview map with GM stickiesTavern scene with traders and stashes
Overview mapTavern

What you can ask for

  • "Show me what is in the campaign My Campaign: scenes, templates, vignettes."
  • "Make an NPC template Old Greta, level 10, based on the witch archetype from the Larian sample campaign, with these three skills."
  • "Add a vignette with this picture and three vote options."
  • "Put a sticky on the overview map with the fight checklist."
  • "The game is running: spawn two fire imps next to the skipper and tell me everyone's health."

The GM campaigns shipped by Larian are readable too, so they work as a library of NPC templates to copy from.

Requirements

  • Windows, Divinity: Original Sin 2 – Definitive Edition (tested on Steam build 3.6.117.3735)
  • uv and Python 3.11+
  • .NET 8 runtime or newer (LSLib's Divine.exe needs it)
  • For the live layer only: Script Extender v58 or newer (tested on v60)

Install

git clone https://github.com/o-shabashov/dos2-gm-mcp
cd dos2-gm-mcp
uv sync
uv run dos2-gm-fetch-lslib

The last command downloads the official LSLib v1.20.4 release into ./lslib and checks its SHA-256. LSLib is Norbyte's work under the MIT license; this repository does not redistribute it.

Connect it to Claude Code:

claude mcp add dos2-gm --scope user -- uv --directory C:\path\to\dos2-gm-mcp run dos2-gm-mcp

Or to any other MCP client:

{
  "mcpServers": {
    "dos2-gm": {
      "command": "uv",
      "args": ["--directory", "C:\\path\\to\\dos2-gm-mcp", "run", "dos2-gm-mcp"]
    }
  }
}

For Claude Desktop there is also a one-file bundle: download dos2-gm-mcp.mcpb from the latest release, open it, then ask the assistant to call dos2_fetch_lslib once. The bundle keeps LSLib and backups in ~/.dos2-gm-mcp.

The game folder and Documents\Larian Studios\Divinity Original Sin 2 Definitive Edition are found automatically (Steam libraries, relocated Documents folders). Override with environment variables or a config.json in the project root:

VariableMeaning
DOS2GM_CAMPAIGNSthe GMCampaigns folder
DOS2GM_GAMEthe game folder
DOS2GM_DIVINEpath to Divine.exe
DOS2GM_BACKUPSwhere backups go (default ./backups)
DOS2GM_MODS, DOS2GM_OSIRIS_DATAthe Mods and Osiris Data folders in the game's documents
DOS2GM_HOMEwhere LSLib, backups, the cache and config.json live (default: the project root)

Tools

The campaign argument accepts a campaign name, its folder name, its UUID, or a part of any of them.

ReadReturns
dos2_statuspaths, whether the game is running, the list of campaigns
dos2_fetch_lslibone-time setup: downloads LSLib and checks its SHA-256 (same as uv run dos2-gm-fetch-lslib)
dos2_campaignmetadata and add-ons, scenes, maps with pins, vignettes, templates, stickies, journal
dos2_scenecharacters in a scene (name, template, position, health, alignment, encounter), encounters, stickies
dos2_templates, dos2_templateNPC and item templates, or one template in full
dos2_find_templatessearch templates across all campaigns by name, stats, skills, items
dos2_vignettes, dos2_notesvignettes and stickies in full
dos2_rawany campaign file as LSX, with an XPath filter
dos2_backupsbackups of a campaign
WriteDoes
dos2_put_npc_templateNPC template: copy a base from any campaign, set name, level, alignment, stat and ability changes, talents, skills, equipment
dos2_put_item_templateitem template
dos2_put_vignettevignette with your own image or a stock one, with vote answers
dos2_put_notesticky on the overview map; edits the text of a scene sticky
dos2_put_journaljournal categories, chapters and paragraphs
dos2_scene_settingsscene atmosphere and music
dos2_campaign_metacampaign name, description, author
dos2_addon, dos2_mod_installattach a ready-made .pak mod to a campaign, or build a mod folder into a .pak and attach it
dos2_delete_template, dos2_delete_vignette, dos2_delete_notedelete
dos2_backup, dos2_restorefull copy of a campaign, restore from any backup
Live (game running)Does
dos2_live_statuswhat is ready: game, Script Extender, the bridge .pak, attached campaigns, bridge heartbeat
dos2_bridge_install, dos2_bridge_detachbuild the bridge into Mods\DOS2GMBridge_….pak and attach it to a campaign as an add-on, or detach
dos2_live_characterswho is on the level: GUID, name, template, stats, level, health, alignment, position
dos2_live_spawnspawn a character from a root template or a GM template, at a point or next to someone
dos2_live_move, dos2_live_set, dos2_live_stageteleport; change name, level, alignment; take off stage and bring back
dos2_live_luarun Lua on the game server (Ext, Osi) and get the returned value

Safety

  • Writes go to a closed campaign: the game is closed or sits in the main menu. While the game process is running a write needs allow_running=true.
  • Before every write the previous files are copied to backups\<campaign folder>\<time>-<operation>. dos2_restore brings any of them back.
  • Placed NPCs and encounters live in the scene cache and are read-only here; you place them in the game, or through the live layer.
  • dos2_live_lua executes arbitrary Lua inside your game. Use it with an assistant you trust.

Live layer setup

  1. Install Script Extender: put its DXGI.dll next to EoCApp.exe in DefEd\bin.
  2. Ask the assistant to run dos2_bridge_install for your campaign (the game must be closed). It builds the bridge mod and adds it to the campaign's add-ons.
  3. Load the campaign in GM mode and call dos2_live_status.

The bridge is a server-side Lua mod (bridge/). On a tick it reads a command from Osiris Data/dos2gm-mcp, runs it and writes the answer; there are no sockets and nothing listens on the network. In multiplayer every player needs the same .pak and Script Extender, as with any DOS2 mod.

What we learned about GM mode

Notes for people building their own tools; all verified in the game.

  • NPC templates live in the campaign's Eggs.lsf as GMExportCharacter. The second Attribute node of a template holds the Game Master's changes as a delta over the base stats.
  • Equipment slots: 0 helmet, 1 chest, 2 legs, 3 weapon, 4 shield, 5 and 10 rings, 6 belt, 7 boots, 8 gloves, 9 amulet, 12 horns, 15+ backpack.
  • A map sticky has Type = 2, UI = map UUID, NoteUIX/Y in map pixels. A scene sticky has Type = 0 and hangs on an invisible marker item in LevelCache.
  • A mod's meta.lsx needs a Definitive Edition PublishVersion (for example 909321303). With 1.0.0.0 the game flags the mod as made for Classic Edition and refuses it.
  • "Play campaign" runs on a copy of the campaign; the prepared campaign stays untouched. Loading a GM savegame uses the mod list from the main menu, so tick your add-on mods there as well.
  • Any Osi.* call while a campaign or level is loading crashes Script Extender natively, even though Ext.Osiris.IsCallable() already says yes. Gate on game state Running, Paused or GameMasterPause.
  • During the Game Master pause, Osiris delays world actions (placing, teleporting) until the pause is lifted, and SetOnStage right after creating a character gets lost. The bridge marks such answers with applies_on_unpause.
  • CombatRoundStarted and CharacterVitalityChanged never fire in GM mode. Count rounds by turns, poll health.
  • Script Extender's console refuses commands during the Game Master pause; the file bridge keeps working.
  • Items accept CustomDisplayName, CustomDescription and CustomBookContent at runtime and the values reach the players.

Tests

uv run python tests/bridge_test.py                    # the real bridge Lua in Lua 5.3 against stubs
uv run python tests/mcp_probe.py                      # MCP handshake, tool list and one call over stdio
uv run python tests/check_mapping.py                  # scenes of all campaigns, read-only
uv run python tests/smoke_read.py "My Campaign"       # read-only
uv run python tests/write_test.py <temp folder>       # writes into copies of campaigns

Credits

  • LSLib and Script Extender by Norbyte make all of this possible.
  • Divinity: Original Sin 2 is a game by Larian Studios. This is an unofficial fan tool, not affiliated with or endorsed by Larian Studios. Screenshots show the game's own art.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.