@satelliteoflove/godot-mcp 2.3.0 → 2.4.1

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.
Files changed (77) hide show
  1. package/README.md +58 -27
  2. package/addon/command_router.gd +39 -0
  3. package/addon/command_router.gd.uid +1 -0
  4. package/addon/commands/animation_commands.gd +633 -0
  5. package/addon/commands/animation_commands.gd.uid +1 -0
  6. package/addon/commands/debug_commands.gd +109 -0
  7. package/addon/commands/debug_commands.gd.uid +1 -0
  8. package/addon/commands/file_commands.gd +95 -0
  9. package/addon/commands/file_commands.gd.uid +1 -0
  10. package/addon/commands/node_commands.gd +255 -0
  11. package/addon/commands/node_commands.gd.uid +1 -0
  12. package/addon/commands/project_commands.gd +114 -0
  13. package/addon/commands/project_commands.gd.uid +1 -0
  14. package/addon/commands/resource_commands.gd +293 -0
  15. package/addon/commands/resource_commands.gd.uid +1 -0
  16. package/addon/commands/scene3d_commands.gd +162 -0
  17. package/addon/commands/scene3d_commands.gd.uid +1 -0
  18. package/addon/commands/scene_commands.gd +131 -0
  19. package/addon/commands/scene_commands.gd.uid +1 -0
  20. package/addon/commands/screenshot_commands.gd +130 -0
  21. package/addon/commands/screenshot_commands.gd.uid +1 -0
  22. package/addon/commands/script_commands.gd +156 -0
  23. package/addon/commands/script_commands.gd.uid +1 -0
  24. package/addon/commands/selection_commands.gd +170 -0
  25. package/addon/commands/selection_commands.gd.uid +1 -0
  26. package/addon/commands/system_commands.gd +29 -0
  27. package/addon/commands/tilemap_commands.gd +657 -0
  28. package/addon/commands/tilemap_commands.gd.uid +1 -0
  29. package/addon/core/base_command.gd +58 -0
  30. package/addon/core/base_command.gd.uid +1 -0
  31. package/addon/core/mcp_debugger_plugin.gd +149 -0
  32. package/addon/core/mcp_debugger_plugin.gd.uid +1 -0
  33. package/addon/core/mcp_logger.gd +40 -0
  34. package/addon/core/mcp_logger.gd.uid +1 -0
  35. package/addon/core/mcp_utils.gd +129 -0
  36. package/addon/core/mcp_utils.gd.uid +1 -0
  37. package/addon/game_bridge/mcp_game_bridge.gd +195 -0
  38. package/addon/game_bridge/mcp_game_bridge.gd.uid +1 -0
  39. package/addon/plugin.cfg +8 -0
  40. package/addon/plugin.gd +89 -0
  41. package/addon/plugin.gd.uid +1 -0
  42. package/addon/ui/status_panel.gd +23 -0
  43. package/addon/ui/status_panel.gd.uid +1 -0
  44. package/addon/ui/status_panel.tscn +41 -0
  45. package/addon/websocket_server.gd +143 -0
  46. package/addon/websocket_server.gd.uid +1 -0
  47. package/dist/cli.d.ts +3 -0
  48. package/dist/cli.d.ts.map +1 -0
  49. package/dist/cli.js +60 -0
  50. package/dist/cli.js.map +1 -0
  51. package/dist/connection/websocket.d.ts +14 -0
  52. package/dist/connection/websocket.d.ts.map +1 -1
  53. package/dist/connection/websocket.js +69 -1
  54. package/dist/connection/websocket.js.map +1 -1
  55. package/dist/core/types.d.ts +5 -0
  56. package/dist/core/types.d.ts.map +1 -1
  57. package/dist/index.d.ts +1 -2
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +1 -6
  60. package/dist/index.js.map +1 -1
  61. package/dist/installer/install.d.ts +13 -0
  62. package/dist/installer/install.d.ts.map +1 -0
  63. package/dist/installer/install.js +77 -0
  64. package/dist/installer/install.js.map +1 -0
  65. package/dist/tools/editor.d.ts.map +1 -1
  66. package/dist/tools/editor.js.map +1 -1
  67. package/dist/tools/project.d.ts +3 -3
  68. package/dist/tools/project.d.ts.map +1 -1
  69. package/dist/tools/project.js +28 -2
  70. package/dist/tools/project.js.map +1 -1
  71. package/dist/tools/scene3d.d.ts.map +1 -1
  72. package/dist/tools/scene3d.js.map +1 -1
  73. package/dist/version.d.ts +2 -0
  74. package/dist/version.d.ts.map +1 -0
  75. package/dist/version.js +20 -0
  76. package/dist/version.js.map +1 -0
  77. package/package.json +6 -4
package/README.md CHANGED
@@ -1,33 +1,26 @@
1
- # @satelliteoflove/godot-mcp
1
+ # godot-mcp
2
2
 
3
- MCP server for Godot Engine 4.5+, enabling AI assistants to interact with your Godot projects.
3
+ An MCP server that gives Claude direct visibility into your Godot editor and running game. Instead of copy-pasting debug output or describing what you're seeing, Claude can observe it directly.
4
4
 
5
- ## Features
5
+ ## Core Capabilities
6
6
 
7
- - **8 MCP tools** across 7 categories
8
- - **3 MCP resources** for reading scene trees, scripts, and project files
9
- - Screenshot capture from editor viewports and running games
10
- - Full animation support (query, playback, editing)
11
- - TileMapLayer and GridMap editing
12
- - Resource inspection for SpriteFrames, TileSets, Materials, and Textures
13
- - Debug output capture from running games
7
+ - Live editor state - what scene is open, what's selected, which panel you're in
8
+ - Runtime debug output from the running game
9
+ - Viewport awareness - where the camera is pointed (2D and 3D)
10
+ - Screenshots of the editor or running game
11
+ - Scene tree and node properties at runtime
14
12
 
