RectangleEquals/godotmcp
If you are the rightful owner of godotmcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
GodotMCP is a Model Context Protocol server designed to facilitate AI-powered management of Godot game projects.
GodotMCP
AI-Powered Godot 4.4+ Project Management via Model Context Protocol
GodotMCP is a Model Context Protocol (MCP) server that enables Claude and other AI assistants to manage Godot game projects through the GodotAI GDExtension. It provides comprehensive project management, file operations, git-based modification tracking, and debugging capabilities—all with user approval workflows.
🎯 Features
- 📁 Project Management: Get project info, file structure, and Godot settings
- 📝 File Operations: Read, create, modify, and delete files with git tracking
- 🔄 Git Integration: Full git workflow with diff viewing, approval/denial, undo/redo
- 🐛 Debugging Support: Run and debug Godot projects through VS Code integration
- 🔒 Permission System: Granular folder access control and auto-approval rules
- ✅ User Approval: Review and approve all AI-suggested changes before applying
- 📊 Change History: Track and navigate through all modifications
🏗️ Architecture
Claude Desktop ↔ Docker MCP Toolkit ↔ GodotMCP (Docker) ↔ GodotAI (GDExtension) ↔ Godot Project
- GodotMCP: Python MCP server running in Docker, proxying requests between Claude and GodotAI
- GodotAI: C++ GDExtension running in your Godot project, performing actual file and git operations
- Communication: Async HTTP/SSE between GodotMCP and GodotAI, stdio for Claude Desktop
📋 Prerequisites
- Windows 10/11 with WSL 2
- Docker Desktop with MCP Toolkit beta feature enabled
- Claude Desktop for Windows
- Godot 4.4+ with your game project
- Python 3.11+ (for development)
🚀 Quick Start
1. Clone the Repository
git clone https://github.com/RectangleEquals/godotmcp.git
cd godotmcp
2. Run the Installation Script
Open PowerShell and run:
.\install.ps1
This will:
- Copy MCP configuration files to Docker MCP directories
- Build the Docker image
- Register the server with Docker Desktop
- Optionally configure Claude Desktop
3. Install GodotAI GDExtension
(GodotAI setup instructions will be provided separately)
- Download GodotAI from the releases page
- Extract to
res://addons/godotai/in your Godot project - Configure
res://addons/godotai/config.json - Enable the addon in Godot's Project Settings
4. Start Using in Claude Desktop
Open Claude Desktop and you can now use GodotMCP tools:
Can you show me the structure of my Godot project?
Create a new Player script at res://scripts/player.gd with basic movement code
Show me pending changes and let me approve them
🔧 Configuration
Environment Variables
GodotMCP supports the following environment variables:
| Variable | Default | Description |
|---|---|---|
MCP_HOST | 127.0.0.1 | Host for MCP server |
MCP_PORT | 8080 | Port for MCP server |
GODOTAI_HOST | host.docker.internal | Host where GodotAI is running |
GODOTAI_PORT | 9876 | Port where GodotAI is listening |
GODOTAI_TIMEOUT | 30 | Timeout for GodotAI requests (seconds) |
You can set these in your Docker configuration or when building the image.
GodotAI Configuration
Configure GodotAI by editing res://addons/godotai/config.json:
{
"listen_port": 9876,
"permissions": {
"allowed_folders": [
"res://scripts/**",
"res://scenes/**",
"res://assets/**"
],
"denied_folders": [
"res://addons/godotai/**"
]
},
"auto_approve": {
"patterns": [],
"max_file_size_kb": 0
},
"auto_deny": {
"patterns": [
"**/*.import",
".godot/**"
]
},
"max_undo_history": 50,
"enable_debug_mode": false
}
📚 Available Tools
Project Information
get_project_info- Get project name, Godot version, and settingsget_project_structure- Get complete file/folder structureget_git_status- Get current git status and history
File Operations
read_file(path)- Read file contentslist_files(directory)- List files in a directorysearch_files(pattern, directory)- Search for files matching a pattern
File Modifications (Git-Tracked)
create_file(path, content, commit_message)- Create a new filemodify_file(path, content, commit_message)- Modify existing filedelete_file(path, commit_message)- Delete a file
Git Workflow
get_pending_changes()- View changes awaiting approvalapprove_changes(change_ids)- Approve one or more changesdeny_changes(change_ids)- Deny and revert changesretry_change(change_id)- Deny and ask Claude to retryundo_changes(count)- Undo recent changesredo_changes(count)- Redo undone changesget_change_history(limit)- View change history
Debugging & Execution
run_project(scene)- Run the Godot projectdebug_project(scene, breakpoints)- Start debugging with VS Codestop_project()- Stop running/debugging projectget_debug_logs(since, level)- Get debug logs
Configuration
get_godotai_config()- Get GodotAI settingsupdate_godotai_config(config)- Update GodotAI settingshealth_check()- Check GodotAI connection status
🔄 Workflow Example
Creating and Approving Changes
-
Ask Claude to create a file:
Create a player controller script at res://scripts/player_controller.gd -
Claude uses
create_filetool - File is created and git-tracked -
View pending changes:
Show me what changes are pending approval -
Review the diff - Claude shows you the git diff
-
Approve or deny:
Approve all pending changesOR
Deny the last change and let's try again with more detailed comments -
Undo if needed:
Actually, undo the last 2 changes
🏗️ Project Structure
godotmcp/
├── src/
│ └── godot_mcp_server/
│ ├── __init__.py # Package init
│ └── server.py # Main MCP server
├── .mcp/
│ └── catalog/
│ ├── custom-catalog.yaml # MCP catalog config
│ └── v3/
│ └── tools/
│ └── godotmcp.json # Tool definitions
├── .claude/
│ └── claude_desktop_config.json # Claude Desktop config
├── Dockerfile # Docker container config
├── pyproject.toml # Python project config
├── install.ps1 # Windows installation script
├── README.md # This file
└── LICENSE # MIT License
🧪 Development
Building Locally
# Build Docker image
docker build -t godotmcp:latest .
# Run locally for testing
docker run -it --rm \
-e GODOTAI_HOST=host.docker.internal \
-e GODOTAI_PORT=9876 \
godotmcp:latest
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
# Type checking
mypy src/
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
MIT License - see file for details.
🔗 Related Projects
- GodotAI - The C++ GDExtension that GodotMCP communicates with (coming soon)
- calcmcp - The template MCP server this project is based on
- godot-plus-plus - Template for GDExtension projects
💬 Support
- Open an issue for bug reports or feature requests
- Check the Model Context Protocol documentation
- Join the discussion on GitHub Discussions
🙏 Acknowledgments
- Built on the Model Context Protocol
- Uses FastMCP for the server implementation
- Inspired by the need for better AI-assisted game development workflows
⚠️ Note: GodotMCP is currently in beta. The GodotAI GDExtension component is under active development.