defold-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@defold-mcpbuild the project and show me any errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Defold MCP
A production-quality Model Context Protocol (MCP) server that gives AI coding agents comprehensive control over a local Defold game-development project.
What it does
Defold MCP exposes Defold projects through structured MCP tools so an AI agent can:
Inspect project structure, settings, and resources
Read, write, and patch Lua scripts and Defold text resources
Search across the project
Analyze Lua scripts and resource dependencies
Modify collections, game objects, GUI files, and input bindings
Validate Lua syntax and resource references
Build and run the project through a local Defold installation
Parse build errors and diagnostics
Related MCP server: Gear
Requirements
Node.js 20+
A Defold project with a
game.projectfile(Optional) Defold editor/CLI for build/run integration
Installation
npm install
npm run buildRunning the MCP
node dist/index.js --project "C:\Path\To\Your\Defold\Game"Or with environment variables:
set DEFOLD_PROJECT_ROOT=C:\Path\To\Your\Defold\Game
set DEFOLD_MCP_LOG_LEVEL=info
node dist/index.jsCLI options
defold-mcp [options]
Options:
--project <path> Path to the Defold project root
--defold-path <path> Path to the Defold installation/CLI
--log-level <level> debug | info | warn | error (default: info)
--help, -h Show help
--version, -v Show versionMCP client configuration
Claude Code / generic stdio
{
"mcpServers": {
"defold": {
"command": "node",
"args": [
"C:\\Path\\To\\defold-mcp\\dist\\index.js",
"--project",
"C:\\Path\\To\\MyDefoldGame"
]
}
}
}Cursor
Add a new MCP server in Cursor settings pointing to:
Command:
nodeArgs:
C:\Path\To\defold-mcp\dist\index.js,--project,C:\Path\To\MyDefoldGame
VS Code
Use an MCP extension and configure a stdio server with the command above.
Security model
The server operates strictly inside the configured project root.
All paths are resolved and validated against the project root.
Path traversal, absolute paths outside the project, and symlink escapes are rejected.
Destructive operations (
delete_file,remove_game_object, etc.) requireconfirm: true.No arbitrary shell commands are exposed.
Only processes started by
defold_runcan be stopped viadefold_stop.
Available tools
Read-only
defold_get_project— project info and Defold detectiondefold_list_files— list project files and directoriesdefold_read_file— read a text filedefold_search— search project text filesdefold_analyze_lua— analyze a Lua scriptdefold_read_collection— read a collection structurallydefold_dependencies— direct/reverse dependencies of a resourcedefold_project_context— compact AI-friendly project summarydefold_analyze_project— project-wide analysis and issuesdefold_get_input_bindings— read input bindingsdefold_get_build_errors— parse build outputdefold_git_status— read-only Git status
Write
defold_write_filedefold_create_filedefold_apply_patchdefold_create_collectiondefold_add_game_object_to_collectiondefold_create_guidefold_create_gui_nodedefold_add_input_binding
Dangerous (require confirm: true)
defold_delete_filedefold_remove_game_object_from_collection
Build / run
defold_builddefold_rundefold_stopdefold_list_processesdefold_get_process_output— read captured stdout/stderr from a running/finished process
Development
npm run dev # watch build
npm test # run unit + integration tests
npm run lint # ESLint
npm run format # PrettierTests
The test suite includes:
Path security and traversal tests
Project detection and
game.projectparsingCollection parsing
Lua editing and patch tests
File creation and deletion confirmation tests
Build command and error parsing tests
Dependency analysis tests
Optional integration tests that skip if Defold is not installed
Windows notes
Paths with spaces and backslashes are supported.
Use Node's cross-platform APIs internally; no bash required.
Configure
--defold-pathorDEFOLD_PATHif Defold is not on PATH.
Known limitations
Defold build integration relies on
bob.jarbeing available. If only the editor executable is present, headless builds are limited.Lua analysis is lightweight regex-based; it is not a full AST parser.
Some advanced Defold features (e.g., complex component properties) may require manual editing.
Debug loop: build → run → inspect
To know whether a change actually works, the AI should follow this loop instead of guessing:
defold_build— build the project.defold_get_build_errors— extract errors, warnings, and file/line info.defold_read_file— inspect the offending files.defold_apply_patch— make a focused fix.defold_validate— validate Lua syntax and resource references.defold_run— launch the game.defold_get_process_output— read captured runtime stdout/stderr.Repeat from step 1 until the build succeeds and the game runs cleanly.
defold_get_process_output is the key to confirming the game works: it returns everything the running Defold process prints, including Lua runtime errors, warnings, and print()/pprint() output.
Final acceptance test
The repository includes an automated acceptance path that exercises the core AI workflow:
npm testThis runs the full suite against tests/fixtures/sample-project, which performs:
Loads the sample Defold project.
Calls
defold_get_project/defold_project_context.Finds
player/player.script.Reads
player/player.script.Applies a focused patch to
player/player.script.Validates the project with
defold_validate.Builds the project with
defold_buildif Defold is installed.Parses build results with
defold_get_build_errors.Reports changed files and diagnostics.
Recommended next features
Full game object/component modification tools
Sprite/atlas/tilesource creation helpers
Deeper message flow analysis (
defold_find_messages)Project indexing and caching for large projects
HTTP/SSE transport support
Author
GitHub: zrnge/defold-mcp
Website: zrnge.github.io
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that gives AI assistants direct control over Godot 4 game development projects. It enables launching the editor, running projects, creating and editing scenes, writing GDScript, and inspecting assets through natural language commands.44304MIT
- AlicenseAqualityBmaintenanceAn MCP server that enables AI assistants to directly run, inspect, modify, and debug Godot game development projects through 110+ tools covering scenes, scripts, resources, runtime debugging, and asset management.33212MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables AI agents to interact with the Godot game engine by launching the editor, running projects, capturing debug output, and managing scenes and resources. It provides tools for project analysis, scene creation, and execution control to help agents understand and debug Godot projects in real-time.14MIT
- Alicense-qualityCmaintenanceLocal MCP server that gives AI agents 44 engine tools to build, run, and debug real 2D and 3D games through conversation.MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zrnge/defold-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server