Godot MCP is a server implementation of the Model Context Protocol (MCP) that enables AI assistants to interact with the Godot game engine. It allows assistants to launch the Godot editor, run projects, capture debug output, and control project execution through a standardized interface, creating a direct feedback loop for better code generation and debugging assistance.
Clone the repository and build the MCP server:
git clone https://github.com/Coding-Solo/godot-mcp.git
cd godot-mcp
npm install
npm run build
Add to your Claude MCP settings file:
{
"mcpServers": {
"godot": {
"command": "node",
"args": ["/absolute/path/to/godot-mcp/build/index.js"],
"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",
"export_mesh_library",
"save_scene",
"get_uid",
"update_project_uids"
]
}
}
}
Using the Cursor UI:
godot
(or any name you prefer)command
node /absolute/path/to/godot-mcp/build/index.js
Using Project-Specific Configuration:
Create a file at .cursor/mcp.json
in your project directory:
{
"mcpServers": {
"godot": {
"command": "node",
"args": ["/absolute/path/to/godot-mcp/build/index.js"],
"env": {
"DEBUG": "true"
}
}
}
}
Customize server behavior with these environment variables:
GODOT_PATH
: Path to the Godot executable (overrides automatic detection)DEBUG
: Set to "true" to enable detailed server-side debug loggingYour AI assistant will automatically run the MCP server when needed. Use the following example prompts:
Launch the Godot editor for a specific project:
Launch the Godot editor for my project at /path/to/project
Run a Godot project and view debug output:
Run my Godot project and show me any errors
Get project information:
Get information about my Godot project structure
Create a new scene:
Create a new scene with a Player node in my Godot project
Add nodes to scenes:
Add a Sprite2D node to my player scene and load the character texture
Export 3D models:
Export my 3D models as a MeshLibrary for use with GridMap
UID Management:
Get the UID for a specific script file in my Godot 4.4 project
Update UID references in my Godot project after upgrading to 4.4
npm install
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "godot" '{"command":"node","args":["/absolute/path/to/godot-mcp/build/index.js"],"env":{"DEBUG":"true"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"godot": {
"command": "node",
"args": [
"/absolute/path/to/godot-mcp/build/index.js"
],
"env": {
"DEBUG": "true"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"godot": {
"command": "node",
"args": [
"/absolute/path/to/godot-mcp/build/index.js"
],
"env": {
"DEBUG": "true"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect