rpgmaker-mz-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +425 -0
- package/dist/events/commandBuilders.d.ts +405 -0
- package/dist/events/commandBuilders.d.ts.map +1 -0
- package/dist/events/commandBuilders.js +554 -0
- package/dist/events/commandBuilders.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +81 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +49 -0
- package/dist/registry.js.map +1 -0
- package/dist/tiles/autotile.d.ts +65 -0
- package/dist/tiles/autotile.d.ts.map +1 -0
- package/dist/tiles/autotile.js +201 -0
- package/dist/tiles/autotile.js.map +1 -0
- package/dist/tiles/catalog/dungeon.d.ts +16 -0
- package/dist/tiles/catalog/dungeon.d.ts.map +1 -0
- package/dist/tiles/catalog/dungeon.js +765 -0
- package/dist/tiles/catalog/dungeon.js.map +1 -0
- package/dist/tiles/catalog/index.d.ts +78 -0
- package/dist/tiles/catalog/index.d.ts.map +1 -0
- package/dist/tiles/catalog/index.js +115 -0
- package/dist/tiles/catalog/index.js.map +1 -0
- package/dist/tiles/catalog/inside.d.ts +16 -0
- package/dist/tiles/catalog/inside.d.ts.map +1 -0
- package/dist/tiles/catalog/inside.js +765 -0
- package/dist/tiles/catalog/inside.js.map +1 -0
- package/dist/tiles/catalog/outside.d.ts +16 -0
- package/dist/tiles/catalog/outside.d.ts.map +1 -0
- package/dist/tiles/catalog/outside.js +799 -0
- package/dist/tiles/catalog/outside.js.map +1 -0
- package/dist/tiles/catalog/overworld.d.ts +16 -0
- package/dist/tiles/catalog/overworld.d.ts.map +1 -0
- package/dist/tiles/catalog/overworld.js +585 -0
- package/dist/tiles/catalog/overworld.js.map +1 -0
- package/dist/tiles/catalog/sf.d.ts +16 -0
- package/dist/tiles/catalog/sf.d.ts.map +1 -0
- package/dist/tiles/catalog/sf.js +1313 -0
- package/dist/tiles/catalog/sf.js.map +1 -0
- package/dist/tiles/paint.d.ts +20 -0
- package/dist/tiles/paint.d.ts.map +1 -0
- package/dist/tiles/paint.js +65 -0
- package/dist/tiles/paint.js.map +1 -0
- package/dist/tiles/png.d.ts +11 -0
- package/dist/tiles/png.d.ts.map +1 -0
- package/dist/tiles/png.js +180 -0
- package/dist/tiles/png.js.map +1 -0
- package/dist/tiles/tileCodec.d.ts +95 -0
- package/dist/tiles/tileCodec.d.ts.map +1 -0
- package/dist/tiles/tileCodec.js +186 -0
- package/dist/tiles/tileCodec.js.map +1 -0
- package/dist/tiles/tileFlags.d.ts +98 -0
- package/dist/tiles/tileFlags.d.ts.map +1 -0
- package/dist/tiles/tileFlags.js +129 -0
- package/dist/tiles/tileFlags.js.map +1 -0
- package/dist/tiles/tilegeom.d.ts +29 -0
- package/dist/tiles/tilegeom.d.ts.map +1 -0
- package/dist/tiles/tilegeom.js +111 -0
- package/dist/tiles/tilegeom.js.map +1 -0
- package/dist/tiles/transparency.d.ts +22 -0
- package/dist/tiles/transparency.d.ts.map +1 -0
- package/dist/tiles/transparency.js +59 -0
- package/dist/tiles/transparency.js.map +1 -0
- package/dist/tools/actorTools.d.ts +48 -0
- package/dist/tools/actorTools.d.ts.map +1 -0
- package/dist/tools/actorTools.js +154 -0
- package/dist/tools/actorTools.js.map +1 -0
- package/dist/tools/allTools.d.ts +8 -0
- package/dist/tools/allTools.d.ts.map +1 -0
- package/dist/tools/allTools.js +56 -0
- package/dist/tools/allTools.js.map +1 -0
- package/dist/tools/assetTools.d.ts +113 -0
- package/dist/tools/assetTools.d.ts.map +1 -0
- package/dist/tools/assetTools.js +97 -0
- package/dist/tools/assetTools.js.map +1 -0
- package/dist/tools/batchTools.d.ts +3 -0
- package/dist/tools/batchTools.d.ts.map +1 -0
- package/dist/tools/batchTools.js +138 -0
- package/dist/tools/batchTools.js.map +1 -0
- package/dist/tools/battleTools.d.ts +72 -0
- package/dist/tools/battleTools.d.ts.map +1 -0
- package/dist/tools/battleTools.js +322 -0
- package/dist/tools/battleTools.js.map +1 -0
- package/dist/tools/catalogTools.d.ts +3 -0
- package/dist/tools/catalogTools.d.ts.map +1 -0
- package/dist/tools/catalogTools.js +134 -0
- package/dist/tools/catalogTools.js.map +1 -0
- package/dist/tools/classTools.d.ts +85 -0
- package/dist/tools/classTools.d.ts.map +1 -0
- package/dist/tools/classTools.js +279 -0
- package/dist/tools/classTools.js.map +1 -0
- package/dist/tools/commonEventTools.d.ts +32 -0
- package/dist/tools/commonEventTools.d.ts.map +1 -0
- package/dist/tools/commonEventTools.js +150 -0
- package/dist/tools/commonEventTools.js.map +1 -0
- package/dist/tools/eventCommandTools.d.ts +37 -0
- package/dist/tools/eventCommandTools.d.ts.map +1 -0
- package/dist/tools/eventCommandTools.js +893 -0
- package/dist/tools/eventCommandTools.js.map +1 -0
- package/dist/tools/eventPageTools.d.ts +112 -0
- package/dist/tools/eventPageTools.d.ts.map +1 -0
- package/dist/tools/eventPageTools.js +597 -0
- package/dist/tools/eventPageTools.js.map +1 -0
- package/dist/tools/itemTools.d.ts +82 -0
- package/dist/tools/itemTools.d.ts.map +1 -0
- package/dist/tools/itemTools.js +380 -0
- package/dist/tools/itemTools.js.map +1 -0
- package/dist/tools/listTools.d.ts +58 -0
- package/dist/tools/listTools.d.ts.map +1 -0
- package/dist/tools/listTools.js +99 -0
- package/dist/tools/listTools.js.map +1 -0
- package/dist/tools/mapTools.d.ts +270 -0
- package/dist/tools/mapTools.d.ts.map +1 -0
- package/dist/tools/mapTools.js +1066 -0
- package/dist/tools/mapTools.js.map +1 -0
- package/dist/tools/moveTools.d.ts +43 -0
- package/dist/tools/moveTools.d.ts.map +1 -0
- package/dist/tools/moveTools.js +240 -0
- package/dist/tools/moveTools.js.map +1 -0
- package/dist/tools/objectTools.d.ts +12 -0
- package/dist/tools/objectTools.d.ts.map +1 -0
- package/dist/tools/objectTools.js +221 -0
- package/dist/tools/objectTools.js.map +1 -0
- package/dist/tools/paintTools.d.ts +3 -0
- package/dist/tools/paintTools.d.ts.map +1 -0
- package/dist/tools/paintTools.js +134 -0
- package/dist/tools/paintTools.js.map +1 -0
- package/dist/tools/pluginScanTools.d.ts +22 -0
- package/dist/tools/pluginScanTools.d.ts.map +1 -0
- package/dist/tools/pluginScanTools.js +119 -0
- package/dist/tools/pluginScanTools.js.map +1 -0
- package/dist/tools/pluginTools.d.ts +11 -0
- package/dist/tools/pluginTools.d.ts.map +1 -0
- package/dist/tools/pluginTools.js +63 -0
- package/dist/tools/pluginTools.js.map +1 -0
- package/dist/tools/projectTools.d.ts +11 -0
- package/dist/tools/projectTools.d.ts.map +1 -0
- package/dist/tools/projectTools.js +74 -0
- package/dist/tools/projectTools.js.map +1 -0
- package/dist/tools/skillTools.d.ts +83 -0
- package/dist/tools/skillTools.d.ts.map +1 -0
- package/dist/tools/skillTools.js +369 -0
- package/dist/tools/skillTools.js.map +1 -0
- package/dist/tools/stateTools.d.ts +28 -0
- package/dist/tools/stateTools.d.ts.map +1 -0
- package/dist/tools/stateTools.js +161 -0
- package/dist/tools/stateTools.js.map +1 -0
- package/dist/tools/systemTools.d.ts +86 -0
- package/dist/tools/systemTools.d.ts.map +1 -0
- package/dist/tools/systemTools.js +342 -0
- package/dist/tools/systemTools.js.map +1 -0
- package/dist/tools/tileTools.d.ts +9 -0
- package/dist/tools/tileTools.d.ts.map +1 -0
- package/dist/tools/tileTools.js +34 -0
- package/dist/tools/tileTools.js.map +1 -0
- package/dist/tools/tileTransparency.d.ts +40 -0
- package/dist/tools/tileTransparency.d.ts.map +1 -0
- package/dist/tools/tileTransparency.js +156 -0
- package/dist/tools/tileTransparency.js.map +1 -0
- package/dist/tools/tilesetTools.d.ts +23 -0
- package/dist/tools/tilesetTools.d.ts.map +1 -0
- package/dist/tools/tilesetTools.js +209 -0
- package/dist/tools/tilesetTools.js.map +1 -0
- package/dist/tools/validationTools.d.ts +50 -0
- package/dist/tools/validationTools.d.ts.map +1 -0
- package/dist/tools/validationTools.js +229 -0
- package/dist/tools/validationTools.js.map +1 -0
- package/dist/utils/commit.d.ts +62 -0
- package/dist/utils/commit.d.ts.map +1 -0
- package/dist/utils/commit.js +119 -0
- package/dist/utils/commit.js.map +1 -0
- package/dist/utils/fileHandler.d.ts +49 -0
- package/dist/utils/fileHandler.d.ts.map +1 -0
- package/dist/utils/fileHandler.js +137 -0
- package/dist/utils/fileHandler.js.map +1 -0
- package/dist/utils/records.d.ts +8 -0
- package/dist/utils/records.d.ts.map +1 -0
- package/dist/utils/records.js +10 -0
- package/dist/utils/records.js.map +1 -0
- package/dist/utils/types.d.ts +465 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +5 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/validation/assets.d.ts +53 -0
- package/dist/validation/assets.d.ts.map +1 -0
- package/dist/validation/assets.js +198 -0
- package/dist/validation/assets.js.map +1 -0
- package/dist/validation/createRefs.d.ts +37 -0
- package/dist/validation/createRefs.d.ts.map +1 -0
- package/dist/validation/createRefs.js +89 -0
- package/dist/validation/createRefs.js.map +1 -0
- package/dist/validation/eventCommands.d.ts +70 -0
- package/dist/validation/eventCommands.d.ts.map +1 -0
- package/dist/validation/eventCommands.js +273 -0
- package/dist/validation/eventCommands.js.map +1 -0
- package/dist/validation/gate.d.ts +56 -0
- package/dist/validation/gate.d.ts.map +1 -0
- package/dist/validation/gate.js +50 -0
- package/dist/validation/gate.js.map +1 -0
- package/dist/validation/moveCommands.d.ts +31 -0
- package/dist/validation/moveCommands.d.ts.map +1 -0
- package/dist/validation/moveCommands.js +123 -0
- package/dist/validation/moveCommands.js.map +1 -0
- package/dist/validation/pluginCommands.d.ts +83 -0
- package/dist/validation/pluginCommands.d.ts.map +1 -0
- package/dist/validation/pluginCommands.js +134 -0
- package/dist/validation/pluginCommands.js.map +1 -0
- package/dist/validation/pluginManifest.d.ts +67 -0
- package/dist/validation/pluginManifest.d.ts.map +1 -0
- package/dist/validation/pluginManifest.js +199 -0
- package/dist/validation/pluginManifest.js.map +1 -0
- package/dist/validation/references.d.ts +57 -0
- package/dist/validation/references.d.ts.map +1 -0
- package/dist/validation/references.js +314 -0
- package/dist/validation/references.js.map +1 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mikolaj Zyzanski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/banner.svg" alt="RPG Maker MZ MCP Server" width="100%" />
|
|
4
|
+
|
|
5
|
+
# RPG Maker MZ MCP Server
|
|
6
|
+
|
|
7
|
+
[](https://github.com/Redseb/rpgmaker-mz-mcp/actions/workflows/ci.yml)
|
|
8
|
+
[](#available-tools)
|
|
9
|
+
[](https://modelcontextprotocol.io/)
|
|
10
|
+
[](tsconfig.json)
|
|
11
|
+
[](package.json)
|
|
12
|
+
[](#license)
|
|
13
|
+
|
|
14
|
+
**113 tools** that let an AI assistant read and write an RPG Maker MZ project directly — actors, classes, skills, items, equipment, states, enemies, troops, common events, maps, tiles, tilesets, events, and system settings — instead of hand-editing everything in the editor.
|
|
15
|
+
|
|
16
|
+
_"Add a town under the world map, paint it with grass, and drop in a shopkeeper who sells potions"_ → done, in-project, no editor clicks.
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
**Claude Code (recommended)** — installs the server *and* the authoring skills as one plugin:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
claude plugin marketplace add Redseb/rpgmaker-mz-mcp
|
|
26
|
+
claude plugin install rpgmaker-mz@rpgmaker-mz-mcp
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You'll be prompted for your RPG Maker MZ project directory (optional — you can also just ask Claude to `set_project` later).
|
|
30
|
+
|
|
31
|
+
**Any other MCP client** — the server is on npm; no clone or build needed:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"rpgmaker-mz": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "rpgmaker-mz-mcp@latest"],
|
|
39
|
+
"env": { "RPGMAKER_PROJECT_PATH": "/path/to/your/rpgmaker/project" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Claude Desktop** — either the JSON config above, or download the one-click `rpgmaker-mz-mcp.mcpb` bundle from [Releases](https://github.com/Redseb/rpgmaker-mz-mcp/releases) and open it with Claude Desktop.
|
|
46
|
+
|
|
47
|
+
New here? Read [SETUP.md](SETUP.md) for the full walkthrough and [EXAMPLES.md](EXAMPLES.md) for end-to-end recipes.
|
|
48
|
+
|
|
49
|
+
## Contents
|
|
50
|
+
|
|
51
|
+
- [Quick start](#quick-start)
|
|
52
|
+
- [Capabilities](#capabilities)
|
|
53
|
+
- [How it fits together](#how-it-fits-together)
|
|
54
|
+
- [Installation](#installation)
|
|
55
|
+
- [Configuration](#configuration)
|
|
56
|
+
- [Usage](#usage)
|
|
57
|
+
- [Available tools](#available-tools)
|
|
58
|
+
- [Input validation](#input-validation)
|
|
59
|
+
- [Event validation (throw-by-default)](#event-validation-throw-by-default)
|
|
60
|
+
- [Reference linting](#reference-linting)
|
|
61
|
+
- [Dry-run preview](#dry-run-preview)
|
|
62
|
+
- [Custom-tileset catalog skill](#custom-tileset-catalog-skill)
|
|
63
|
+
- [Example prompts](#example-prompts)
|
|
64
|
+
- [Development](#development)
|
|
65
|
+
- [Project structure](#project-structure)
|
|
66
|
+
- [Safety and best practices](#safety-and-best-practices)
|
|
67
|
+
- [Limitations](#limitations)
|
|
68
|
+
|
|
69
|
+
## Capabilities
|
|
70
|
+
|
|
71
|
+
- **Database CRUD** — actors, classes (with learnings & param curves), skills (full-control + simplified damage/heal/buff/state helpers), items, weapons, armors, states, enemies, and troops. Only a `name` is required to create; everything else falls back to the editor's true "New X" template.
|
|
72
|
+
- **Maps & the map tree** — create/delete maps, batch-reparent/reorder/rename with a cycle guard, and edit map properties. New maps register in `MapInfos.json` exactly as the editor expects.
|
|
73
|
+
- **Tile painting (with automatic autotiling)** — `paint_tiles`/`fill_area` set tiles on any of the six map layers and recompute autotile shapes (and their neighbours') from same-kind adjacency, so a filled region borders itself correctly. `place_object` stamps multi-tile B/C objects (houses, trees) and reports their passability footprint.
|
|
74
|
+
- **Semantic tile catalog** — `find_tile "grass"` → a paintable tile id. Built-in catalogs for every default tileset (Overworld, Outside, Inside, Dungeon, SF), sourced from RPG Maker's own English name sidecars. A bundled vision-bootstrap skill catalogs **custom** tilesets.
|
|
75
|
+
- **Passability & terrain** — read a tile's flags or a map cell's layered passability (`get_tile_flags`/`check_passability`), and **edit** passability/terrain-tag/behaviour flags (`set_tile_flags`).
|
|
76
|
+
- **Event-command builders** — high-level, read-only builders that emit the exact `EventCommand` sequences the editor writes (including tricky recursive branch blocks and continuation rows), landed on a page via `insert_event_commands`. Covers dialogue & flow, game-state changes, presentation/transitions, and scene processing.
|
|
77
|
+
- **Event & NPC ergonomics** — `create_npc` places a complete talking NPC in one call; `set_event_page` merges a page's graphic + behavior in place.
|
|
78
|
+
- **Asset awareness** — `list_assets` enumerates valid character/face/tileset/audio names so events never reference a missing file.
|
|
79
|
+
- **Correctness layer** — Zod-validated inputs, throw-by-default event validation (a structurally invalid write is refused, not saved-and-warned-about), a cross-file reference linter (`validate_references`), and a dry-run/diff preview on every write.
|
|
80
|
+
|
|
81
|
+
## How it fits together
|
|
82
|
+
|
|
83
|
+
<div align="center">
|
|
84
|
+
<img src="assets/architecture.svg" alt="AI assistant talks to the MCP server over stdio, which reads and writes the RPG Maker MZ project's data files" width="100%" />
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
Pick one:
|
|
90
|
+
|
|
91
|
+
- **Claude Code plugin** *(recommended)* — `claude plugin marketplace add Redseb/rpgmaker-mz-mcp`, then `claude plugin install rpgmaker-mz@rpgmaker-mz-mcp`. This bundles the MCP server (run via npx from the npm package) together with the two authoring skills (`rpgmaker-authoring`, `tileset-catalog`) — the skills carry the judgment the tools don't enforce, so this is the full experience.
|
|
92
|
+
- **npm package** — configure your MCP client to run `npx -y rpgmaker-mz-mcp@latest` (see [Quick start](#quick-start)). Tools only, no skills.
|
|
93
|
+
- **MCPB bundle (Claude Desktop)** — download `rpgmaker-mz-mcp.mcpb` from [Releases](https://github.com/Redseb/rpgmaker-mz-mcp/releases), open it with Claude Desktop, and pick your project folder in the install dialog.
|
|
94
|
+
- **From source** (development):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install
|
|
98
|
+
npm run build
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Configuration
|
|
102
|
+
|
|
103
|
+
Set the RPG Maker MZ project path as an environment variable:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# macOS/Linux
|
|
107
|
+
export RPGMAKER_PROJECT_PATH=/path/to/your/rpgmaker/project
|
|
108
|
+
|
|
109
|
+
# Windows
|
|
110
|
+
set RPGMAKER_PROJECT_PATH=C:\path\to\your\rpgmaker\project
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The path must point to a directory containing `game.rmmzproject` and a `data/` directory with `System.json`.
|
|
114
|
+
|
|
115
|
+
The environment variable is only the startup default: the `set_project` tool can retarget a running server at a different project (and `get_project` reports the current one), so switching games doesn't require editing config or restarting.
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
### Running the server
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm start # or: node dist/index.js
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Configuring in Claude Desktop
|
|
126
|
+
|
|
127
|
+
The easiest path is the `.mcpb` bundle from [Releases](https://github.com/Redseb/rpgmaker-mz-mcp/releases) — open it with Claude Desktop and pick your project folder. To configure by hand instead, add to your Claude Desktop configuration file (`%APPDATA%\Claude\claude_desktop_config.json` on Windows, `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"mcpServers": {
|
|
132
|
+
"rpgmaker-mz": {
|
|
133
|
+
"command": "npx",
|
|
134
|
+
"args": ["-y", "rpgmaker-mz-mcp@latest"],
|
|
135
|
+
"env": {
|
|
136
|
+
"RPGMAKER_PROJECT_PATH": "/path/to/your/rpgmaker/project"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
(For a from-source checkout, use `"command": "node"` with `"args": ["/path/to/rpgmaker-mz-mcp/dist/index.js"]` instead.)
|
|
144
|
+
|
|
145
|
+
## Available tools
|
|
146
|
+
|
|
147
|
+
All 113 tools, grouped by area. Tools that write to the project accept an optional `dryRun` argument (see [Dry-run preview](#dry-run-preview)); those that can refuse a structurally invalid write also accept `force` (see [Event validation](#event-validation-throw-by-default)).
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary><strong>Expand the full tool reference</strong></summary>
|
|
151
|
+
|
|
152
|
+
### Project targeting
|
|
153
|
+
|
|
154
|
+
- `get_project` — the project the server is operating on: path, validity, game title
|
|
155
|
+
- `set_project` — retarget the server at another project directory for the rest of the session (no restart; overrides `RPGMAKER_PROJECT_PATH`)
|
|
156
|
+
|
|
157
|
+
### Actors
|
|
158
|
+
|
|
159
|
+
- `create_actor`, `update_actor`, `search_actors`
|
|
160
|
+
|
|
161
|
+
### Classes
|
|
162
|
+
|
|
163
|
+
- `create_class`, `update_class`
|
|
164
|
+
- `add_class_learning` — attach a skill learned at a level (validates the skill, keeps learnings level-sorted)
|
|
165
|
+
- `set_class_param_curve` — replace one of the 8 parameter growth rows
|
|
166
|
+
|
|
167
|
+
### Skills
|
|
168
|
+
|
|
169
|
+
- `create_skill` (full control), `update_skill`, `search_skills`
|
|
170
|
+
- `create_damage_skill`, `create_healing_skill`, `create_buff_skill`, `create_state_skill` — natural-language-friendly helpers for common skill types
|
|
171
|
+
|
|
172
|
+
### Items & equipment
|
|
173
|
+
|
|
174
|
+
- `create_item`, `update_item`, `search_items`
|
|
175
|
+
- `create_weapon`, `update_weapon`
|
|
176
|
+
- `create_armor`, `update_armor`
|
|
177
|
+
|
|
178
|
+
### States
|
|
179
|
+
|
|
180
|
+
- `create_state`, `update_state`
|
|
181
|
+
|
|
182
|
+
### Enemies & troops
|
|
183
|
+
|
|
184
|
+
- `create_enemy`, `update_enemy`
|
|
185
|
+
- `create_troop`, `update_troop` — `create_troop` validates that every member references an existing enemy
|
|
186
|
+
|
|
187
|
+
### Common events
|
|
188
|
+
|
|
189
|
+
- `create_common_event`, `update_common_event`
|
|
190
|
+
- `call_common_event` — builds the code-117 call command and validates the target exists
|
|
191
|
+
|
|
192
|
+
### Maps & the map tree
|
|
193
|
+
|
|
194
|
+
- `get_map` (pass `includeData: false` to omit the tile array on a big map), `get_map_infos`, `get_map_dimensions`, `update_map`
|
|
195
|
+
- `get_map_region` — read a window of tile ids (x, y, width, height, layer) instead of the whole map
|
|
196
|
+
- `create_map` — allocates the next id, writes a blank map, and registers it in the tree
|
|
197
|
+
- `delete_map` — removes a map and reparents its children onto its parent
|
|
198
|
+
- `update_map_tree` — batch reparent/reorder/rename/expand with an up-front existence check and cycle guard
|
|
199
|
+
|
|
200
|
+
### Map events
|
|
201
|
+
|
|
202
|
+
- `get_map_events`, `get_map_event`, `search_map_events`
|
|
203
|
+
- `create_map_event`, `update_map_event`, `delete_map_event`
|
|
204
|
+
- `add_event_command` — append a single command to an event page
|
|
205
|
+
- `set_map_tile` — set a single raw tile id at (x, y) on a z-layer (no autotiling)
|
|
206
|
+
|
|
207
|
+
### Event & NPC ergonomics
|
|
208
|
+
|
|
209
|
+
- `create_npc` — one-shot "talking NPC": graphic + trigger + a talk list from `text` or explicit `commands`
|
|
210
|
+
- `create_chest` — one-shot treasure chest: the two-page self-switch idiom (give item/weapon/armor/gold, then never again)
|
|
211
|
+
- `create_transfer` — one-shot map transfer, in either working idiom: face a solid landmark (`action_button`) or step on a doormat (`player_touch`)
|
|
212
|
+
- `set_event_page` — merge a page's graphic + behavior (sprite, trigger, priority, movement, flags) in place
|
|
213
|
+
|
|
214
|
+
### Event-command builders
|
|
215
|
+
|
|
216
|
+
Read-only builders that return editor-faithful `EventCommand` sequences; land them on a command list with `insert_event_commands`.
|
|
217
|
+
|
|
218
|
+
- **Dialogue & flow:** `build_show_text` (101/401), `build_show_choices` (102/402–404), `build_conditional_branch` (111/411/412), `build_flow_command` (wait/exit/label/jump)
|
|
219
|
+
- **Game state:** `build_control_switch` (121/123), `build_control_variable` (122), `build_change_gold` (125), `build_change_items` (126–128), `build_change_party_member` (129)
|
|
220
|
+
- **Presentation & transitions:** `build_transfer_player` (201), `build_play_audio` (BGM/BGS/ME/SE), `build_screen_effect` (fade/tint/flash/shake), `build_picture` (show/erase), `build_character_effect` (animation/balloon)
|
|
221
|
+
- **Scenes:** `build_battle_processing` (301), `build_shop_processing` (302/605), `build_name_input` (303), `build_change_actor` (HP/MP/state/recover/EXP/level, 311–316)
|
|
222
|
+
- **Insertion:** `insert_event_commands` — splice a built sequence into a map event page (the default `target`), a common event body, or a troop battle-event page, then validate
|
|
223
|
+
|
|
224
|
+
### Move routes
|
|
225
|
+
|
|
226
|
+
- `create_move_route` — build a `MoveRoute` from a named pattern (patrol/approach/flee/wander/custom)
|
|
227
|
+
- `set_movement_route` — insert a forced Set Movement Route (code 205 + 505 continuation rows)
|
|
228
|
+
|
|
229
|
+
### Plugin commands
|
|
230
|
+
|
|
231
|
+
- `scan_plugins` — discover the plugin commands this project actually has, by parsing `js/plugins/*.js` annotations (+ enabled state from `js/plugins.js`)
|
|
232
|
+
- `list_plugin_commands` — view the known plugin commands (the project scan merged over a built-in allowlist)
|
|
233
|
+
- `create_plugin_command` — build a code-357 plugin command with normalized args
|
|
234
|
+
|
|
235
|
+
### Tiles, catalog & painting
|
|
236
|
+
|
|
237
|
+
- `describe_tile` — decode a raw tile id (sheet, autotile kind/shape, geometry)
|
|
238
|
+
- `get_tile_catalog`, `find_tile` — resolve human names ↔ paintable tile ids
|
|
239
|
+
- `paint_tiles`, `fill_area` — paint with automatic autotiling
|
|
240
|
+
- `place_object` — stamp a multi-tile B/C object and report its passability footprint
|
|
241
|
+
|
|
242
|
+
### Tileset flags (passability / terrain)
|
|
243
|
+
|
|
244
|
+
- `get_tile_flags` — decode a tile's passability/star/ladder/bush/counter/damage/terrain-tag
|
|
245
|
+
- `check_passability` — the map-aware, layered answer for a cell
|
|
246
|
+
- `set_tile_flags` — **edit** a tile's flags (non-destructive merge; auto-applies to all 48 shape slots of an autotile kind)
|
|
247
|
+
|
|
248
|
+
### Assets
|
|
249
|
+
|
|
250
|
+
- `list_assets` — enumerate available asset basenames (characters, faces, tilesets, pictures, audio, …)
|
|
251
|
+
|
|
252
|
+
### System & vocabulary
|
|
253
|
+
|
|
254
|
+
- `get_system`, `get_game_title`, `update_game_title`
|
|
255
|
+
- `get_variables`, `set_variable_name`, `get_switches`, `set_switch_name`
|
|
256
|
+
- `get_starting_position`, `update_starting_position`
|
|
257
|
+
- `get_party`, `set_party` — the starting party (`set_party` validates every actor id)
|
|
258
|
+
- `get_terms`, `set_term` — menu vocabulary
|
|
259
|
+
- `get_types`, `set_type_name` — element/skill/weapon/armor/equip type-name lists
|
|
260
|
+
- `set_currency_unit`
|
|
261
|
+
|
|
262
|
+
### Batch creation
|
|
263
|
+
|
|
264
|
+
- `batch_create` — create many records of one type (actors, items, weapons, armors, skills, enemies, states, classes) in a single call and a **single file write**; ids allocate sequentially, so a record can reference a sibling made earlier in the same batch
|
|
265
|
+
|
|
266
|
+
### Index & validation
|
|
267
|
+
|
|
268
|
+
- `list_names` — cheap `{ id, name }` index for a table (actors, items, skills, maps, enemies, …)
|
|
269
|
+
- `get_database` — full records from one table (actors, classes, items, weapons, armors, skills, enemies, troops, states, common_events), or a single record by `id`
|
|
270
|
+
- `validate_event`, `validate_project` — event-command-shape validation (read-only)
|
|
271
|
+
- `validate_references` — cross-file id-integrity audit (party→actor, transfer→map, effect→state/skill/common-event, drops→item, map-tree cycles, …)
|
|
272
|
+
|
|
273
|
+
</details>
|
|
274
|
+
|
|
275
|
+
## Input validation
|
|
276
|
+
|
|
277
|
+
Every tool declares its arguments as a [Zod](https://zod.dev) schema. The server (built on the MCP SDK's high-level `McpServer`) validates incoming arguments against that schema **before** a handler runs, so malformed calls are rejected with a clear `Input validation error` naming the offending field instead of writing garbage to disk.
|
|
278
|
+
|
|
279
|
+
## Event validation (throw-by-default)
|
|
280
|
+
|
|
281
|
+
Event command lists are checked against a table of known RPG Maker MZ command codes (`101` Show Text, `201` Transfer Player, `122` Control Variables, …). Findings come in two tiers, and the tier decides what happens to the write:
|
|
282
|
+
|
|
283
|
+
- **Structural** — a wrong parameter count for a known command, a list not terminated by the code-`0` end marker, a non-array `parameters`, or an action-button event stranded on an impassable tile. These are almost always bugs, so the event-writing tools **validate the would-be result before committing and refuse the write**: the tool errors and *nothing reaches disk*. Pass `force: true` to write anyway (the argument is advertised on exactly the tools that can refuse).
|
|
284
|
+
- **Advisory** — an unrecognized command code (which may simply be a plugin command), an over-long text line, an unknown asset filename. These are legitimately possible, so they never block; they ride along as `warnings` on the normal response.
|
|
285
|
+
|
|
286
|
+
Because the check runs *before* the commit, a `dryRun` of a write that would be refused fails too, rather than previewing a write that could never happen.
|
|
287
|
+
|
|
288
|
+
`validate_event` / `validate_project` remain read-only audits: they report both tiers (each finding carries a `severity`) without changing anything.
|
|
289
|
+
|
|
290
|
+
## Reference linting
|
|
291
|
+
|
|
292
|
+
`validate_references` performs a **cross-file id-integrity audit** — orthogonal to the command-shape check above. It walks the whole database and flags references that point at something that doesn't exist: a starting party member with no matching actor, a Transfer Player targeting a missing map, a skill effect that adds a non-existent state, an enemy dropping an unknown item, a cyclic map-tree parent, and more. Every check is warn-by-default and guarded against false positives on partially-loaded projects.
|
|
293
|
+
|
|
294
|
+
## Dry-run preview
|
|
295
|
+
|
|
296
|
+
Every tool that writes to the project accepts an optional `dryRun` argument. When `dryRun: true`, the tool computes what it _would_ write and returns a diff instead of touching any files:
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"dryRun": true,
|
|
301
|
+
"wouldChange": [
|
|
302
|
+
{
|
|
303
|
+
"file": "System.json",
|
|
304
|
+
"changed": true,
|
|
305
|
+
"diff": {
|
|
306
|
+
"changes": [{ "path": "gameTitle", "from": "Old Title", "to": "New Title" }],
|
|
307
|
+
"truncated": false
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"wouldReturn": { "...": "what the tool would have returned, warnings included" }
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
`wouldReturn` carries the response the tool would have produced, so a dry-run also previews the validation warnings a write would have reported — not just the diff.
|
|
316
|
+
|
|
317
|
+
All writes go through a single choke point that skips no-op writes and keeps the on-disk JSON in the editor's compact single-line format. File deletions (e.g. `delete_map`) share the same dry-run machinery.
|
|
318
|
+
|
|
319
|
+
## Custom-tileset catalog skill
|
|
320
|
+
|
|
321
|
+
The default tilesets are cataloged out of the box. For a **custom** (non-RTP) tileset, a bundled Claude skill under `.claude/skills/tileset-catalog/` slices each sheet into labelled samples, has Claude vision-name them, and writes a versioned, project-scoped catalog to `data/tilecatalog/` — after which `find_tile`/`get_tile_catalog` resolve names for that sheet too. The skill ships a dependency-free PNG codec and engine-exact tile geometry, so it runs anywhere Node does.
|
|
322
|
+
|
|
323
|
+
## Example prompts
|
|
324
|
+
|
|
325
|
+
Once configured, drive your project in natural language:
|
|
326
|
+
|
|
327
|
+
- "Create a fire skill 'Fireball' costing 15 MP that deals `a.mat * 4 - b.mdf * 2` to one enemy."
|
|
328
|
+
- "Add a new town map under the world map, 30×25, using the Outside tileset."
|
|
329
|
+
- "Paint grass in a 10×8 rectangle at (4, 4) on map 3 and let it auto-border."
|
|
330
|
+
- "Place a talking NPC named 'Guard' at (8, 5) on map 2 who says 'Halt! Who goes there?'"
|
|
331
|
+
- "Make the water tiles on tileset 1 impassable and tag them terrain 1."
|
|
332
|
+
- "Check my project for broken references before I ship."
|
|
333
|
+
|
|
334
|
+
## Development
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npm run build # Compile TypeScript to dist/
|
|
338
|
+
npm run typecheck # Type-check without emitting (tsc --noEmit)
|
|
339
|
+
npm run dev # Compile in watch mode
|
|
340
|
+
npm run lint # ESLint
|
|
341
|
+
npm run lint:fix # ESLint with autofix
|
|
342
|
+
npm run format # Format with Prettier
|
|
343
|
+
npm run format:check # Check formatting (used in CI)
|
|
344
|
+
npm test # Vitest
|
|
345
|
+
npm run sync:tools # Re-stamp the tool count into the README + SVGs (see below)
|
|
346
|
+
npm run sync:version # Re-stamp package.json's version into the packaging manifests
|
|
347
|
+
npm run bundle:mcpb # Build the one-click Claude Desktop bundle (rpgmaker-mz-mcp.mcpb)
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
During development you can skip the build entirely by running the server from source with [tsx](https://tsx.is): point your MCP client's `command` at `node_modules/.bin/tsx` with `src/index.ts` as the argument. Since tsx doesn't type-check, run `npm run typecheck` alongside lint and tests before committing.
|
|
351
|
+
|
|
352
|
+
CI runs lint, format check, tool-count sync check, tests, and build on every push and pull request (see `.github/workflows/ci.yml`).
|
|
353
|
+
|
|
354
|
+
### Keeping the tool count in sync
|
|
355
|
+
|
|
356
|
+
The advertised tool count lives in a few human-facing spots — the README prose and badge, and the two SVGs in `assets/`. `npm run sync:tools` counts the real tools from `src/tools/` and re-stamps all of them, so bumping the number after adding a tool is one command. `npm run sync:tools:check` (run in CI) fails if any spot is stale.
|
|
357
|
+
|
|
358
|
+
### Releasing
|
|
359
|
+
|
|
360
|
+
`package.json` is the source of truth for the version; `npm run sync:version` stamps it into the plugin manifest (`.claude-plugin/plugin.json`), the MCP-registry metadata (`server.json`), and the MCPB manifest (`mcpb/manifest.json`). CI and `prepublishOnly` fail if they drift. A release is:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
npm version minor # or patch/major — bumps package.json + tags
|
|
364
|
+
npm run sync:version # stamp the new version into the other manifests
|
|
365
|
+
git add -A && git commit --amend --no-edit && git push --follow-tags
|
|
366
|
+
|
|
367
|
+
npm publish # publish to npm (runs the full gate via prepublishOnly)
|
|
368
|
+
mcp-publisher publish # update the MCP registry listing (server.json; login: mcp-publisher login github)
|
|
369
|
+
npm run bundle:mcpb # build rpgmaker-mz-mcp.mcpb and attach it to the GitHub release
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
The Claude Code plugin needs no separate publish — users' installs update from this repo (the plugin runs the npm package via `npx rpgmaker-mz-mcp@latest`, so bumping npm is what ships new tools).
|
|
373
|
+
|
|
374
|
+
## Project structure
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
rpgmaker-mz-mcp/
|
|
378
|
+
├── src/
|
|
379
|
+
│ ├── index.ts # McpServer bootstrap: registers every tool, dispatch + dry-run
|
|
380
|
+
│ ├── registry.ts # ToolDefinition shape + shared dryRun schema
|
|
381
|
+
│ ├── tools/ # One module per area (actors, items, skills, maps, battle,
|
|
382
|
+
│ │ # classes, states, common events, moves, plugins, tiles,
|
|
383
|
+
│ │ # catalog, paint, objects, tilesets, system, assets,
|
|
384
|
+
│ │ # event-command builders, event pages, list, validation)
|
|
385
|
+
│ ├── events/ # Pure event-command builders (no I/O)
|
|
386
|
+
│ ├── tiles/ # Tile subsystem: codec, autotile solver, paint core,
|
|
387
|
+
│ │ # flag codec, and the semantic catalog
|
|
388
|
+
│ ├── validation/ # Known-command tables + event/move/plugin/reference validators
|
|
389
|
+
│ └── utils/ # File I/O, the commit choke point, and RPG Maker MZ types
|
|
390
|
+
├── test/ # Vitest suite
|
|
391
|
+
├── scripts/
|
|
392
|
+
│ └── sync-tool-count.mjs # Re-stamps the tool count into the README + SVGs
|
|
393
|
+
├── assets/ # Banner + architecture SVGs
|
|
394
|
+
├── .claude/skills/
|
|
395
|
+
│ └── tileset-catalog/ # Vision catalog-bootstrap skill for custom tilesets
|
|
396
|
+
├── dist/ # Compiled JavaScript (gitignored)
|
|
397
|
+
└── README.md
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Safety and best practices
|
|
401
|
+
|
|
402
|
+
1. **Close the RPG Maker MZ editor** while using this server — it writes JSON files directly, and the editor can overwrite changes on save.
|
|
403
|
+
2. **Use version control** for your project. Combined with dry-run previews and validation, git is the safety net (the server does not make automatic backups).
|
|
404
|
+
3. **Preview destructive edits** with `dryRun: true` before committing them.
|
|
405
|
+
4. **Test in-engine** after significant changes.
|
|
406
|
+
|
|
407
|
+
## Limitations
|
|
408
|
+
|
|
409
|
+
- Writes JSON files directly; the editor must be closed to avoid conflicts.
|
|
410
|
+
- Plugin commands are validated against the plugins your project actually ships (`scan_plugins` parses their `@command`/`@arg` annotations), falling back to a small built-in allowlist. Since RPG Maker MZ has no "required argument" annotation, scanned args are checked for unknown names only, never for missing ones; a plugin with no annotation block passes through unchecked.
|
|
411
|
+
- Animations (`Animations.json`, Effekseer-based) are not edited by this server.
|
|
412
|
+
|
|
413
|
+
## Acknowledgements
|
|
414
|
+
|
|
415
|
+
This project started life as a fork of [k4zuki0539/-rpgmaker-mz-mcp](https://github.com/k4zuki0539/-rpgmaker-mz-mcp) (MIT), which provided the original CRUD scaffolding. It has since grown well beyond that starting point — into full vanilla level-design and game-logic authoring (see [Capabilities](#capabilities)) — and is now maintained as its own project. Thanks to the original author for the foundation.
|
|
416
|
+
|
|
417
|
+
## License
|
|
418
|
+
|
|
419
|
+
[MIT](https://opensource.org/licenses/MIT)
|
|
420
|
+
|
|
421
|
+
## Resources
|
|
422
|
+
|
|
423
|
+
- [RPG Maker MZ Official Website](https://www.rpgmakerweb.com/products/rpg-maker-mz)
|
|
424
|
+
- [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
|
|
425
|
+
- [RPG Maker MZ Database Structure](https://github.com/rpgtkoolmv/rmmz-api-reference)
|