Skip to content

Agentic modding with D2-MCP

Connect your AI assistant to D2-MCP so it looks things up in the file guides, the data tables, the reconstructed source and the decompiled binaries instead of guessing. Setup, end-to-end workflows and prompts to copy.

Updated 5 December 2026

Modding

D2-MCP is an open-source MCP server of Diablo II modding tools, for Legacy Diablo II (1.00 to 1.14d) and Resurrected. Connect it to your assistant and it can look up what a column in a data file does, what a row holds in each patch, where a function is defined in the game's reconstructed source, and what a patch's binary really does. Every result says which game version it's about.

There's a public server at https://mcp.diablo2.org with the data already loaded. It's free, needs no key or sign-in, and is read-only. It offers every tool except the mod check, archive, sprite and save tools. Those work on files on your own disk, and on a hosted server that would be the server's disk, not yours, so they're left out. Install D2-MCP locally to use them.

D2-MCP grew out of DarkWanderer, a Discord bot that answers questions in Diablo II modding communities.

Set it up

Claude

In Claude on the web, desktop or mobile, open Settings → Connectors → Add custom connector and paste:

https://mcp.diablo2.org

Claude Code

claude mcp add --transport http d2 https://mcp.diablo2.org

Other MCP clients

Add https://mcp.diablo2.org as a remote server using streamable HTTP.

Local install, for the file tools

The mod check, archive, sprite and save tools need D2-MCP running on your own machine. It needs Python 3.10 or later, and git on the PATH for the source code tools.

git clone https://github.com/diablo2org/D2-MCP.git
cd D2-MCP
python3 -m venv .venv
.venv/bin/pip install -e .

Then add it to Claude Code, pointing it at a folder for its data:

claude mcp add d2 --env D2MCP_DATA_DIR=/path/to/data -- /path/to/D2-MCP/.venv/bin/python -m d2mcp

If you already added the public server as d2, give the local one another name. Any MCP client works: the README has the JSON configuration for clients that use one.

A local server starts with no data. Import the vanilla tables of each version you work on from your own copy of the game: a folder of the .txt files from data/global/excel, a .zip of them, or an MPQ that holds them.

D2MCP_DATA_DIR=/path/to/data .venv/bin/python -m d2mcp.tables import 1.13c /path/to/patch_d2.mpq

The version is the name the tools will use, so you can import your own mod's tables under your mod's name too. The knowledge base is fetched from diablo2.org and the code repositories are cloned on first start, which takes a few minutes and about 500 MB.

Workflows

Each workflow below is a set of steps and prompts to paste. Your assistant decides which tools to call, but naming the version and the file helps it pick the right ones. The tools each step relies on are listed so you can check the assistant used them.

Understand a column or mechanic before you change it

  1. Ask what the column does, in your version. The assistant reads the file guide for every version with lookup_column, and searches the wider knowledge base with search_knowledge_base and read_article.
  2. Ask what the vanilla rows hold. read_game_data shows one row column by column, and search_game_data finds rows containing some text.
  3. If the guides are thin, ask how the game reads it. find_symbol, search_code and read_code search the reconstructed source.
I'm modding 1.13c. Use D2-MCP to explain what the "srvdofunc" column in Skills.txt
does. Quote the file guide, show me the value for Fire Bolt and Frozen Orb, and say
which version each answer is about.
In 1.10f, how does the game use the "MaxLvl" column of MonLvl.txt? Check the file
guide first, then find where D2MOO reads it. Cite the file and line for each claim.

Change a skill or item and see what else it touches

  1. Read the row as it stands, and compare it across patches with read_game_data.
  2. Find what changed between two patches with diff_tables, matched by row key. game_data_coverage says which versions and tables are loaded.
  3. Find other rows that refer to it with search_game_data, before you rename or remove anything.
  4. Make the change in your own files, then test it in game.
Compare the Whirlwind row in Skills.txt across every patch D2-MCP has loaded.
Which columns changed, and in which patch?
I want to rename the item code "rin" in my 1.13c mod. Search the 1.13c tables for
every row that refers to it and list them by file and row, so I know what to update.
Don't edit anything.
Diff UniqueItems.txt between 1.09d and 1.10. Summarise what changed for rings and
amulets, row by row.

Lint your mod and diff it against vanilla (local)

These tools need a local install, with the vanilla tables of the version your mod is built on imported.

  1. Ask for an overview of what your mod changes with mod_changes: one line per table that differs, or one table's changed, added and removed rows, cell by cell.
  2. Ask for problems with lint_tables: references to rows that don't exist, treasure class and cube recipe mistakes, duplicate keys, ragged rows, text in number columns, values too big for their column, engine limits, and misspelt or missing columns. Tell it which vanilla version the mod is built on.
  3. Fix the errors first. Errors are values the game can't use as written, warnings are probably unintended, notes are for information.