15
- ## Installation
13
+ ## Design Goals
16
14
 
17
- ```bash
18
- npx @satelliteoflove/godot-mcp
19
- ```
20
-
21
- ## Setup
15
+ - **Observation over automation** - help Claude understand what's happening so it can help you solve problems
16
+ - **Minimal token footprint** - more room for actual conversation
17
+ - **Friction-free maintenance** - version mismatch detection and one-command updates
22
18
 
23
- 1. Download the addon from [GitHub Releases](https://github.com/satelliteoflove/godot-mcp/releases)
24
- 2. Extract to your project's `addons` directory
25
- 3. Enable it in Project Settings > Plugins
26
- 4. Configure your MCP client (see below)
19
+ ## Quick Start
27
20
 
28
- ### Claude Desktop
21
+ ### 1. Configure Your AI Assistant
29
22
 
30
- Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
23
+ **Claude Desktop** - Add to config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
31
24
 
32
25
  ```json
33
26
  {
@@ -40,9 +33,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
40
33
  }
41
34
  ```
42
35
 
43
- ### Claude Code
44
-
45
- Add to `.mcp.json`:
36
+ **Claude Code** - Add to `.mcp.json`:
46
37
 
47
38
  ```json
48
39
  {
@@ -55,9 +46,49 @@ Add to `.mcp.json`:
55
46
  }
56
47
  ```
57
48
 
58
- ## Documentation
49
+ ### 2. Install the Godot Addon
50
+
51
+ ```bash
52
+ npx @satelliteoflove/godot-mcp --install-addon /path/to/your/godot/project
53
+ ```
54
+
55
+ Then enable the addon in Godot: Project Settings > Plugins > Godot MCP.
56
+
57
+ ### 3. Start Using
58
+
59
+ Open your Godot project (with addon enabled), restart your AI assistant, and start building.
60
+
61
+ **Version Sync:** The MCP server auto-updates via npx. If the addon version falls behind, use `project` tool with `addon_status` action to check compatibility, then re-run the install command to update.
59
62
 
60
- See the [GitHub repository](https://github.com/satelliteoflove/godot-mcp) for full documentation.
63
+ ## Tools
64
+
65
+ | Tool | Description |
66
+ |------|-------------|
67
+ | `scene` | Manage scenes: open, save, or create scenes |
68
+ | `node` | Manage scene nodes: get properties, find, create, update, delete, reparent, attach/detach scripts |
69
+ | `editor` | Control the Godot editor: get state (includes viewport/camera info), manage selection, run/stop project, get debug output, get performance metrics, capture screenshots, set 2D viewport position/zoom |
70
+ | `project` | Get project information and settings |
71
+ | `animation` | Query, control, and edit animations |
72
+ | `tilemap` | Query and edit TileMapLayer data: list layers, get info, get/set cells, convert coordinates |
73
+ | `gridmap` | Query and edit GridMap data: list gridmaps, get info, get/set cells |
74
+ | `resource` | Manage Godot resources: inspect Resource files by path |
75
+
76
+ See [docs/](docs/) for detailed API reference, including the [Claude Code Setup Guide](docs/claude-code-setup.md).
77
+
78
+ ## Architecture
79
+
80
+ ```
81
+ [AI Assistant] <--stdio--> [MCP Server] <--WebSocket--> [Godot Addon]
82
+ ```
83
+
84
+ ## Development
85
+
86
+ ```bash
87
+ cd server
88
+ npm install && npm run build
89
+ npm test
90
+ npm run generate-docs
91
+ ```
61
92
 
62
93
  ## Requirements
63
94
 
@@ -0,0 +1,39 @@
1
+ @tool
2
+ extends RefCounted
3
+ class_name MCPCommandRouter
4
+
5
+ var _commands: Dictionary = {}
6
+ var _handlers: Array[MCPBaseCommand] = []
7
+
8
+
9
+ func setup(plugin: EditorPlugin) -> void:
10
+ _register_handler(MCPSystemCommands.new(), plugin)
11
+ _register_handler(MCPSceneCommands.new(), plugin)
12
+ _register_handler(MCPNodeCommands.new(), plugin)
13
+ _register_handler(MCPScriptCommands.new(), plugin)
14
+ _register_handler(MCPSelectionCommands.new(), plugin)
15
+ _register_handler(MCPProjectCommands.new(), plugin)
16
+ _register_handler(MCPFileCommands.new(), plugin)
17
+ _register_handler(MCPDebugCommands.new(), plugin)
18
+ _register_handler(MCPScreenshotCommands.new(), plugin)
19
+ _register_handler(MCPAnimationCommands.new(), plugin)
20
+ _register_handler(MCPTilemapCommands.new(), plugin)
21
+ _register_handler(MCPResourceCommands.new(), plugin)
22
+ _register_handler(MCPScene3DCommands.new(), plugin)
23
+
24
+
25
+ func _register_handler(handler: MCPBaseCommand, plugin: EditorPlugin) -> void:
26
+ handler.setup(plugin)
27
+ _handlers.append(handler)
28
+ var cmds := handler.get_commands()
29
+ for cmd_name in cmds:
30
+ _commands[cmd_name] = cmds[cmd_name]
31
+
32
+
33
+ func handle_command(command: String, params: Dictionary):
34
+ if not _commands.has(command):
35
+ return MCPUtils.error("UNKNOWN_COMMAND", "Unknown command: %s" % command)
36
+
37
+ var callable: Callable = _commands[command]
38
+ var result = await callable.call(params)
39
+ return result
@@ -0,0 +1 @@
1
+ uid://cwxw8hh1su5cg