An MCP server that gives AI coding agents first-class access to the Defold game engine: inspect and edit projects, build and bundle with bob, run games locally, hot-reload code into a live game, drive the running engine, and search the official API reference.
MCP server + desktop app for the Defold game engine: AI agents can build, bundle, run, hot-reload and inspect Defold projects, drive the running engine, and search the API reference
स्टार
13
टूल
—
अपटाइम
—
Everything works headlessly — no Defold editor required. A desktop app manages the server, streams its activity to a live console, and auto-configures your AI agents.
Features
Project intelligence — parse game.project, collections, game objects, GUI scenes, atlases and any other text-format resource into structured JSON; outline Lua scripts (functions, go.property definitions, requires, handled messages); find references to any asset before renaming or deleting it.
Build pipeline — download/cache bob.jar per Defold version, compile with structured error diagnostics (resource, line, message), bundle for all supported platforms, resolve dependencies.
Run & debug loop — download/cache the dmengine dev binary, launch the game in the background, read its logs incrementally, stop it gracefully.
Live engine control — hot reload changed scripts/resources into the running game (the same mechanism the editor uses), toggle the profiler and physics debug, set frame cap and vsync, record gameplay video, reboot or exit the engine, and stream engine logs over TCP — including from editor-launched games and devices on the network.
Visual feedback — screenshot the running game as an image the agent can actually look at, to verify rendering, layout and UI (not just logs).
API documentation — search and read the official Defold API reference for the exact engine version you build with (go, gui, msg, sys, physics, render, editor scripting, native extension SDK, ...).
Requirements
Node.js >= 18
Java (JDK 17+, 21+ recommended) — only for the build tools (defold_build, defold_bundle, defold_resolve_dependencies). Everything else works without Java. Install from Adoptium or brew install openjdk.
Network access on first use of a Defold version (downloads bob.jar, dmengine, API docs from official Defold servers into ~/.defold-mcp).
Installation
git clone https://github.com/Fulviuus/defold-mcp.git && cd defold-mcp
npm install
npm run build # produces dist/index.js
npm test # optional: 46 unit + end-to-end tests
Desktop app (recommended for multi-agent setups)
A Tauri app in desktop/ manages the server for you: a live console of
everything the server does (every tool call, build output, engine logs), start/stop
with a chosen host/port, and one-click configuration of AI agents (Claude Code,
Claude Desktop, Codex CLI, Cursor, Gemini CLI, VS Code Copilot, Windsurf, Cline, Zed).
cd desktop
npm install
npm run dev # run the app (requires Rust toolchain)
npm run build # produce a distributable bundle (.app / .msi / .deb)
In the app: pick host/port → Start server → choose an agent from the dropdown →
Configure. The app merges a defold entry into that agent's own config file
(backing up the original) pointing at http://127.0.0.1:<port>/mcp. All connected
agents share this one server instance, and its activity streams into the console.
Transports
The server speaks both MCP transports:
stdio (default) — the client spawns the server itself: node dist/index.js
Streamable HTTP — one long-lived server many clients connect to:
node dist/index.js --transport http --host 127.0.0.1 --port 9810
(MCP endpoint at /mcp, status at /health). This is what the desktop app runs.
DNS-rebinding protection is enabled on loopback binds; binding 0.0.0.0 is
possible for LAN use but exposes the endpoint to your network — only do this on
trusted networks.
Claude Code
claude mcp add defold -- node /path/to/defold-mcp/dist/index.js
Raise tool_timeout_sec (default 60 s): first builds download platform packages and can run for minutes; Codex kills slower tool calls.
Codex sanitizes the server environment (only HOME, PATH, USER, ... survive). JAVA_HOME and DEFOLD_PROJECT_ROOT are not inherited from your shell — set them in the env table, or whitelist shell vars with env_vars = ["JAVA_HOME"].
(or the same mcpServers JSON block as Claude Desktop in ~/.gemini/settings.json; note gemini mcp add defaults to project scope — -s user makes it global. Per-server "timeout" is in ms, default 600000.)
Cursor / Claude Desktop / Windsurf / Cline
All use the same mcpServers JSON shape — only the file location differs:
Client
File
Cursor
.cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
In Cursor, "DEFOLD_PROJECT_ROOT": "${workspaceFolder}" works. Cursor only forwards ~40 tools to the agent across all servers — disable unused servers if you hit the cap.
VS Code (GitHub Copilot agent mode)
.vscode/mcp.json — note the top-level key is servers, not mcpServers:
The server is a standard stdio MCP server, so anything that speaks MCP works. You only ever configure three things:
Launch: node /path/to/defold-mcp/dist/index.js
DEFOLD_PROJECT_ROOT (optional): if the agent's working directory is inside the game project, the server finds game.project by walking upward and no env var is needed.
JAVA_HOME (optional): only needed for defold_build/defold_bundle/defold_resolve_dependencies when java is not on the PATH the client gives the server.
If the client enforces per-tool timeouts, raise them for the build tools (first builds can take minutes).
Environment variables
Variable
Purpose
DEFOLD_PROJECT_ROOT
Default project root (directory containing game.project). Tools also accept an explicit project_root argument, and fall back to searching upward from the working directory.
Stream the engine TCP log service (works for editor-launched games and devices too).
defold_editor_logs
Stream the running Defold editor's console (build + engine output) via its /console/stream HTTP endpoint (Defold 1.13.0+).
defold_screenshot
Capture a screenshot of the running game as a viewable image, so agents can visually verify rendering/layout/UI (macOS; requires Screen Recording permission).
API reference
Tool
Description
defold_api_search
Ranked search across the full API reference for a given engine version.
defold_api_doc
Full docs for an element (go.animate) or a namespace index (go), with parameters, returns and examples.
Trailing c convention: game.project stores some bootstrap resources in compiled form — bootstrap.main_collection = /main/main.collectionc (note the c). defold_set_setting appends it automatically for the six affected keys (bootstrap.main_collection, bootstrap.render, bootstrap.debug_init_script, input.game_binding, input.gamepads, display.display_profiles).
Hot reload maps source paths to built paths (.script → .scriptc, .atlas → .texturesetc, images → .texturec, ...) and posts them to the engine service (POST /post/@resource/reload, binary protobuf) — the same protocol the editor uses. It requires a debug build whose build/default output is in sync with the running game.
Engine service: debug builds listen on port 8001 (/info, /ping, /post/...). For devices, pass the device IP as host.
Native extensions: projects with native-code dependencies are compiled via Defold's cloud build servers when bob builds; this happens transparently but requires network access.
Security notes
The server is a local development tool over stdio; it does not listen on any network port.
File-writing tools resolve paths against the project root and reject traversal outside it.
Toolchain artifacts are downloaded only from d.defold.com and github.com/defold/defold releases, and cached locally.
defold_engine_* tools talk to whatever host you point them at (default localhost); they send engine control messages, never project source.
Development
npm run dev # run from TypeScript sources
npm test # build + unit & e2e tests (no Java/network needed)
node test/live-smoke.mjs # live network smoke (downloads toolchain, queries real docs)
node test/live-smoke.mjs --full # + real build/run/hot-reload loop (needs Java)
Test layout: test/fixture is a minimal valid Defold project; test/server.test.mjs drives the server through a real MCP stdio client, with a fake engine HTTP/TCP service standing in for a running game.
License
MIT
D
Defold
Fulviuus·13 स्टार·
MCP server + desktop app for the Defold game engine: AI agents can build, bundle, run, hot-reload and inspect Defold projects, drive the running engine, and search the API reference
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
सवाल
Defold कैसे इंस्टॉल करें?
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
क्या Defold के लिए API key चाहिए?
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Defold कौन सा ट्रांसपोर्ट इस्तेमाल करता है?
Defold stdio पर लोकल चलता है।
Defold की पिछली जाँच कब हुई थी?
पिछली जाँच 2026-10-28 को हुई। MCP server + desktop app for the Defold game engine: AI agents can build, bundle, run, hot-reload and inspect Defold projects, drive the running engine, and search the API reference