A comprehensive integration between Godot Engine and AI assistants using the Model Context Protocol (MCP). This plugin allows AI assistants to interact with your Godot projects, providing powerful capabilities for code assistance, scene manipulation, and project management.
- Full Godot Project Access: AI assistants can access and modify scripts, scenes, nodes, and project resources
- Two-way Communication: Send project data to AI and apply suggested changes directly in the editor
- Command Categories:
- Node Commands: Create, modify, and manage nodes in your scenes
- Script Commands: Edit, analyze, and create GDScript files
- Scene Commands: Manipulate scenes and their structure
- Project Commands: Access project settings and resources
- Editor Commands: Control various editor functionality
- Enhanced Commands: Access full scene tree, debug output, and asset management
This fork adds several significant improvements:
- Complete Scene Tree Visibility: Retrieve the entire scene hierarchy with
get_full_scene_tree - Dynamic Script Access: Read and write any script by path with dynamic resource templates
- Asset Management: Query and organize project assets by type (images, audio, models, etc.)
- Debug Output Access: Retrieve runtime debug logs from the Godot editor
- AI Script Generation: Generate script templates from natural language descriptions
- Node Transform Tools: Easily update node position, rotation and scale
git clone https://github.com/waefrebeorn/Godot-MCP.git
cd Godot-MCPcd server
npm install
npm run build
# Return to project root
cd ..-
Edit or create the Claude Desktop config file:
# For macOS nano ~/Library/Application\ Support/Claude/claude_desktop_config.json # For Windows (PowerShell) notepad "$env:APPDATA\Claude\claude_desktop_config.json"
-
Add the following configuration (or use the included
claude_desktop_config.jsonas a reference):{ "mcpServers": { "godot-mcp": { "command": "node", "args": [ "PATH_TO_YOUR_PROJECT/server/dist/index.js" ], "env": { "MCP_TRANSPORT": "stdio" } } } }Note: Replace
PATH_TO_YOUR_PROJECTwith the absolute path to where you have this repository stored. -
Restart Claude Desktop
- Open Godot Engine
- Select "Import" and navigate to the cloned repository
- Open the
project.godotfile - The MCP plugin is already enabled in this example project
After setup, you can work with your Godot project directly from Claude using natural language. Here are some examples:
@mcp godot-mcp read godot://script/current
I need help optimizing my player movement code. Can you suggest improvements?
@mcp godot-mcp run get-full-scene-tree
Add a cube in the middle of the scene and then make a camera that is looking at the cube.
@mcp godot-mcp read godot://scene/current
Create an enemy AI that patrols between waypoints and attacks the player when in range.
@mcp godot-mcp read godot://script/res://scripts/player.gd
Please analyze this player script and suggest improvements.
@mcp godot-mcp run ai_generate_script --description "A health system with damage and healing" --node_type "Node"
Implement this health system in my game.
@mcp godot-mcp run list_assets_by_type --type images
Show me all the images in my project and help me organize them better.
- "Create a main menu with play, options, and quit buttons"
- "Add collision detection to the player character"
- "Implement a day/night cycle system"
- "Refactor this code to use signals instead of direct references"
- "Debug why my player character falls through the floor sometimes"
- "Show me the full structure of my scene tree and explain the relationships"
- "Generate a script for enemy AI that follows the player"
godot://script/current- The currently open scriptgodot://script/{path}- Any script by path (NEW)godot://scene/current- The currently open scenegodot://scene/tree- Complete scene tree hierarchy (NEW)godot://project/info- Project metadata and settingsgodot://assets/{type}- Assets of specific type (NEW)godot://debug/log- Debug output from editor (NEW)
get-scene-tree- Returns the scene tree structureget-node-properties- Gets properties of a specific nodecreate-node- Creates a new nodedelete-node- Deletes a nodemodify-node- Updates node properties
list-project-scripts- Lists all scripts in the projectread-script- Reads a specific scriptmodify-script- Updates script contentcreate-script- Creates a new scriptanalyze-script- Provides analysis of a script
list-project-scenes- Lists all scenes in the projectread-scene- Reads scene structurecreate-scene- Creates a new scenesave-scene- Saves current scene
get-project-settings- Gets project settingslist-project-resources- Lists project resources
get-editor-state- Gets current editor staterun-project- Runs the projectstop-project- Stops the running project
get_full_scene_tree- Gets complete hierarchical scene structureget_debug_output- Retrieves debug logs from editorupdate_node_transform- Updates node position, rotation, and scalelist_assets_by_type- Lists project assets by typeai_generate_script- Generates script templates from descriptions
- Ensure the plugin is enabled in Godot's Project Settings
- Check the Godot console for any error messages
- Verify the server is running when Claude Desktop launches it
- Reload Godot project after any configuration changes
- Check for error messages in the Godot console
- Make sure all paths in your Claude Desktop config are absolute and correct
If you want to use the MCP plugin in your own Godot project:
- Copy the
addons/godot_mcpfolder to your Godot project'saddonsdirectory - Open your project in Godot
- Go to Project > Project Settings > Plugins
- Enable the "Godot MCP" plugin
This fork adds several new files to the original project:
server/src/resources/asset_resources.ts- Asset querying functionalityserver/src/resources/debug_resources.ts- Debug output accessserver/src/tools/ai_script_tools.ts- AI script generationaddons/godot_mcp/mcp_enhanced_commands.gd- Enhanced command processoraddons/godot_mcp/mcp_script_resource_commands.gd- Script resource processoraddons/godot_mcp/mcp_asset_commands.gd- Asset commands processor
Contributions are welcome! Please feel free to submit a Pull Request to the GitHub repository.
For more detailed information, check the documentation in the docs folder:
This project is licensed under the MIT License - see the LICENSE file for details.