Godot MCP Enhanced
An enhanced MCP server for interacting with the Godot game engine, enabling AI assistants to launch the editor, run projects, manage scenes and nodes, and handle scripts.
README
Godot MCP Enhanced
An enhanced Model Context Protocol (MCP) server for interacting with the Godot game engine. This server enables AI assistants to launch the Godot editor, run projects, manage scenes and nodes, handle scripts, and much more.
Features
Project Management
- Launch Godot Editor: Open the Godot editor for a specific project
- Run Godot Projects: Execute Godot projects in debug mode with output capture
- Capture Debug Output: Retrieve console output and error messages in real-time
- Control Execution: Start and stop Godot projects programmatically
- Get Godot Version: Retrieve the installed Godot version
- List Godot Projects: Find Godot projects in a specified directory
- Project Analysis: Get detailed information about project structure
Scene Management
- Create Scenes: Create new scenes with specified root node types
- Add Nodes: Add nodes to existing scenes with customizable properties
- Load Sprites: Load textures into Sprite2D nodes
- Save Scenes: Save scenes with options for creating variants
Script Management
- Create Scripts: Generate GDScript files with various templates:
- Empty template
- Node2D/Node3D/Control templates
- CharacterBody2D/CharacterBody3D with movement code
- Attach Scripts: Attach scripts to nodes in scenes
UID Management (Godot 4.4+)
- Get UID: Retrieve the unique identifier for specific files
- Update Project UIDs: Resave resources to update UID references
Export Operations
- Export Mesh Library: Export 3D scenes as MeshLibrary resources for GridMap
Requirements
- Godot Engine 4.x installed on your system
- Node.js (>=18.0.0) and npm
- An MCP-compatible AI assistant (Claude, Cline, Cursor, etc.)
Installation
Quick Start with Claude Code
claude mcp add godot -- npx @xinyuzjj/godot-mcp
With environment variables:
claude mcp add godot -e GODOT_PATH=/path/to/godot -e DEBUG=true -- npx @xinyuzjj/godot-mcp
Cline
Add to your Cline MCP settings file:
{
"mcpServers": {
"godot": {
"command": "npx",
"args": ["@xinyuzjj/godot-mcp"],
"env": {
"DEBUG": "true"
},
"disabled": false,
"autoApprove": [
"launch_editor",
"run_project",
"get_debug_output",
"stop_project",
"get_godot_version",
"list_projects",
"get_project_info",
"create_scene",
"add_node",
"load_sprite",
"save_scene",
"create_script",
"attach_script",
"get_uid",
"update_project_uids",
"export_mesh_library"
]
}
}
}
Cursor
Using the Cursor UI:
- Go to Cursor Settings > Features > MCP
- Click on the + Add New MCP Server button
- Fill out the form:
- Name:
godot - Type:
command - Command:
npx @xinyuzjj/godot-mcp
- Name:
- Click "Add"
- You may need to press the refresh button to populate the tool list
Using Project-Specific Configuration:
Create a file at .cursor/mcp.json in your project directory:
{
"mcpServers": {
"godot": {
"command": "npx",
"args": ["@xinyuzjj/godot-mcp"],
"env": {
"GODOT_PATH": "/path/to/godot",
"DEBUG": "true"
}
}
}
}
Other MCP Clients
For any MCP-compatible client, use this configuration:
{
"mcpServers": {
"godot": {
"command": "npx",
"args": ["@xinyuzjj/godot-mcp"],
"env": {
"GODOT_PATH": "/path/to/godot",
"DEBUG": "true"
}
}
}
}
Environment Variables
| Variable | Description |
|---|---|
GODOT_PATH |
Path to the Godot executable (overrides automatic detection) |
DEBUG |
Set to "true" to enable detailed server-side debug logging |
Building from Source
git clone https://github.com/xinyuzjj/godot-mcp.git
cd godot-mcp
npm install
npm run build
Then point your MCP client to build/index.js instead of using npx.
Architecture
The Godot MCP server uses a bundled GDScript approach for complex operations:
- Direct Commands: Simple operations like launching the editor or getting project info use Godot's built-in CLI commands directly.
- Bundled Operations Script: Complex operations like creating scenes or adding nodes use a comprehensive GDScript file (
godot_operations.gd) that handles all operations.
The bundled script accepts operation type and parameters as JSON, allowing for flexible and dynamic operation execution without generating temporary files for each operation.
Available Tools
| Tool | Description |
|---|---|
launch_editor |
Launch Godot editor for a specific project |
run_project |
Run the Godot project and capture output |
get_debug_output |
Get the current debug output and errors |
stop_project |
Stop the currently running Godot project |
get_godot_version |
Get the installed Godot version |
list_projects |
List Godot projects in a directory |
get_project_info |
Retrieve metadata about a Godot project |
create_scene |
Create a new Godot scene file |
add_node |
Add a node to an existing scene |
load_sprite |
Load a sprite into a Sprite2D node |
save_scene |
Save changes to a scene file |
create_script |
Create a new GDScript file |
attach_script |
Attach a script to a node in a scene |
get_uid |
Get the UID for a specific file (Godot 4.4+) |
update_project_uids |
Update UID references in a project (Godot 4.4+) |
export_mesh_library |
Export a scene as a MeshLibrary resource |
Supported Node Types
The server supports creating the following node types:
- Basic: Node, Node2D, Node3D, Control
- Physics: CharacterBody2D, CharacterBody3D, RigidBody2D, RigidBody3D, StaticBody2D, StaticBody3D, Area2D, Area3D
- Visual: Sprite2D, Sprite3D, AnimatedSprite2D, Camera2D, Camera3D
- UI: Label, Button, Panel, ColorRect, TextureRect, ProgressBar
- Audio: AudioStreamPlayer, AudioStreamPlayer2D, AudioStreamPlayer3D
- Animation: AnimationPlayer, AnimationTree
- Collision: CollisionShape2D, CollisionShape3D
- Navigation: NavigationRegion2D, NavigationRegion3D, NavigationAgent2D, NavigationAgent3D
- Lighting: PointLight2D, DirectionalLight2D, DirectionalLight3D, OmniLight3D, SpotLight3D
- And many more...
Troubleshooting
- Godot Not Found: Set the
GODOT_PATHenvironment variable to your Godot executable path - Connection Issues: Ensure the server is running and restart your AI assistant
- Invalid Project Path: Ensure the path points to a directory containing a
project.godotfile - Build Issues: Make sure all dependencies are installed by running
npm install
Cursor-Specific Issues
- Ensure the MCP server shows up and is enabled in Cursor settings (Settings > MCP)
- MCP tools can only be run using the Agent chat profile (Cursor Pro or Business subscription)
- Use "Yolo Mode" to automatically run MCP tool requests
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the original Coding-Solo/godot-mcp project
- Built with the Model Context Protocol
- Powered by Godot Engine
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。