godot-mcp-runtime 2.2.1 → 2.2.3

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/README.md CHANGED
@@ -1,27 +1,28 @@
1
1
  # Godot MCP Runtime
2
2
 
3
+ <a href="https://glama.ai/mcp/servers/@Erodenn/godot-mcp-runtime">
4
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@Erodenn/godot-runtime-mcp/badge" alt="godot-runtime-mcp MCP server" />
5
+ </a>
6
+
7
+ [![](https://badge.mcpx.dev?type=server 'MCP Server')](https://modelcontextprotocol.io/introduction)
3
8
  [![npm version](https://img.shields.io/npm/v/godot-mcp-runtime)](https://www.npmjs.com/package/godot-mcp-runtime)
4
9
  [![npm downloads](https://img.shields.io/npm/dt/godot-mcp-runtime)](https://www.npmjs.com/package/godot-mcp-runtime)
5
10
  [![License: MIT](https://badgen.net/github/license/Erodenn/godot-mcp-runtime)](LICENSE)
6
11
  [![Node.js](https://img.shields.io/node/v/godot-mcp-runtime)](https://nodejs.org/)
7
12
 
8
- An [MCP](https://modelcontextprotocol.io/) server that gives AI assistants direct access to a running Godot 4.x game. Not just file editing, not just scene manipulation. Actual runtime control: input simulation, screenshots, UI discovery, and live GDScript execution while the game is running.
9
-
10
- When you run a project through this server, it injects a lightweight UDP bridge as an autoload, and suddenly the AI can interact with your game the same way a player would: press keys, click buttons, read what's on screen, and run arbitrary code against the live scene tree.
13
+ A lightweight [MCP](https://modelcontextprotocol.io/) server that gives AI assistants direct access to a running [Godot](https://godotengine.org/) 4.x game. Not just file editing, not just scene manipulation. Actual runtime control: input simulation, screenshots, UI discovery, and live GDScript execution while the game is running.
11
14
 
12
15
  **The distinction matters: the AI doesn't just write your game, it can check its work.**
13
16
 
14
- **No addon required.** Most Godot MCP servers that offer runtime support ship as a Godot addon — something you install into your project, commit to version control, and manage as a dependency. This server does none of that. The bridge script is injected on `run_project` or `attach_project`, then removed on `stop_project` or `detach_project`. Your project files are left exactly as they were. All you need is Node.js and a Godot executable, no addon installation, no project modifications, no cleanup.
17
+ When you run a project through this server, it injects a lightweight UDP bridge as an autoload, and suddenly the AI can interact with your game the same way a player would: press keys, click buttons, read what's on screen, and run arbitrary code against the live scene tree.
15
18
 
16
- Think of it as [Playwright MCP](https://github.com/microsoft/playwright-mcp), but for Godot. Playwright lets agents verify that a web app actually works by driving a real browser. This does the same thing for games: run the project, take a screenshot, simulate input, read what's on screen, execute a script against the live scene tree. The agent closes the loop on its own changes rather than handing off to you to verify.
19
+ **No addon required.** Most Godot MCP servers that offer runtime support ship as a Godot addon something you install into your project, commit to version control, and manage as a dependency. All this server needs is Node.js and a Godot executable: no addon installation, no project modifications, no cleanup.
17
20
 
18
- This is not a playtesting replacement. It doesn't catch the subtle feel issues that only a human notices, and it won't tell you if your game is fun. What it does is let an agent confirm that a scene loads, a button responds, a value updated, a script ran without errors. That's a fundamentally different development workflow, and it's what this server is built for.
21
+ Think of it as [Playwright MCP](https://github.com/microsoft/playwright-mcp), but for Godot. This does the same thing for games: run the project, take a screenshot, simulate input, read what's on screen, execute a script against the live scene tree. The agent closes the loop on its own changes rather than handing off to you to verify.
19
22
 
20
- Every operation is its own tool with only its relevant parameters, no operation discriminators, no conditional schemas. Each tool teaches agents how to use it through its description and response messages: what to call next, when to wait, and how to recover from errors.
23
+ This is not a playtesting replacement. It doesn't catch the subtle feel issues that only a human notices, and it won't tell you if your game is fun. What it does is let an agent confirm that a scene loads, a button responds, a value updated, a script ran without errors. The ability to check work is crucial for AI driven workflows.
21
24
 
22
- <a href="https://glama.ai/mcp/servers/@Erodenn/godot-runtime-mcp">
23
- <img width="380" height="200" src="https://glama.ai/mcp/servers/@Erodenn/godot-runtime-mcp/badge" alt="godot-runtime-mcp MCP server" />
24
- </a>
25
+ Each tool teaches agents how to use it through its description and response messages: what to call next, when to wait, and how to recover from errors. Every operation is its own tool with only its relevant parameters, no operation discriminators and no conditional schemas. This server is built for agents.
25
26
 
26
27
  ## What It Does
27
28
 
@@ -121,73 +122,73 @@ Ask your AI assistant to call `get_project_info`. If it returns a Godot version
121
122
 
122
123
  ### Project Management
123
124
 
124
- | Tool | Description |
125
- |------|-------------|
126
- | `launch_editor` | Open the Godot editor GUI for a project |
127
- | `run_project` | Run a project and inject the MCP bridge. Pass `background: true` to hide the window |
128
- | `attach_project` | Inject the MCP bridge for a project you'll launch yourself |
129
- | `detach_project` | Remove the injected bridge after manual-launch use, leaving the external process alone |
130
- | `stop_project` | Stop the running project and remove the bridge (also detaches attached-mode state) |
131
- | `get_debug_output` | Read stdout/stderr from an MCP-spawned project (unavailable in attached mode) |
132
- | `list_projects` | Find Godot projects in a directory |
133
- | `get_project_info` | Get project metadata and Godot version |
125
+ | Tool | Description |
126
+ | ------------------ | -------------------------------------------------------------------------------------- |
127
+ | `launch_editor` | Open the Godot editor GUI for a project |
128
+ | `run_project` | Run a project and inject the MCP bridge. Pass `background: true` to hide the window |
129
+ | `attach_project` | Inject the MCP bridge for a project you'll launch yourself |
130
+ | `detach_project` | Remove the injected bridge after manual-launch use, leaving the external process alone |
131
+ | `stop_project` | Stop the running project and remove the bridge (also detaches attached-mode state) |
132
+ | `get_debug_output` | Read stdout/stderr from an MCP-spawned project (unavailable in attached mode) |
133
+ | `list_projects` | Find Godot projects in a directory |
134
+ | `get_project_info` | Get project metadata and Godot version |
134
135
 
135
136
  ### Runtime (requires `run_project` or `attach_project` first)
136
137
 
137
138
  After `run_project`, or after `attach_project` plus launching Godot manually, wait 2-3 seconds for the bridge to initialize before using these tools.
138
139
 
139
- | Tool | Description |
140
- |------|-------------|
141
- | `take_screenshot` | Capture a PNG of the running viewport |
142
- | `simulate_input` | Send batched input: key, mouse, click_element, action, wait |
143
- | `get_ui_elements` | Get all visible Control nodes with positions, types, and text |
144
- | `run_script` | Execute arbitrary GDScript at runtime with full SceneTree access |
140
+ | Tool | Description |
141
+ | ----------------- | ---------------------------------------------------------------- |
142
+ | `take_screenshot` | Capture a PNG of the running viewport |
143
+ | `simulate_input` | Send batched input: key, mouse, click_element, action, wait |
144
+ | `get_ui_elements` | Get all visible Control nodes with positions, types, and text |
145
+ | `run_script` | Execute arbitrary GDScript at runtime with full SceneTree access |
145
146
 
146
147
  ### Scene Editing (headless)
147
148
 
148
149
  All mutation operations save automatically. Use `save_scene` only for save-as (`newPath`) or to re-canonicalize a `.tscn` file.
149
150
 
150
- | Tool | Description |
151
- |------|-------------|
152
- | `create_scene` | Create a new scene file |
153
- | `add_node` | Add a node to an existing scene (supports promoted spatial params) |
154
- | `load_sprite` | Set a texture on a Sprite2D, Sprite3D, or TextureRect |
155
- | `save_scene` | Re-pack and save the scene, or save-as with `newPath` |
156
- | `export_mesh_library` | Export scenes as a MeshLibrary for GridMap |
151
+ | Tool | Description |
152
+ | ------------------------ | -------------------------------------------------------------------- |
153
+ | `create_scene` | Create a new scene file |
154
+ | `add_node` | Add a node to an existing scene (supports promoted spatial params) |
155
+ | `load_sprite` | Set a texture on a Sprite2D, Sprite3D, or TextureRect |
156
+ | `save_scene` | Re-pack and save the scene, or save-as with `newPath` |
157
+ | `export_mesh_library` | Export scenes as a MeshLibrary for GridMap |
157
158
  | `batch_scene_operations` | Run multiple add_node/load_sprite/save ops in a single Godot process |
158
159
 
159
160
  ### Node Editing (headless)
160
161
 
161
162
  All mutation operations save automatically.
162
163
 
163
- | Tool | Description |
164
- |------|-------------|
165
- | `get_scene_tree` | Get the full scene tree hierarchy (use `maxDepth: 1` for shallow listing) |
166
- | `get_node_properties` | Read properties from a node |
167
- | `batch_get_node_properties` | Read properties from multiple nodes in one process |
168
- | `set_node_property` | Set a property on a node |
169
- | `batch_set_node_properties` | Set multiple properties in one process |
170
- | `attach_script` | Attach a GDScript to a node |
171
- | `duplicate_node` | Duplicate a node within the scene |
172
- | `delete_node` | Remove a node from the scene |
173
- | `get_node_signals` | List all signals on a node with their connections |
174
- | `connect_signal` | Connect a signal to a method on another node |
175
- | `disconnect_signal` | Disconnect a signal connection |
164
+ | Tool | Description |
165
+ | --------------------------- | ------------------------------------------------------------------------- |
166
+ | `get_scene_tree` | Get the full scene tree hierarchy (use `maxDepth: 1` for shallow listing) |
167
+ | `get_node_properties` | Read properties from a node |
168
+ | `batch_get_node_properties` | Read properties from multiple nodes in one process |
169
+ | `set_node_property` | Set a property on a node |
170
+ | `batch_set_node_properties` | Set multiple properties in one process |
171
+ | `attach_script` | Attach a GDScript to a node |
172
+ | `duplicate_node` | Duplicate a node within the scene |
173
+ | `delete_node` | Remove a node from the scene |
174
+ | `get_node_signals` | List all signals on a node with their connections |
175
+ | `connect_signal` | Connect a signal to a method on another node |
176
+ | `disconnect_signal` | Disconnect a signal connection |
176
177
 
177
178
  ### Project Config (no Godot process required)
178
179
 
179
180
  These tools edit `project.godot` directly or read the filesystem. Safe to use even when autoloads are broken.
180
181
 
181
- | Tool | Description |
182
- |------|-------------|
183
- | `list_autoloads` | List all registered autoloads with paths and singleton status |
184
- | `add_autoload` | Register a new autoload |
185
- | `remove_autoload` | Unregister an autoload by name |
186
- | `update_autoload` | Modify an existing autoload's path or singleton flag |
187
- | `get_project_settings` | Read settings from `project.godot` by section and key |
188
- | `get_project_files` | Get the project file tree with types and extensions |
189
- | `search_project` | Search for a string across project source files |
190
- | `get_scene_dependencies` | List all resources a scene depends on |
182
+ | Tool | Description |
183
+ | ------------------------ | ------------------------------------------------------------- |
184
+ | `list_autoloads` | List all registered autoloads with paths and singleton status |
185
+ | `add_autoload` | Register a new autoload |
186
+ | `remove_autoload` | Unregister an autoload by name |
187
+ | `update_autoload` | Modify an existing autoload's path or singleton flag |
188
+ | `get_project_settings` | Read settings from `project.godot` by section and key |
189
+ | `get_project_files` | Get the project file tree with types and extensions |
190
+ | `search_project` | Search for a string across project source files |
191
+ | `get_scene_dependencies` | List all resources a scene depends on |
191
192
 
192
193
  ### Validation: `validate`
193
194
 
@@ -195,10 +196,10 @@ Validate before attaching or running. Catches syntax errors and missing resource
195
196
 
196
197
  ### UIDs: `manage_uids` (Godot 4.4+)
197
198
 
198
- | Operation | Description |
199
- |-----------|-------------|
200
- | `get` | Get a resource's UID |
201
- | `update` | Resave all resources to update UID references |
199
+ | Operation | Description |
200
+ | --------- | --------------------------------------------- |
201
+ | `get` | Get a resource's UID |
202
+ | `update` | Resave all resources to update UID references |
202
203
 
203
204
  ## Architecture
204
205
 
@@ -231,10 +232,6 @@ When `run_project` or `attach_project` is called:
231
232
 
232
233
  Files generated during runtime (screenshots, executed scripts) are stored in `.mcp/` inside the project directory. This directory is automatically added to `.gitignore` and has a `.gdignore` so Godot won't import it.
233
234
 
234
- ## Broken Autoloads
235
-
236
- If any registered autoload fails to initialize (syntax error, missing resource, display dependency), Godot's headless process will crash before any operation runs. Use `list_autoloads` and `remove_autoload` to inspect and remove the failing autoload. These tools edit `project.godot` directly, with no Godot process involved.
237
-
238
235
  ## Acknowledgments
239
236
 
240
237
  Built on the foundation laid by [Coding-Solo/godot-mcp](https://github.com/Coding-Solo/godot-mcp) for headless Godot operations.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Tool dispatch table.
3
+ *
4
+ * Maps every MCP tool name to a handler that takes the runner + raw args and
5
+ * returns the tool response. Extracted from index.ts so tests can exercise
6
+ * dispatch as a pure data structure (no Server / stdio / lifecycle setup).
7
+ *
8
+ * Behavioral contract preserved from the original switch in index.ts:
9
+ * - Each name routes to the same handler it did before.
10
+ * - Unknown tool names throw McpError(MethodNotFound, ...) — see
11
+ * `dispatchToolCall`.
12
+ */
13
+ import type { GodotRunner, OperationParams } from './utils/godot-runner.js';
14
+ export interface ToolResponse {
15
+ content: Array<{
16
+ type: string;
17
+ text?: string;
18
+ [k: string]: unknown;
19
+ }>;
20
+ isError?: boolean;
21
+ [k: string]: unknown;
22
+ }
23
+ export type ToolHandler = (runner: GodotRunner, args: OperationParams) => Promise<ToolResponse> | ToolResponse;
24
+ export declare const toolDispatch: Record<string, ToolHandler>;
25
+ export declare function dispatchToolCall(runner: GodotRunner, toolName: string, args: OperationParams): Promise<ToolResponse>;
26
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAmD5E,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,WAAW,GAAG,CACxB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,eAAe,KAClB,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AAE1C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CA+CpD,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,YAAY,CAAC,CAMvB"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Tool dispatch table.
3
+ *
4
+ * Maps every MCP tool name to a handler that takes the runner + raw args and
5
+ * returns the tool response. Extracted from index.ts so tests can exercise
6
+ * dispatch as a pure data structure (no Server / stdio / lifecycle setup).
7
+ *
8
+ * Behavioral contract preserved from the original switch in index.ts:
9
+ * - Each name routes to the same handler it did before.
10
+ * - Unknown tool names throw McpError(MethodNotFound, ...) — see
11
+ * `dispatchToolCall`.
12
+ */
13
+ import { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';
14
+ import { handleLaunchEditor, handleRunProject, handleAttachProject, handleDetachProject, handleGetDebugOutput, handleStopProject, handleListProjects, handleGetProjectInfo, handleTakeScreenshot, handleSimulateInput, handleGetUiElements, handleRunScript, handleListAutoloads, handleAddAutoload, handleRemoveAutoload, handleUpdateAutoload, handleGetProjectFiles, handleSearchProject, handleGetSceneDependencies, handleGetProjectSettings, } from './tools/project-tools.js';
15
+ import { handleCreateScene, handleAddNode, handleLoadSprite, handleSaveScene, handleExportMeshLibrary, handleBatchSceneOperations, handleManageUids, } from './tools/scene-tools.js';
16
+ import { handleDeleteNode, handleSetNodeProperty, handleBatchSetNodeProperties, handleGetNodeProperties, handleBatchGetNodeProperties, handleAttachScript, handleGetSceneTree, handleDuplicateNode, handleGetNodeSignals, handleConnectSignal, handleDisconnectSignal, } from './tools/node-tools.js';
17
+ import { handleValidate } from './tools/validate-tools.js';
18
+ export const toolDispatch = {
19
+ // Project tools
20
+ launch_editor: (runner, args) => handleLaunchEditor(runner, args),
21
+ run_project: (runner, args) => handleRunProject(runner, args),
22
+ attach_project: (runner, args) => handleAttachProject(runner, args),
23
+ detach_project: (runner) => handleDetachProject(runner),
24
+ get_debug_output: (runner, args) => handleGetDebugOutput(runner, args),
25
+ stop_project: (runner) => handleStopProject(runner),
26
+ list_projects: (_runner, args) => handleListProjects(args),
27
+ get_project_info: (runner, args) => handleGetProjectInfo(runner, args),
28
+ take_screenshot: (runner, args) => handleTakeScreenshot(runner, args),
29
+ simulate_input: (runner, args) => handleSimulateInput(runner, args),
30
+ get_ui_elements: (runner, args) => handleGetUiElements(runner, args),
31
+ run_script: (runner, args) => handleRunScript(runner, args),
32
+ list_autoloads: (_runner, args) => handleListAutoloads(args),
33
+ add_autoload: (_runner, args) => handleAddAutoload(args),
34
+ remove_autoload: (_runner, args) => handleRemoveAutoload(args),
35
+ update_autoload: (_runner, args) => handleUpdateAutoload(args),
36
+ get_project_files: (_runner, args) => handleGetProjectFiles(args),
37
+ search_project: (_runner, args) => handleSearchProject(args),
38
+ get_scene_dependencies: (_runner, args) => handleGetSceneDependencies(args),
39
+ get_project_settings: (_runner, args) => handleGetProjectSettings(args),
40
+ // Scene tools
41
+ create_scene: (runner, args) => handleCreateScene(runner, args),
42
+ add_node: (runner, args) => handleAddNode(runner, args),
43
+ load_sprite: (runner, args) => handleLoadSprite(runner, args),
44
+ save_scene: (runner, args) => handleSaveScene(runner, args),
45
+ export_mesh_library: (runner, args) => handleExportMeshLibrary(runner, args),
46
+ batch_scene_operations: (runner, args) => handleBatchSceneOperations(runner, args),
47
+ manage_uids: (runner, args) => handleManageUids(runner, args),
48
+ // Node tools
49
+ delete_node: (runner, args) => handleDeleteNode(runner, args),
50
+ set_node_property: (runner, args) => handleSetNodeProperty(runner, args),
51
+ batch_set_node_properties: (runner, args) => handleBatchSetNodeProperties(runner, args),
52
+ get_node_properties: (runner, args) => handleGetNodeProperties(runner, args),
53
+ batch_get_node_properties: (runner, args) => handleBatchGetNodeProperties(runner, args),
54
+ attach_script: (runner, args) => handleAttachScript(runner, args),
55
+ get_scene_tree: (runner, args) => handleGetSceneTree(runner, args),
56
+ duplicate_node: (runner, args) => handleDuplicateNode(runner, args),
57
+ get_node_signals: (runner, args) => handleGetNodeSignals(runner, args),
58
+ connect_signal: (runner, args) => handleConnectSignal(runner, args),
59
+ disconnect_signal: (runner, args) => handleDisconnectSignal(runner, args),
60
+ // Validate tools
61
+ validate: (runner, args) => handleValidate(runner, args),
62
+ };
63
+ export async function dispatchToolCall(runner, toolName, args) {
64
+ const handler = toolDispatch[toolName];
65
+ if (!handler) {
66
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${toolName}`);
67
+ }
68
+ return await handler(runner, args);
69
+ }
70
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,EACL,kBAAkB,EAClB,gBAAgB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7
7
  * capture debug output, manipulate scenes and nodes, and more.
8
8
  */
9
- export {};
9
+ export declare const allToolDefinitions: import("./utils/godot-runner.js").ToolDefinition[];
10
+ export declare const serverInstructions = "Godot MCP Server \u2014 AI-driven Godot 4.x project manipulation.\n\nTool categories:\n- Project management: launch_editor, run_project, attach_project, detach_project, stop_project, get_debug_output, list_projects, get_project_info\n- Scene editing (headless): create_scene, add_node, load_sprite, save_scene, export_mesh_library, batch_scene_operations\n- Node editing (headless): delete_node, set_node_property, batch_set_node_properties, get_node_properties, batch_get_node_properties, attach_script, get_scene_tree, duplicate_node, get_node_signals, connect_signal, disconnect_signal\n- Runtime (requires run_project or attach_project): take_screenshot, simulate_input, get_ui_elements, run_script\n- Project config (no Godot process): list_autoloads, add_autoload, remove_autoload, update_autoload, get_project_files, search_project, get_scene_dependencies, get_project_settings\n- Validation: validate\n- UIDs (Godot 4.4+): manage_uids\n\nKey behaviors:\n- All mutation operations (add_node, set_node_property, delete_node, etc.) save the scene automatically. Only use save_scene for save-as (newPath) or re-canonicalization.\n- Headless Godot initializes ALL registered autoloads. If any autoload is broken, headless operations will fail. Use list_autoloads / remove_autoload to diagnose.\n- run_project verifies bridge readiness before returning success. If it reports degraded status, retry runtime tools after a moment or check get_debug_output.\n- attach_project is the fallback path for a manually launched Godot process. It injects the bridge and marks the project active, but it does not spawn Godot or capture stdout/stderr.\n- click_element in simulate_input resolves by node path or node name (BFS search), NOT by visible text. Use get_ui_elements to discover valid element identifiers.\n- run_script expects GDScript with \"extends RefCounted\" and \"func execute(scene_tree: SceneTree) -> Variant\".\n- run_project spawns Godot without -d so runtime errors do not pause execution; the `breakpoint` keyword in user code is a no-op (no debugger is attached). SCRIPT ERROR output and GDScript backtraces still appear in stderr.";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAeH,eAAO,MAAM,kBAAkB,oDAK9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,qmEAkBmM,CAAC"}
package/dist/index.js CHANGED
@@ -8,29 +8,20 @@
8
8
  */
9
9
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
10
10
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
11
- import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
11
+ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
12
12
  import { GodotRunner } from './utils/godot-runner.js';
13
- // Project tools
14
- import { projectToolDefinitions, handleLaunchEditor, handleRunProject, handleAttachProject, handleDetachProject, handleGetDebugOutput, handleStopProject, handleListProjects, handleGetProjectInfo, handleTakeScreenshot, handleSimulateInput, handleGetUiElements, handleRunScript, handleListAutoloads, handleAddAutoload, handleRemoveAutoload, handleUpdateAutoload, handleGetProjectFiles, handleSearchProject, handleGetSceneDependencies, handleGetProjectSettings, } from './tools/project-tools.js';
15
- // Scene tools
16
- import { sceneToolDefinitions, handleCreateScene, handleAddNode, handleLoadSprite, handleSaveScene, handleExportMeshLibrary, handleBatchSceneOperations, handleManageUids, } from './tools/scene-tools.js';
17
- // Node tools
18
- import { nodeToolDefinitions, handleDeleteNode, handleSetNodeProperty, handleBatchSetNodeProperties, handleGetNodeProperties, handleBatchGetNodeProperties, handleAttachScript, handleGetSceneTree, handleDuplicateNode, handleGetNodeSignals, handleConnectSignal, handleDisconnectSignal, } from './tools/node-tools.js';
19
- // Validate tools
20
- import { validateToolDefinitions, handleValidate, } from './tools/validate-tools.js';
21
- class GodotMcpServer {
22
- server;
23
- runner;
24
- constructor(config) {
25
- this.runner = new GodotRunner(config);
26
- this.server = new Server({
27
- name: 'godot-mcp',
28
- version: '2.2.1',
29
- }, {
30
- capabilities: {
31
- tools: {},
32
- },
33
- instructions: `Godot MCP Server — AI-driven Godot 4.x project manipulation.
13
+ import { dispatchToolCall } from './dispatch.js';
14
+ import { projectToolDefinitions } from './tools/project-tools.js';
15
+ import { sceneToolDefinitions } from './tools/scene-tools.js';
16
+ import { nodeToolDefinitions } from './tools/node-tools.js';
17
+ import { validateToolDefinitions } from './tools/validate-tools.js';
18
+ export const allToolDefinitions = [
19
+ ...projectToolDefinitions,
20
+ ...sceneToolDefinitions,
21
+ ...nodeToolDefinitions,
22
+ ...validateToolDefinitions,
23
+ ];
24
+ export const serverInstructions = `Godot MCP Server — AI-driven Godot 4.x project manipulation.
34
25
 
35
26
  Tool categories:
36
27
  - Project management: launch_editor, run_project, attach_project, detach_project, stop_project, get_debug_output, list_projects, get_project_info
@@ -44,11 +35,24 @@ Tool categories:
44
35
  Key behaviors:
45
36
  - All mutation operations (add_node, set_node_property, delete_node, etc.) save the scene automatically. Only use save_scene for save-as (newPath) or re-canonicalization.
46
37
  - Headless Godot initializes ALL registered autoloads. If any autoload is broken, headless operations will fail. Use list_autoloads / remove_autoload to diagnose.
47
- - After run_project, wait 2-3 seconds before using runtime tools (take_screenshot, simulate_input, get_ui_elements, run_script). The MCP bridge needs time to initialize.
38
+ - run_project verifies bridge readiness before returning success. If it reports degraded status, retry runtime tools after a moment or check get_debug_output.
48
39
  - attach_project is the fallback path for a manually launched Godot process. It injects the bridge and marks the project active, but it does not spawn Godot or capture stdout/stderr.
49
40
  - click_element in simulate_input resolves by node path or node name (BFS search), NOT by visible text. Use get_ui_elements to discover valid element identifiers.
50
41
  - run_script expects GDScript with "extends RefCounted" and "func execute(scene_tree: SceneTree) -> Variant".
51
- - run_project spawns Godot without -d so runtime errors do not pause execution; the \`breakpoint\` keyword in user code is a no-op (no debugger is attached). SCRIPT ERROR output and GDScript backtraces still appear in stderr.`,
42
+ - run_project spawns Godot without -d so runtime errors do not pause execution; the \`breakpoint\` keyword in user code is a no-op (no debugger is attached). SCRIPT ERROR output and GDScript backtraces still appear in stderr.`;
43
+ class GodotMcpServer {
44
+ server;
45
+ runner;
46
+ constructor(config) {
47
+ this.runner = new GodotRunner(config);
48
+ this.server = new Server({
49
+ name: 'godot-mcp',
50
+ version: '2.2.3',
51
+ }, {
52
+ capabilities: {
53
+ tools: {},
54
+ },
55
+ instructions: serverInstructions,
52
56
  });
53
57
  this.setupToolHandlers();
54
58
  this.server.onerror = (error) => console.error('[MCP Error]', error);
@@ -67,106 +71,14 @@ Key behaviors:
67
71
  await this.server.close();
68
72
  }
69
73
  setupToolHandlers() {
70
- // Combine all tool definitions
71
- const allTools = [
72
- ...projectToolDefinitions,
73
- ...sceneToolDefinitions,
74
- ...nodeToolDefinitions,
75
- ...validateToolDefinitions,
76
- ];
77
74
  this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
78
- tools: allTools,
75
+ tools: allToolDefinitions,
79
76
  }));
80
77
  this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
81
78
  const toolName = request.params.name;
82
79
  const args = request.params.arguments || {};
83
80
  console.error(`[SERVER] Handling tool request: ${toolName}`);
84
- switch (toolName) {
85
- // Project tools
86
- case 'launch_editor':
87
- return await handleLaunchEditor(this.runner, args);
88
- case 'run_project':
89
- return await handleRunProject(this.runner, args);
90
- case 'attach_project':
91
- return await handleAttachProject(this.runner, args);
92
- case 'detach_project':
93
- return handleDetachProject(this.runner);
94
- case 'get_debug_output':
95
- return handleGetDebugOutput(this.runner, args);
96
- case 'stop_project':
97
- return handleStopProject(this.runner);
98
- case 'list_projects':
99
- return await handleListProjects(args);
100
- case 'get_project_info':
101
- return await handleGetProjectInfo(this.runner, args);
102
- case 'take_screenshot':
103
- return await handleTakeScreenshot(this.runner, args);
104
- case 'simulate_input':
105
- return await handleSimulateInput(this.runner, args);
106
- case 'get_ui_elements':
107
- return await handleGetUiElements(this.runner, args);
108
- case 'run_script':
109
- return await handleRunScript(this.runner, args);
110
- case 'list_autoloads':
111
- return await handleListAutoloads(args);
112
- case 'add_autoload':
113
- return await handleAddAutoload(args);
114
- case 'remove_autoload':
115
- return await handleRemoveAutoload(args);
116
- case 'update_autoload':
117
- return await handleUpdateAutoload(args);
118
- case 'get_project_files':
119
- return await handleGetProjectFiles(args);
120
- case 'search_project':
121
- return await handleSearchProject(args);
122
- case 'get_scene_dependencies':
123
- return await handleGetSceneDependencies(args);
124
- case 'get_project_settings':
125
- return await handleGetProjectSettings(args);
126
- // Scene tools
127
- case 'create_scene':
128
- return await handleCreateScene(this.runner, args);
129
- case 'add_node':
130
- return await handleAddNode(this.runner, args);
131
- case 'load_sprite':
132
- return await handleLoadSprite(this.runner, args);
133
- case 'save_scene':
134
- return await handleSaveScene(this.runner, args);
135
- case 'export_mesh_library':
136
- return await handleExportMeshLibrary(this.runner, args);
137
- case 'batch_scene_operations':
138
- return await handleBatchSceneOperations(this.runner, args);
139
- case 'manage_uids':
140
- return await handleManageUids(this.runner, args);
141
- // Node tools
142
- case 'delete_node':
143
- return await handleDeleteNode(this.runner, args);
144
- case 'set_node_property':
145
- return await handleSetNodeProperty(this.runner, args);
146
- case 'batch_set_node_properties':
147
- return await handleBatchSetNodeProperties(this.runner, args);
148
- case 'get_node_properties':
149
- return await handleGetNodeProperties(this.runner, args);
150
- case 'batch_get_node_properties':
151
- return await handleBatchGetNodeProperties(this.runner, args);
152
- case 'attach_script':
153
- return await handleAttachScript(this.runner, args);
154
- case 'get_scene_tree':
155
- return await handleGetSceneTree(this.runner, args);
156
- case 'duplicate_node':
157
- return await handleDuplicateNode(this.runner, args);
158
- case 'get_node_signals':
159
- return await handleGetNodeSignals(this.runner, args);
160
- case 'connect_signal':
161
- return await handleConnectSignal(this.runner, args);
162
- case 'disconnect_signal':
163
- return await handleDisconnectSignal(this.runner, args);
164
- // Validate tools
165
- case 'validate':
166
- return await handleValidate(this.runner, args);
167
- default:
168
- throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${toolName}`);
169
- }
81
+ return await dispatchToolCall(this.runner, toolName, args);
170
82
  });
171
83
  }
172
84
  async run() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AAEzE,gBAAgB;AAChB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,cAAc;AACd,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,aAAa;AACb,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,iBAAiB;AACjB,OAAO,EACL,uBAAuB,EACvB,cAAc,GACf,MAAM,2BAA2B,CAAC;AAEnC,MAAM,cAAc;IACV,MAAM,CAAS;IACf,MAAM,CAAc;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