pz-mcp-server

pz-mcp-server

MCP server for Project Zomboid mod development, offering tools to search the game's Java API, access vanilla game files, and scaffold/validate mod projects.

Category
访问服务器

README

pz-mcp-server

An MCP server for Project Zomboid mod development. It gives an AI assistant three things modders constantly need:

  1. The Java API the game exposes to Lua — searchable, from the unofficial PZ Javadocs (Build 42).
  2. The vanilla game files — the game's own Lua, its events, and its item/recipe scripts.
  3. Mod project tooling — scaffold, validate, and lint a mod against the real API.

Everything runs locally; nothing is fetched at runtime.

Setup

Requires Node 18+.

git clone https://github.com/Svi-ra/pz-mcp-server.git
git clone --branch pages https://codeberg.org/albion/PZ-JavaDocs.git pz-javadocs-pages
cd pz-mcp-server && npm install && npm run build

Clone the Javadoc next to the server, so the layout is:

somewhere/
  pz-mcp-server/
  pz-javadocs-pages/      <- the `pages` branch, ~10k html files

That is where the server looks by default; otherwise set PZ_JAVADOC_DIR. Refresh the docs later with git pull inside that checkout.

Register with Claude Code

claude mcp add pz --scope user -- node /absolute/path/to/pz-mcp-server/dist/index.js

Or copy .mcp.json.example to .mcp.json in your modding folder and fill in the paths.

Environment

Variable Default Purpose
PZ_JAVADOC_DIR ../pz-javadocs-pages, then ./javadocs Javadoc pages checkout
PZ_GAME_DIR common Steam locations Game install (the folder holding media/)
PZ_MODS_DIR %USERPROFILE%/Zomboid/mods Where mods live and get scaffolded
PZ_CACHE_DIR ./.cache Derived class-hierarchy index

Run pz_status to see what got resolved. The four game-file tools return a clear error until PZ_GAME_DIR points at an install; every other tool works without the game.

Tools

Java API

Tool What it does
pz_search_class Fuzzy class search; also matches CamelCase initials (IGC → IsoGameCharacter)
pz_get_class Signature, inheritance, fields, constructors, methods with javadoc. filter regex for big classes, include_inherited to pull in supertype methods
pz_search_member Find a method/field across all 3,965 classes — "which class has getModData()?"
pz_list_package Classes and sub-packages of a package
pz_get_hierarchy Supertypes, subtypes, and interface implementors

Vanilla game files (needs PZ_GAME_DIR)

Tool What it does
pz_search_lua Regex search of media/lua, with optional path glob and context lines
pz_read_lua Read a vanilla Lua file by line range (sandboxed to the install)
pz_list_events Event names the game fires, with the files that declare or handle them
pz_search_script Item/recipe/vehicle definitions from media/scripts, returned as whole blocks

Mod projects

Tool What it does
pz_scaffold_mod New mod skeleton: mod.info, client/server/shared Lua, a script file, a translation stub
pz_validate_mod mod.info keys, poster, media/lua placement, script module wrappers, brace balance, Translate folders
pz_lint_lua Flags :method() calls that exist on no Java class, engine globals that don't exist, and Events.X names the game never fires
pz_status Which data sources resolved

Notes

  • The scaffold defaults to the Build 42 layout (mods/<Mod>/42/mod.info + media/); pass layout: "b41" for the old flat layout, or version_dir: "common" for a build-agnostic mod.
  • pz_lint_lua is heuristic. It only reports names that appear nowhere — not in the Java API, not in the mod, not in vanilla Lua — so dynamically built names can still produce false positives. It caught getBodyDammage(), getCellz() and a made-up event in testing while staying silent on correct code.
  • The class hierarchy is parsed once from overview-tree.html and cached in .cache/.

Tests

npm run build
node test/smoke.mjs                    # every tool, over a real stdio session
node test/lint.mjs <mod-folder>        # validate + lint one mod
node test/gamefiles.mjs                # game-file tools (set PZ_GAME_DIR first)

Credits

The API data comes from albion's unofficial PZ Javadocs. This project only reads that checkout — it does not redistribute it.

Project Zomboid is a trademark of The Indie Stone. This is an unofficial, fan-made tool.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选