pz-modding-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pz-modding-mcp check if IsoPlayer.getStats is a real Build 42 method"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pz-modding-mcp
An MCP server for Project Zomboid Build 42 modding. It lets an AI coding tool (Claude Code, Claude Desktop, OpenCode, or any MCP client) check PZ names against your installed game instead of guessing them.
AI models often invent PZ methods and events, or remember Build 41 names. This server reads projectzomboid.jar
and the game's media/ folder on your PC and answers with short YES/NO results and real signatures. Short answers
suit small local models (such as qwen3 through Ollama) as well as large ones.
Runs locally over stdio. No network access, no telemetry.
Read-only. It writes only to its own cache folder.
Ships no game files. The indexes are built on your PC from your own install, and rebuilt after a game update.
Tools
Tool | What it answers | Example |
| Is a class, method, field, event or global real? YES/NO with the signature |
|
| A class's public methods and fields, including its parents' |
|
| Items and recipes from the game's scripts, searchable |
|
| Where the game's own Lua (or scripts) uses some text, with file:line |
|
| One Lua function from your mod or from the game, not the whole file |
|
| Optional: decompiled Java for one method, made locally with CFR |
|
| Setup check: the PZ folder, the index state, what is on | |
| Rebuild the indexes by hand (they also rebuild by themselves) |
pz_check is the same checker as the pzcheck.py script in the pz-modding skill. The server runs it in-process
and keeps the jar loaded between calls.
Related MCP server: NarshaMCP
Requirements
Python 3.10 or newer.
Project Zomboid Build 42 installed. Tested with 42.22.2 on Windows.
For
pz_sourceonly: Java (PZ's ownjre64is used if found) and a CFR jar that you download yourself.
Install
git clone <this repository> pz-modding-mcp
cd pz-modding-mcp
python -m pip install .Check the setup without a client:
python -m pz_modding_mcp --checkIt prints the PZ folder it found, the index state, and which folders show_lua_function may read. The first tool
call builds the indexes (about 15 to 30 seconds). Later calls are fast.
Connect a client
The server starts with python -m pz_modding_mcp (or the pz-modding-mcp command after install). Use the Python
that has the package installed. Example configs are in config/.
Claude Code
claude mcp add pz-modding -e PZ_DIR="C:/Program Files (x86)/Steam/steamapps/common/ProjectZomboid" -- python -m pz_modding_mcpOr copy config/claude-code.mcp.json into your mod's folder as .mcp.json.
Claude Desktop: add the block from config/claude-desktop.json to claude_desktop_config.json.
OpenCode: add the mcp block from config/opencode.json to your opencode.json.
Start the client in your mod's folder, so that show_lua_function can read your mod's files.
Settings (environment variables)
Variable | Meaning | Default |
| the folder with | the usual Steam folders on Windows, Linux and macOS |
| where the indexes go |
|
| folders | the folder the server starts in |
| path to a CFR jar. | not set |
| Java to run CFR with | PZ's |
show_lua_function reads only files inside the workspace folders and the game's media folder.
What the indexes hold
api.txt: every public class, method and field underzombie.*in the jar (names and types only).items.json: everyitem,craftRecipe,evolvedrecipeandfixingblock inmedia/scripts, with file:line. Item fields come from the item block itself; nested blocks such ascomponent FluidContainerare not merged in.
They are rebuilt when the jar or the script files change.
Game files and decompiled code
This repository holds no Project Zomboid files, indexes or decompiled code. Do not add them.
pz_sourcedecompiles single classes on your PC, into the cache folder, so you can understand what a method does. Do not publish that output or copy it into a mod. Check The Indie Stone's terms before you use it.
Tests
python -m pip install ".[test]"
python -m pytest -qtests/test_offline.py needs no game. tests/test_stdio.py starts the server over stdio and calls two tools; it
is skipped when PZ is not found.
Known limits
Build 42 only. Build 41 jars may work for
pz_apiandpz_check, but this is not tested.pz_apifollows parent classes, not Java interfaces.pz_check methodcovers interfaces.pz_sourceneeds CFR. The bracket matching that cuts out one method is simple, and it may cut a method short when a string holds{or}.Linux and macOS paths are included but not tested.
Related
The pz-modding skill (a SKILL.md with reference pages and the same pzcheck.py) teaches a model the Build 42
rules: mod folders, Lua load order, multiplayer commands, sandbox options and translations. This server provides the
lookups. They work well together, and each works alone.
License
MIT. See LICENSE. Project Zomboid is a trademark of The Indie Stone. This project is not affiliated with them.
Available Tools
8 toolspz_apiA
Project Zomboid's Java API, from the installed game's jar: the public methods and fields Lua can call on PZ objects, with argument and return types. name = a class ("IsoPlayer": its members and its parents'), "Class.member" ("IsoPlayer.getStats", parents count too), or a member name alone ("getModData": every class that has it). Lua calls methods with a colon: player:getStats().
Inputs: name (required), max_hits. Returns: result
pz_checkA
Is a Project Zomboid name real? Answers YES or NO, with the real signature. query = a command and its names: "method IsoPlayer getStats", "field IsoPlayer x", "class ItemContainer" (also says if Lua can see it), "members IsoPlayer Stat", "find getModData", "event OnZombieDead", "global getPlayer", "lua ISTimedActionQueue.add", "grep sendClientCommand(", "script item Hammer". If it says NO, do not use that name.
Inputs: query (required). Returns: result
pz_itemsA
The game's items and recipes (from the installed game's media/scripts), searchable. Examples:
"Base.Axe" one item, all its fields
"ItemType=base:weapon sort=MaxDamage" weapons, highest damage first (= is an exact match)
"Tagsripclothing" items whose Tags contain that text ( means contains)
"poncho" items whose name or DisplayName contains it
"recipe RipClothing" one craftRecipe, evolvedrecipe or fixing block
Use it to see which items exist and their full names (Module.Name) before you use them in code.
Inputs: query (required), limit. Returns: result
pz_lua_searchA
Search the game's own files for text (plain text, not a regex) and get file:line plus the line. folder = "lua" (media/lua, default), "scripts" (media/scripts) or "all" (all of media). Use it to see how PZ itself uses a function or event; then show_lua_function to read one function.
Inputs: text (required), folder, max_hits. Returns: result
pz_rebuild_indexesA
Rebuild the Java API and item indexes from the installed game. Only needed after a PZ update if a tool seems out of date: the tools rebuild by themselves when the game files change.
Inputs: no named parameters. Returns: result
pz_sourceA
What a PZ Java method actually does: its decompiled code, made on your PC from your own game jar with CFR (off unless PZ_MCP_CFR is set). cls = "IsoPlayer" or "zombie.characters.IsoPlayer"; method = a name (all its overloads) or "" for the class outline. For understanding PZ only: never copy PZ code into a mod.
Inputs: cls (required), method. Returns: result
pz_statusA
Setup check: which PZ folder is used, whether the indexes are built, and whether pz_source is on. Call it first if another tool says something is missing.
Inputs: no named parameters. Returns: result
show_lua_functionA
Print ONE Lua function or table from a file, with line numbers, instead of reading a whole file. path = a file in your workspace (your mod) or in PZ's media folder, e.g. "media/lua/client/ISUI/ISInventoryPane.lua"; name = "ISInventoryPane:onMouseDown", "MyMod.onTick", "Recipe". A short path is searched for under the readable folders (see pz_status).
Inputs: name (required), path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct facet of the modding workflow (setup, index rebuild, name validation, Java API browse, Lua search, function reading, item/recipe lookup, decompiled source). The only soft overlap is between pz_check and pz_api/pz_source, since all three can report a signature — but the descriptions explicitly separate 'validate this name', 'browse the API', and 'read the decompiled body'.
Seven of eight tools use a pz_-prefixed snake_case convention (pz_api, pz_check, pz_items, pz_rebuild_indexes, pz_lua_search, pz_source, pz_status). The single outlier, show_lua_function, drops the prefix and leads with a verb, which is a minor but noticeable inconsistency.
Eight tools is tightly scoped for a knowledge/lookup server covering PZ's Java API, Lua sources, and item/recipe data. Every tool earns its place: no redundant entry points and no obvious padding.
The surface covers the full lookup lifecycle: setup verification, index rebuild, name validation, Java API and decompiled source, Lua text search plus targeted function reading, and item/recipe queries. Minor gaps exist around file/directory browsing (you must already know a path for show_lua_function) and any mod-editing or linting operation.
Maintenance
Related MCP Connectors
Scan AI agent skills, MCP server packages and MCP configs before you install them. Static analysis.
Savecraft serves real save game data and expert game knowledge to AI assistants.
FiveM dev tools: find resources, check compatibility, validate Lua and server.cfg, generate jobs
Audit your MCP servers for poisoned tools and leaked secrets, and check AI-generated code for flaws.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to develop Desynced mods by providing direct access to the game's Lua API reference, base-game source, live logs, and installed mods, plus live control via a debugger link for evaluating and reloading Lua in the running game.92MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI coding agents to inspect and work with Unreal Engine projects by parsing C++ symbols, Blueprints, and .uasset data over MCP, supporting tasks like symbol tracing, asset search, and code generation.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding tools to connect and authorize local game projects, then drive source edits, validation, preview, version saving, and mode-based creation workflows.Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to query the actual AOSP and AndroidX source code locally, searching classes, extracting method bodies and Javadoc, listing class members, resolving inheritance hierarchies, and (via optional LSP) finding cross-file definitions and references. This gives precise, offline access to framework internals like the Activity lifecycle or Compose internals instead of relying on outdated training data.-