Skip to content
Proyectos

Acerca de

DSH (DeepSeek Harness) plugin that launches and drives a running Godot 4.x game through its in-game TCP interaction server — replaces the godot-mcp MCP server with native agent tools.

Juegos y emulación

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
-1
in 7 days
0
in 15 days
+3
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

English | 中文

godot-bridge

Awesome DSH Plugin Listed on DSH Directory

What it is

GodotBridge is a native DeepSeek Harness (DSH) plugin for AI-assisted game development. It ships as two components:

  • GodotBridge connects to a running Godot 4.x game through its in-game TCP server, so the agent can inspect the current frame, operate the game, and verify changes. It also creates and edits project scripts, scenes, resources, settings, and headless export operations.
  • Task Center builds on DSH's native agent teams and turns a request into a task pipeline: requirement alignment, implementation, independent review, independent testing, and merge. Each task runs in its own git worktree with dependency ordering and file locks, so unrelated tasks can run in parallel without overwriting each other.

Activate the task center in chat with:

/godot-bridge-task-center-init

Then align the requirement with the agent and create a development or investigation card. A completed card is reviewed and tested independently before the host merges it; if the target moves or a conflict appears, the candidate is rebuilt and retested instead of being merged stale.

GodotBridge is open source on GitHub and listed in the DSH plugin market. The task center itself is developed through the task center.

Under the hood

Native DeepSeek Harness (DSH) plugin that launches and drives a running Godot 4.x game through its in-game TCP interaction server — replacing the godot-mcp MCP server with first-class agent tools.

No MCP protocol, no Python server, no editor addon. The game side is untouched: McpInteractionServer (the mcp_interaction_server.gd autoload) already listens on 127.0.0.1:9090 and speaks newline-delimited JSON — godot-bridge speaks the same protocol natively from inside the DSH host.

Tools