My mod's tables are in /path/to/mymod/data/global/excel and it's built on 1.13c.
Use mod_changes to list every table it changes from vanilla 1.13c, then show me the
row by row changes in CubeMain.txt.
Run lint_tables on /path/to/mymod/data/global/excel, like 1.13c. Group the findings
by file and explain each error, with the line number and column.

Drop odds and breakpoints after a change

The drop tools give exact odds from a table set's treasure classes, using 1.10 rules onward. On the public server they use the vanilla tables. To see your mod's numbers, import its tables locally under your mod's name and ask about that version.

  1. Ask what a monster or treasure class drops with drop_chances, by difficulty, players, party and magic find.
  2. Check a monster with monster_stats, affixes with item_affixes, and the chance to hit with hit_chance.
  3. For speed, ask for frame_breakpoints (FCR, FHR or FBR) or attack_speed (frames per attack and IAS breakpoints).
  4. For anything else, calculate runs odds, expected values and small simulations in a sandbox.
In 1.13c, what are the chances Hell Mephisto drops a Shako, at players 1 and 8,
with 0 and 300 magic find? Show the treasure class path.
I raised the FCR on my Sorceress gear. What are her FCR breakpoints in 1.13c, and
which one does 105% reach?
In my mod "mymod", which magic affixes can a ring roll at item level 85, and how
likely is each? Compare with vanilla 1.13c.

Trace a function through the binaries and reconstructions

  1. Find the function in the reconstructed source with find_symbol, then read it with read_code, which gives a permalink and the source's game version. Sources include D2MOO (1.10f) and Iblis Codex, a 1.14d reconstruction.
  2. Compare it with the real binary of your patch: decomp_search finds a string, constant or function name in one patch's binaries, and decomp_function returns one function's decompiled C by name or address.
  3. Find its counterpart in another patch with function_across_versions. It gives a confidence and the evidence, and declines rather than guesses, so many functions get no match. function_index_status says which versions are indexed.
  4. For differences between version branches of one source, use compare_versions. d2moo_pull_requests lists D2MOO's open pull requests and their diffs.
Find where D2MOO calculates crushing blow damage. Read the function, then find the
same logic in the 1.13c decompiled binaries and tell me whether they match. Give the
file, function name and address for each.
Decompile the 1.13c D2Game.dll function at address <address>. What does it do,
and what is its counterpart in 1.14d? Show the evidence and the confidence.

Resurrected strings and JSON

  1. Read a Resurrected JSON file (UI layout, item art map, strings) by key with read_d2r_json.
  2. Read the D2R Data Guide's page for a data file with read_d2r_guide. lookup_column covers the D2R Data Guide too.
  3. Locally, look up or search strings in .tbl files or an MPQ with read_strings, convert a string table to JSON and back with tbl_to_json and json_to_tbl, and check your string files with check_strings.
In Resurrected, find the strings entry for Harlequin Crest and show me every
language. Then read the D2R Data Guide page for uniqueitems and explain the columns
I need to add a new unique.
Check the string files in /path/to/mymod/data/local/lng/strings against the game's.
List placeholders that would crash, ids that collide, missing languages and broken
colour codes, and tell me the next free id.

check_strings checks for placeholders that would crash, ids that collide in their low 16 bits, missing languages and broken colour codes, and gives the next free id.

Inspect a save (local)

inspect_save reads a .d2s file and never writes it. For Legacy version 96 saves it reads the header and checksum, character, progress, mercenary, stats, class skills and every item. For Resurrected version 105 saves it reads all of that except the item records. It reads stat widths and item bases from an imported table set, so import the tables your mod uses first.

Inspect /path/to/save/Tester.d2s with my "mymod" tables. Is the checksum valid?
List the character's stats, skill points and every item with its sockets.

This is useful after changing ItemStatCost.txt or adding items: if a save doesn't read cleanly, that points at the change.

Good practice

  • Name the game version. Files and behaviour changed between patches. Ask the assistant to say which version each answer is about. Every D2-MCP result carries one.
  • Ask for citations. Have it name the file guide, the table and row, or the source file, function and address behind each claim. Check the ones that matter.
  • Verify in game. Test each change before asking for the next. Small steps make it obvious what broke.
  • Keep backups and use version control. Run git init in your mod folder before an assistant edits anything, and keep a clean copy of the original files to compare against.
  • Treat answers about undocumented behaviour as leads, not facts. Decompiled code and reconstructions show what the game does, but reading them is interpretation. Confirm the conclusion in game.

For the knowledge base without MCP, as plain markdown or a Claude Code skill, see modding with an AI assistant.