{"slug": "the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box", "title": "The Godot MCP server installs cleanly. Then every run_project call fails on a headless box", "summary": "A developer found that the Godot MCP server (@coding-solo/godot-mcp) installs and lists its 14 tools correctly, but its run_project handler builds the launch command as ['-d', '--path', projectPath] without a --headless flag, so on a machine with no display server the engine exits at startup and get_debug_output always returns 'No active Godot process.' The fix is to point GODOT_PATH at a small shell wrapper that appends --display-driver headless before exec, after which run_project returns a 154-byte response and get_debug_output returns 1,949 bytes including the project's own print output. The developer also notes that get_debug_output only reads from a live process, so output must be read while the project is still running.", "body_md": "You add the server the way its README says:\n\n```\nclaude mcp add godot \\\n  -e GODOT_PATH=/usr/local/bin/godot \\\n  -- npx @coding-solo/godot-mcp\n```\n\n`tools/list` comes back with 14 tools. `run_project` answers like it worked:\n\n```\nGodot project started in debug mode. Use get_debug_output to see output.\n```\n\nThen `get_debug_output` answers, every single time:\n\n```\nNo active Godot process.\n```\n\nNo stack trace, no stderr, nothing in the client log. The project never started, and nothing in the response says why.\n\nIts troubleshooting section has four entries: *Godot Not Found*, *Connection Issues*, *Invalid Project Path*, *Build Issues*. None of them is \"the engine started and died\". The word `headless` appears zero times in the README (I re-fetched `main` today to be sure). So the reasonable thing is to go check your own setup first.\n\nCheck the binary before you suspect the MCP layer:\n\n```\n./godot-headless --version\n4.7.2.stable.official.ed1daf0bf\n```\n\nThe engine runs. The MCP server answers `tools/list`, so Node and the client config are fine. What's left is the hand-off between the two.\n\nIn `index.js`, `handleRunProject` builds the command like this:\n\n``` js\nconst cmdArgs = ['-d', '--path', args.projectPath];\n```\n\nNo `--headless`. `-d` is debug mode, and debug mode wants a display. On a box with no display server the engine exits on startup, `handleGetDebugOutput` finds no active process, and returns that string. The message is accurate — there really is no process. It just doesn't tell you why there isn't one.\n\n`GODOT_PATH` at a wrapper, not at the binary\n\n``` bash\n#!/bin/sh\n# /opt/godot/godot-headless\nexec /opt/godot/Godot_v4.7.2-stable_linux.x86_64 --display-driver headless \"$@\"\n```\n\n`chmod +x` it, then restart the MCP client with `GODOT_PATH` pointing at the wrapper. The server still sends `-d --path …`; the wrapper adds the display driver before `exec`. Client config, for reference:\n\n```\n{\n  \"mcpServers\": {\n    \"godot\": {\n      \"command\": \"npx\",\n      \"args\": [\"@coding-solo/godot-mcp\"],\n      \"env\": { \"GODOT_PATH\": \"/opt/godot/godot-headless\" }\n    }\n  }\n}\n```\n\nThe trade you are making: every Godot invocation from that client is now headless, including editor launches. On a server or CI box that is the right trade. On your laptop it is the wrong one, and you probably never need the wrapper at all.\n\nSame client, same project, one env var different:\n\n`run_project` → `Godot project started in debug mode. Use get_debug_output to see output.` (a 154-byte JSON response)`get_debug_output` → 1,949 bytes. First line: `Godot Engine v4.7.2.stable.official.ed1daf0bf - https://godotengine.org`. Inside the output array, the project's own print: `CD10I_HELLO from cd10i-demo`.`./godot-headless -d --path proj`, exit 0 — prints the same line. That is how you know the MCP path isn't adding or hiding anything.\nThe demo project is three files: `project.godot` (148 B), `main.tscn` (149 B), `main.gd` (131 B). The whole loop — write project, run, read output — takes minutes, which matters when you are debugging the tool wrapper rather than the game.\n\n`get_debug_output` reads from a live process, and the server clears its active process handle when the project quits by itself. A project that prints one line and calls `get_tree().quit()` gives you a real response if you read at ~3 seconds, and `No active Godot process.` again at 10. Our test project lives about 8 seconds for exactly that reason.\n\nSo: read the output while the thing is still running, or make the project wait. A polling loop that retries every 20 seconds will look like the server is broken when it is just late.\n\nIf you build a pass/fail check on top of this, prove it can go red before you trust a green:\n\n```\nrun_project {\"projectPath\": \"/root/nope\"}\n→ Not a valid Godot project: /root/nope\n   isError: true\n   Possible solutions: …\n```\n\n(The path in that output is whatever you passed — in our first run it was `/root/cd10i/gd_missing`, and the message echoed it back.)\n\nA success check that has never returned false isn't measuring anything. The same applies to the fix above: keep one project path that fails so you can test the harness itself.\n\n`--display-driver` behaviour, and I have no run to show.`4.7.2.stable.official` only. Older versions may not accept the same flags.`@coding-solo/godot-mcp` 0.1.1 — the version current when this was written.\nIf your machine has a display server, none of this fires. The wrapper is for the box that doesn't.\n\nThe four-step version of this, with the exact commands and the copy buttons, is here: [Game development · step by step](https://anclum.com/en/scene/game-dev/).", "url": "https://wpnews.pro/news/the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box", "canonical_source": "https://dev.to/anclum/the-godot-mcp-server-installs-cleanly-then-every-runproject-call-fails-on-a-headless-box-2kk", "published_at": "2026-11-25 09:06:44+00:00", "updated_at": "2026-11-25 09:13:24.518577+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "agent-protocols"], "entities": ["Godot", "@coding-solo/godot-mcp", "Claude", "Godot Engine 4.7.2"], "also_reported_by": [], "takeaway": "The Godot MCP server's run_project omits --headless, so on a display-less box the engine dies silently; wrap the binary in a script that adds --display-driver headless and read get_debug_output while the project is still running.", "recommendation": {"advice": "When an MCP tool reports success but its follow-up returns nothing, check the command the server actually builds and wrap the binary to add missing flags like --display-driver headless.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box", "markdown": "https://wpnews.pro/news/the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box.md", "text": "https://wpnews.pro/news/the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box.txt", "jsonld": "https://wpnews.pro/news/the-godot-mcp-server-installs-cleanly-then-every-run-project-call-fails-on-a-box.jsonld"}}