godot_run_project starts without the local debugger (-d) by default, so godot_command eval works normally. debug:true is diagnostic mode: the instance runs with the local debugger, the interaction server refuses eval (it learns this from the GODOT_BRIDGE_DEBUGGER=1 environment variable the bridge sets at spawn — Godot consumes -d before OS.get_cmdline_args() can see it, measured on 4.7.2, so an argv check alone never fires) (a syntax error would otherwise enter the interactive debug> prompt and deadlock, issue #13), and a script error returns a debuggerTrace (break reason, *Frame N stack frames with file:line, ≤4 KB raw tail) plus a next step and ends that run. In diagnostic mode the bridge watches stdout for the debugger and writes exactly one quit (never continue), then classifies the outcome by exit code: exit 0 → diagnosis: "debugger-quit"; any non-zero code → diagnosis: "debugger-trap" with exitCode and crash: true; still running after 3 s → debugger-trap with killed: true. The classification is deliberately honest: on Godot 4.7.2-stable win64 writing quit exits in ~38 ms with 3221225477 (0xC0000005, ACCESS_VIOLATION) and a C++ backtrace, so that run is reported as a crash trap, not as a graceful exit. Measured regression baseline (minimal project + syntax-error script): without -d the process exits in ~372 ms with SCRIPT ERROR … at: GDScript::reload; with -d and stdin at EOF it prints 12089 Debugger Break/debug> lines in 3 s (1.78 MB, ~590 KB/s) and must be killed — the issue #13 loop; with -d and a stdin pipe only one break/prompt appears (2.4 KB) because the debugger waits for input. To run code under the debugger, use godot_run_headless --script.

Tool Replaces (godot-mcp) Purpose
godot_run_project run_project Launch the project (godot --path …, no local debugger by default), wait for port 9090. debug:true = diagnostic mode (-d, eval disabled, script errors return debuggerTrace)
godot_stop_project stop_project Terminate the game process (tree-scoped kill)
godot_get_debug_output get_debug_output Incremental stdout/stderr of the launched process
godot_command all game_* (~105) Send any interaction-server command: get_scene_tree, get_ui_elements, eval, get/set_property, call_method, click, key_press, screenshot, raycast, serialize_state, ui_*, …
godot_screenshot game_screenshot Viewport capture as base64 PNG
godot_ping — Probe whether the game answers on 9090 (also reports installed/latest plugin version, and responsive:false when the port accepts but never answers)
godot_set_engine_path — Persist the Godot engine executable path into the plugin's config (the model asks the user for it, then saves it here; hot-reloaded — reports persisted: 'profile-patch')
godot_headless_op read_scene, modify_scene_node, remove_scene_node, attach_script, create_resource, save_scene, create_scene, add_node, get_uid, manage_scene_signals, … Headless static operations (godot --headless --script godot_operations.gd): 16 ops, no running game needed
godot_run_headless — Bounded non-interactive run of the project, a scene, or a test script (godot --headless --path … [--quit-after N] [--script …]) through the unconfined subprocess service; returns stdout/stderr and flags a sandbox-crash diagnosis
godot_validate_script validate_script Headless GDScript compile-check via validate_script.gd → {valid, errors}
godot_set_project_setting modify_project_settings, set_main_scene, manage_layers, manage_plugins, manage_translations Set a typed key in any project.godot section (PackedStringArray(...) / Vector2i(...) / bool / …)
godot_manage_autoloads manage_autoloads List / add / remove autoload singletons (Name="*res://…")
godot_manage_input_map manage_input_map List / add / remove input actions — correct Godot 4 keycodes (fixes godot-mcp's Godot 3 baseline bug)
godot_manage_export_presets manage_export_presets List / add / remove export presets (export_presets.cfg)
godot_create_script create_script GDScript template (extends / class_name / method stubs / source)
godot_create_project create_project / create_csharp_script Project scaffold, optional Godot .NET .csproj
godot_export_project export_project Headless export (--export-release / --export-debug <preset> <output>)

The remaining godot-mcp tools were implemented in the MCP server's own Node process: pure file/editor operations are covered by DSH's native file tools, while a handful carry Godot-specific write logic (manage_input_map, manage_export_presets, modify_project_settings, project/script templates) that a generic edit replaces only with format knowledge — see COVERAGE.md for the full breakdown.

Task Center

Task Center is the user-facing half of the plugin. You do not call task_center yourself; the agent does. Your workflow is:

  1. In chat, activate it with /godot-bridge-task-center-init.
  2. Describe the goal, acceptance criteria, and any files or modules involved.
  3. Ask the agent to create a development or investigation card.
  4. When the start request appears, approve it. Then follow the card in the panel; review, testing, and merge run automatically.

A development card works in its own git worktree, honors dependencies, and takes file locks so unrelated cards can run in parallel without overwriting each other. An investigation card delivers a report instead of code. If the target moves or a merge conflict appears, the candidate is rebuilt and retested rather than merged stale.

How entry works (agent-side)

The panel's current project is bound per session: /state, /task, /list and every action carry ?session=<id>, and the Host reads only that session's binding (state.sessionRootOf(id) is the single reader — there is no process-global project slot). A request without a session id is unbound and never borrows another session's project.

The same package mounts a second component row, godot-bridge/task-center: a project task board, a phase-driven dispatcher with independent review and testing, file locks, a role system, and a centre-column GUI panel (sidebar entry "Tasks").

When the agent enters a project, it calls task_center { action: "onboard" } itself. That resolves the project root (an explicit path, else the session workspace walked up), checks the git/Godot markers, binds the board, bootstraps a missing Team, and answers a short brief plus one next step. It adapts to both a fresh project (a project.godot before git init) and an existing board (blockers, a pending approval), never guesses a path, never creates a card and never starts dispatch; if nothing is found it asks for a path.

// Agent-side call; users do not type this.
task_center { action: "onboard" }

How it works

A development card runs in its own git worktree, honors dependsOn, and locks its declared write files. Unrelated cards can run in parallel; dependent cards wait until the previous card is done and merged. Review and testing are independent roles; the host merges only a tested candidate. If the target moves after testing, the candidate is rebuilt and retested. Investigation cards deliver a report instead of code.

For the detailed state machine, board schema, action API, role system and harness internals, see Task Center internals.

Known limitations

  • Status-page session rows copy the session id. To open a conversation, use the agent sidebar's Open conversation action (or open the task card's sidebar tab and use its Open conversation button); both switch the host to that session.
  • Godot must be launched through the godot_* tools, not through the shell tools; see Troubleshooting.
  • A merge is recorded only when the target ref actually advanced; a mismatch stays in testing with target-not-advanced and must be reopened or repaired.
  • A card whose previous executor is alive and refuses to be interrupted stays pending for triage; the already-dispatched refusal consumes neither an attempt nor an interruption.
  • Historical test events read exit code and duration from the latest test record (the board keeps only the current round), so an older failure row can show numbers from a later round. The verdict label and the failed round's note remain its own.

Requirements

  • DSH 0.2.2-rc.2 or newer on Desktop or Web (the named-subagent / AgentTeam refactor is the minimum); CLI-only sessions are not supported
  • A Godot 4.x project with the McpInteractionServer autoload registered. If your project does not have it yet, copy plugin/mcp_interaction_server.gd to the project root and register it as an autoload named McpInteractionServer (godot-mcp projects already have this). godot_run_project also auto-installs it when missing (copies the vendored file into autoload/ and registers it in project.godot), so no manual setup is needed — and non-Godot projects are completely unaffected.
  • node on PATH
  • DSH Agent Teams services (worker / reviewer / tester provisioning). Without them, task cards stay pending and report the missing service explicitly.
  • Godot executable — resolved in this order: the godot_path tool argument → the godotPath plugin setting (the config of the tool-godot-bridge row: the Godot engine path field on the godot-bridge card's Plugins page, or the godot_set_engine_path tool) → the godot command on PATH. Nothing to configure when godot is on PATH; otherwise set your engine path (the plugin author does not preset it — Godot is a portable exe that can live anywhere). Use the real exe full path, never a version-manager shim; see Troubleshooting.

Install

GodotBridge is supported in DSH Desktop and DSH Web. It is not supported in CLI-only sessions.

Desktop

Open the DSH plugin market, search for godot-bridge, install it, and restart DSH. No command line is needed.

DSH Web

Add the bundle to the Web profile:

dsh plugin --profile web add github:Smalldy/godot-bridge

This is the Web-profile command, not a generic CLI install. dsh plugin is a pnpm forwarder: it installs the package into the profile's node_modules and — because the package declares dsh.bundle (its cordis.patch.yml inserts the tool-godot-bridge row) — appends it to the profile's dsh.profile.bundles layer list. The web profile is the standard one the Web app boots from, so this adds the tools to standard mode without creating a new profile. After a restart, the seventeen godot_* tools are available in every session on that profile. Listed in the awesome-dsh-plugin community registry (topic: dsh-plugin).

On Web, the same command also installs a local checkout or tarball (dsh plugin --profile web add ./path/to/godot-bridge).

The plugin is a standard DSH bundle module: it imports defineTool from @deepseek-ai/dsh-tools and registers via ctx.tools.register. It must be installed through the bundle mechanism above. DSH supplies @deepseek-ai/* from its own installation through the launcher's runtime resolution: a package installed into the profile resolves them automatically, while a link:/symlinked checkout does so only for the names it declares in its own peerDependencies (godot-bridge ≥ 0.1.8 declares them — see DSH 0.2+ compatibility). Do not copy the file into a user agent preset (~/.dsh/.agent-presets/...); that location is outside every resolution scope and cannot resolve @deepseek-ai/dsh-tools.

Uninstall

  • Desktop: remove godot-bridge from the DSH plugin market.
  • DSH Web:
    dsh plugin --profile web remove godot-bridge
    

Removes the package and its godot-bridge bundle layer from the profile — after a restart the seventeen godot_* tools are gone from sessions on that profile. The standard web profile itself is untouched (this never creates or removes a profile). Stop any running game first with godot_stop_project; the plugin's unload cleanup also terminates a Godot child it started. Reinstall any time with the Web add command above, or from the Desktop market.

DSH 0.2.2+ compatibility and troubleshooting

The minimum is DSH 0.2.2-rc.2: it introduced the named, multi-level subagent model and the per-session AgentTeam that the task center uses. DSH 0.2 replaced the old physical module-fallback layer with an in-process runtime resolution that the launcher installs into Node's ESM and CommonJS resolvers. The resolver decides, per importing module, whether a bare @deepseek-ai/* specifier is routed to the installation's own copy — which is what a plugin importing harness packages depends on:

  • Installed inside the profile (dsh plugin add github:…, a tarball, or any copy under $DSH_HOME/profiles/<name>/node_modules): harness packages resolve from the installation automatically. Nothing to declare.
  • Installed as a link: dependency (a symlinked local checkout): the plugin's real path lives outside the profiles tree, and Node's ESM loader resolves symlinks before importing. Such a linked root gets harness packages routed only for names the plugin declares in its own peerDependencies — the resolver reads peerDependencies keys, not dependencies. godot-bridge 0.3.0 declares @deepseek-ai/dsh-tools and @deepseek-ai/schemastery, both marked optional so pnpm never tries to install harness packages from the registry.

Symptoms

Symptom What it means What to do
All seventeen godot_* tools are missing and the launcher log shows ERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/dsh-tools' imported from …/godot-bridge.mjs Harness packages were not routed to the installation copy. For a link: install this is a missing peerDependencies entry Install without a symlink, or ensure peerDependencies includes the harness packages
The launcher prints dsh: skipping profile bundle "godot-bridge": … and the plugin page lists an error The declared DSH peer range does not match the running runtime version. A missing peer imposes no constraint, so it never produces this message Update the plugin, or accept the risk explicitly: dsh plugin --profile <profile> allow-version godot-bridge@<version> --dsh-version <runtime> --accept-risk
The godot-bridge card shows no Godot engine path field The browser half that registers this bundle's configuration section (keyed slot plugins.bundle.config, keyed by the package name) is not loaded: the row is switched off, the host was not restarted after the update, or the installed copy predates the browser half Update and restart DSH; if the row is switched off, switch it on; otherwise set the path with godot_set_engine_path or add a config: block to the row (see install)

Upgrade note: the pre-0.2 godot-bridge: settings section is not migrated by entry id; if the tool-godot-bridge row has an empty godotPath and the old file still exists, the plugin writes that value back once, otherwise set it again with godot_set_engine_path.

Verifying

npm run check                                                              # static contract check — no DSH needed
node scripts/diagnose-dsh-resolution.mjs --profile <profile> --expect ok   # uses the installed DSH app

npm run check fails when a bare @deepseek-ai/* import is not declared in the manifest, when the bundle patch is missing or does not reference the package, when the entry point loses its named exports, or when the browser half breaks its own contract (a dsh.client member the host does not read, a platform other than web, an exports["./client"] target that is missing or unshipped, a __ModuleLoader__ id that is not the package name, a require() outside the platform seed modules, a plugins.bundle.config key that is not this bundle's package name, or a plugins.row.config key that names no row the patch declares). The diagnostic prints the profile's bundle layers, skipped bundles, detected linked roots, and the resolution result for each harness import the plugin makes — run it before and after a fix, or when DSH changes its resolution rules again.

Then restart DSH (or reload the profile from the Plugins page) and confirm that a new session lists the seventeen godot_* tools.

Update notices

On load the plugin does a best-effort version check: it fetches the repo's main-branch package.json (raw.githubusercontent.com, 5s timeout, silent on failure/offline) and compares it with the installed version. When a newer version exists it registers a system-prompt section, so the model surfaces "godot-bridge update available: installed X, latest Y" in every session until the plugin is updated (dsh plugin --profile web update godot-bridge, then restart DSH). godot_ping additionally reports plugin_version / latest_version / update_available for on-demand checks.

To publish an update: bump version in package.json (the release marker) and push — an unchanged version triggers no notice. Forks: set repository in package.json and the check follows the fork automatically.

Known limitations: the notice is a system-prompt section, so presets whose persona is complete/suppressing (e.g. 极简模式 / minimal) do not show it; the check needs network access at boot.

Usage

godot_run_project            # start the game (default: current workspace)
godot_ping                   # confirm 9090 answers
godot_command get_scene_tree # inspect the scene graph
godot_command get_ui_elements
godot_command eval {code: "return get_tree().current_scene.name"}
godot_command click {x: 576, y: 300}
godot_screenshot             # view the game
godot_get_debug_output       # read the boot log
godot_stop_project           # done

Godot executable resolution: per-tool godot_path argument → the godotPath plugin setting (the tool-godot-bridge row's config: the Godot engine path field on the godot-bridge card's page, or the godot_set_engine_path tool) → the godot command on PATH. Nothing to configure when godot is on PATH; otherwise set the engine path and point at the real exe, never a shim.

Further reading

Project layout

plugin/godot-bridge.mjs           # the plugin entry (standard DSH module, named exports name/inject/apply)
plugin/task-center/               # task center host half (schema / board / service / locks / dispatch / merge / git / api / state / tool / routes / skill / harness / index)
client/client.js                  # browser half: engine-path form + task center panel (dsh.client)
plugin/mcp_interaction_server.gd  # vendored from godot-mcp (MIT) — in-game TCP server autoload
plugin/godot_operations.gd        # vendored from godot-mcp (MIT) — headless ops script
plugin/validate_script.gd         # vendored from godot-mcp (MIT) — GDScript compile-check
package.json                      # dsh.bundle + dsh.client manifest (for `dsh plugin add`)
cordis.patch.yml                  # bundle patch layer (inserts the tool row)
install.md / install.zh-CN.md     # detailed install & maintenance
ARCHITECTURE.md / ARCHITECTURE.zh-CN.md  # how it replaces godot-mcp + protocol details
COVERAGE.md / COVERAGE.zh-CN.md   # full tool-by-tool comparison vs godot-mcp
CHANGELOG.md / CHANGELOG.zh-CN.md  # release history
scripts/check-plugin-contract.mjs  # static dependency-contract check (`npm run check`)
scripts/check-target-history.mjs   # branch-protection history guard (`npm run check:target`)
scripts/setup-hooks.mjs            # installs the pre-commit target guard (`npm run hooks:install`)
scripts/diagnose-dsh-resolution.mjs  # re-runnable DSH runtime-resolution diagnostic (dev only)

The task center writes project-local runtime files under <project>/.agents/: tasks.json (the board), roles.json (role profiles) and, optionally, test-harness.json (machine-local harness paths). They are working state, not source — gitignore them.

mcp_interaction_server.gd, godot_operations.gd and validate_script.gd are vendored from godot-mcp (MIT). The plugin locates the headless scripts relative to the module (import.meta.url); pass an explicit ops_script / validate_script argument to override.

License

MIT

Explorar proyectos relacionados

Cargando…