godot-mcp
[đ«đ· Français](#fr) · [đŹđ§ English](#en)

[](https://www.npmjs.com/package/godot-hands)



---
# <a id="fr"></a>godot-hands
**Donnez les mains Ă votre assistant IA sur l'Ă©diteur Godot â avec 10 outils au lieu de 100.**
```
Assistant IA <---stdio/MCP---> godot-hands <---WebSocket:6505---> Plugin Godot
```
## Pourquoi celui-ci
La plupart des serveurs MCP Godot exposent chaque méthode de l'addon comme
un *tool* MCP sĂ©parĂ© â 50, 80, parfois plus de 100 entrĂ©es dans le catalogue
que le modĂšle doit lire et trier avant chaque appel. Plus la surface est
large, moins un LLM choisit le bon outil de façon fiable, et plus chaque
requĂȘte coĂ»te cher en tokens rien que pour dĂ©crire les outils disponibles.
godot-hands prend le pari inverse : **10 outils**, dont un seul (`godot_call`)
donne accÚs à un catalogue de **210 méthodes** réparties en ~25 catégories
(scĂšne, nodes, 3D, physique, animation, shaders, tilemap, particules, audio,
navigation, export Android, testsâŠ), dĂ©couvert **en direct** auprĂšs de
l'éditeur connecté plutÎt que figé dans ce dépÎt. Le modÚle demande le
schéma dont il a besoin (`godot_describe`) au lieu de tout charger d'un
coup. Résultat mesuré (`npm run token-cost`) : **~1460 tokens** pour toute
la surface d'outils.
Le reste tient en une phrase : **zéro dépendance runtime** en dehors du SDK
MCP, **aucun service externe**, le plugin Godot est un simple client
WebSocket â vous savez exactement ce qui tourne et oĂč.
### Ce qui distingue ce pont d'un simple exécuteur de commandes
- **Garde-fous, pas juste des fonctions.** Les opérations destructrices
(suppression de fichier, édition de script, code arbitraire) exigent
`confirm: true` ; les éditions de script portent un garde optimiste par
SHA-256 pour ne pas écraser silencieusement un changement fait entre-temps
dans l'éditeur ; les mutations de scÚne passent par
`EditorUndoRedoManager` â un Ctrl-Z suffit toujours Ă annuler.
- **Multi-Ă©diteur.** Plusieurs projets Godot peuvent se connecter en mĂȘme
temps ; `godot_status {"select": "..."}` épingle celui qui doit recevoir
les appels au lieu de tomber sur le premier connecté par hasard.
- **Les opérations longues ne timeout plus.** `godot_call {"async": true}`
rend la main immĂ©diatement avec un `job_id` Ă relire via `godot_job` â
un stress test de 60s ne meurt plus au bout de 30.
- **Compatibilité de version fine.** Chaque méthode déclare la version
Godot minimale qu'elle requiert ; sur un moteur plus ancien, seules ces
méthodes-là disparaissent du catalogue au lieu de faire échouer tout
l'addon.
- **Capture d'erreurs structurée**, pas du scraping d'UI : les erreurs
runtime sont interceptées via le signal `debug_data` du debugger Godot.
- **Playtesting déterministe** : seed RNG fixée, tick de simulation fixe,
snapshots d'Ă©tat, avance frame-par-frame (`step_frames`) ou jusqu'Ă
condition (`wait_for_condition`) â pour reproduire un bug plutĂŽt que le
chasser Ă l'aveugle.
- **Perception 3D** : modes de rendu debug (wireframe, overdraw, éclairage
seulâŠ) sur les captures d'Ă©cran, dĂ©tection d'objets qui se chevauchent ou
flottent, test de frustum camĂ©ra, couverture des lumiĂšres â un lint
spatial pour repérer ce qu'un screenshot seul ne montre pas.
- **Assets CC0 intégrés** : recherche, prévisualisation et import direct
depuis Poly Haven et ambientCG, sans quitter la conversation.
## Installation
Deux commandes, zéro build, pas de clone de dépÎt :
```bash
# 1. Pose l'addon Godot dans votre projet (addons/godot_mcp/)
npx godot-hands install ./mon-jeu
```
Activez-le : **Projet â ParamĂštres du projet â Plugins â godot-hands â Activer**
```json
{
"mcpServers": {
"godot-hands": {
"command": "npx",
"args": ["-y", "godot-hands"]
}
}
}
```
Préférez installer une bonne fois pour toutes ? `npm install -g godot-hands`,
puis `"command": "godot-hands"` dans la config. Le paquet npm embarque le
plugin Godot : la sous-commande `install` le copie depuis `node_modules`
(ou copiez manuellement `node_modules/godot-hands/plugin/` vers
`addons/godot_mcp/`, c'est équivalent).
## Outils
| Outil | Description |
|-------|-------------|
| `godot_call` | Appelle n'importe quelle méthode du catalogue (`async: true` pour les appels longs) |
| `godot_list_methods` | Liste les méthodes par catégorie (en direct depuis l'éditeur connecté) |
| `godot_describe` | Schéma complet (paramÚtres, types, annotations) d'une ou plusieurs méthodes |
| `godot_info` | Infos projet |
| `godot_screenshot` | Capture éditeur en PNG |
| `godot_execute` | Exécute du GDScript |
| `godot_status` | Vérifie la connexion, épingle un éditeur (`select`) si plusieurs sont connectés |
| `godot_job` | Relit le résultat d'un appel `async: true` |
| `godot_doctor` | Diagnostic complet : port, connexion, auth, contrat addon/serveur, binaire Godot |
| `godot_assets` | Recherche/prévisualise/importe des assets CC0 (Poly Haven, ambientCG) |
> **Confirmation obligatoire (`confirm: true`)** : les méthodes qui écrivent
> ou suppriment un fichier sur disque, modifient `project.godot`, ou exécutent
> du code arbitraire dans le process éditeur/jeu (`create_scene`,
> `delete_scene`, `edit_script`, `execute_editor_script`, `set_project_setting`,
> etc.) refusent l'appel avec l'erreur `-32009` tant que `params.confirm` n'est
> pas `true`. `godot_describe` liste ce paramÚtre dans le schéma de chaque
> méthode concernée. Les mutations de la **scÚne éditée** (ajout/suppression
> de nodes, changement de propriĂ©tĂ©s, CSG, scatterâŠ) ne sont **pas** gatĂ©es :
> elles passent par `EditorUndoRedoManager` et un simple Ctrl-Z suffit Ă les
> annuler.
>
> **`godot_assets`** effectue des requĂȘtes rĂ©seau sortantes vers `polyhaven.com`
> et `ambientcg.com`. `import` écrit les fichiers dans
> `<projet>/assets/<provider>/<id>/` (chemin obtenu via `get_project_info`)
> puis déclenche un rescan du projet. Sources CC0 uniquement (domaine
> public, aucune attribution légalement requise) ; une note `NOTICE.txt`
> est écrite à cÎté de chaque asset importé.
> **Chemins de nodes** : les paramĂštres `parent_path` et `node_path` de
> `godot_call` (ex. `add_node`, `update_property`, `delete_node`) sont
> **toujours relatifs à la racine de la scÚne actuellement éditée** (`"."` =
> racine de la scĂšne). Les chemins absolus Godot (`"/root"`, `"../..."`) sont
> rejetĂ©s â ils cibleraient l'arbre interne de l'Ă©diteur au lieu de la scĂšne.
>
> **Handles de session** : tout paramĂštre `node_path` accepte aussi un
> handle (chaßne `"@id:<n>"`, renvoyée sous `"handle"` par `get_scene_tree`,
> `add_node`, `rename_node`, etc.) Ă la place d'un chemin. Un handle continue
> de dĂ©signer le mĂȘme node aprĂšs un renommage ou un dĂ©placement dans la
> scĂšne, contrairement Ă un chemin qui casse dĂšs que l'un des deux se
> produit â utile pour enchaĂźner plusieurs appels sur le node qu'on vient de
> créer/modifier. Un handle expire si la scÚne est rechargée/refermée ;
> rappelez `get_scene_tree` pour en obtenir un nouveau.
>
> **`godot_screenshot`** nécessite un éditeur avec rendu actif : il ne
> fonctionne pas en mode `--headless` (erreur "Could not get image from
> viewport").
## Ressources et prompts MCP
En plus des outils, le serveur expose l'état du projet en **ressources**
(gratuites en tokens tant qu'elles ne sont pas lues, contrairement aux
outils) : `godot://scene/current`, `godot://project/info`,
`godot://project/settings`, `godot://logs/recent`, et le template
`godot://class/{name}` (rĂ©flexion ClassDB, mise en cache 5 min â les classes
du moteur ne changent pas en cours de session).
Quatre **prompts** réutilisables guident les workflows pour lesquels ce
serveur a été conçu : `blockout-3d-level`, `diagnose-crash`,
`audit-scene-perf`, `asset-strategy`.
`godot_assets {action: "import"}` envoie des notifications de progression
(`notifications/progress`) si le client fournit un `progressToken` â le
téléchargement peut prendre du temps sur une connexion lente.
## Arborescence
```
godot-hands/
âââ plugin/ â Plugin Godot (embarquĂ© dans le paquet npm)
âââ src/index.ts â Serveur MCP (Node.js)
âââ src/assets/ â Sourcing d'assets CC0 (Poly Haven, ambientCG)
âââ package.json
âââ tsconfig.json
âââ README.md
âââ LICENSE â MIT
```
## Développement
```bash
npm test # tests unitaires (vitest), y compris le contract-check addon/serveur
npm run contract # contract-check seul : get_commands()/get_command_schemas() alignés, modules enregistrés
npm run test:godot # tests GDScript en --headless (nécessite `godot`/`godot4` sur le PATH ou GODOT_BIN)
npm run token-cost # mesure le poids en tokens de la surface d'outils (et le contrefactuel si un éditeur est connecté)
```
## Licence
MIT
---
# <a id="en"></a>godot-hands
**Give your AI assistant real control of the Godot editor â with 10 tools instead of 100.**
```
AI Assistant <---stdio/MCP---> godot-hands <---WebSocket:6505---> Godot Plugin
```
## Why this one
Most Godot MCP servers expose every addon method as its own MCP tool â 50,
80, sometimes 100+ entries the model has to read and sort through before
every single call. The bigger that surface gets, the less reliably an LLM
picks the right tool, and the more tokens get burned on tool descriptions
before the conversation even starts.
godot-hands takes the opposite bet: **10 tools**, one of which (`godot_call`)
opens onto a catalog of **210 methods** across ~25 categories (scene,
nodes, 3D, physics, animation, shaders, tilemaps, particles, audio,
navigation, Android export, testingâŠ), discovered **live** from the
connected editor instead of hardcoded in this repo. The model asks for the
schema it actually needs (`godot_describe`) instead of loading everything
up front. Measured result (`npm run token-cost`): **~1460 tokens** for the
whole tool surface.
Everything else fits in one sentence: **zero runtime dependencies** beyond
the MCP SDK, **no external services**, the Godot plugin is a plain
WebSocket client â you know exactly what's running and where.
### What sets this apart from a plain command runner
- **Guardrails, not just functions.** Destructive operations (deleting a
file, editing a script, running arbitrary code) require `confirm: true`;
script edits carry an optimistic SHA-256 guard so they can't silently
clobber a change made in the editor in the meantime; scene mutations go
through `EditorUndoRedoManager` â a plain Ctrl-Z always undoes them.
- **Multi-editor aware.** Several Godot projects can stay connected at
once; `godot_status {"select": "..."}` pins which one receives calls
instead of falling back to whichever connected first.
- **Long operations stop timing out.** `godot_call {"async": true}` returns
a `job_id` immediately, polled via `godot_job` â a 60-second stress test
no longer dies at the 30-second mark.
- **Fine-grained version compatibility.** Every method declares the
minimum Godot version it needs; on an older engine, only those specific
methods drop out of the catalog instead of the whole addon failing to
load.
- **Structured error capture**, not UI scraping: runtime errors are
intercepted through Godot's debugger `debug_data` signal.
- **Deterministic playtesting**: fixed RNG seed, fixed simulation tick,
state snapshots, frame-by-frame stepping (`step_frames`) or stepping
until a condition holds (`wait_for_condition`) â reproduce a bug instead
of hunting it blind.
- **3D perception**: debug render modes (wireframe, overdraw, lighting
onlyâŠ) on screenshots, overlapping/floating object detection, camera
frustum testing, light coverage â a spatial lint for what a single
screenshot won't show you.
- **Built-in CC0 assets**: search, preview, and import directly from Poly
Haven and ambientCG without leaving the conversation.
## Setup
Two commands, zero build, no repo clone:
```bash
# 1. Drops the Godot addon into your project (addons/godot_mcp/)
npx godot-hands install ./my-game
```
Enable it: **Project â Project Settings â Plugins â godot-hands â Enable**
```json
{
"mcpServers": {
"godot-hands": {
"command": "npx",
"args": ["-y", "godot-hands"]
}
}
}
```
Prefer a permanent install? `npm install -g godot-hands`, then use
`"command": "godot-hands"` in the config. The npm package ships the Godot
plugin itself: the `install` subcommand copies it out of `node_modules`
(or manually copy `node_modules/godot-hands/plugin/` to `addons/godot_mcp/`
â same thing).
## Tools
| Tool | Description |
|------|-------------|
| `godot_call` | Call any method in the catalog (`async: true` for long-running calls) |
| `godot_list_methods` | List methods by category (live from the connected editor) |
| `godot_describe` | Full schema (params, types, annotations) for one or more methods |
| `godot_info` | Project info |
| `godot_screenshot` | Editor screenshot in PNG |
| `godot_execute` | Run GDScript |
| `godot_status` | Check connection, pin an editor (`select`) when several are connected |
| `godot_job` | Poll the result of an `async: true` call |
| `godot_doctor` | End-to-end diagnostic: port, connection, auth, addon/server contract, Godot binary |
| `godot_assets` | Search/preview/import CC0 assets (Poly Haven, ambientCG) |
> **Confirmation required (`confirm: true`)**: methods that write to or
> delete a file on disk, modify `project.godot`, or run arbitrary code in the
> editor/game process (`create_scene`, `delete_scene`, `edit_script`,
> `execute_editor_script`, `set_project_setting`, etc.) refuse the call with a
> `-32009` error until `params.confirm` is `true`. `godot_describe` lists this
> parameter in the schema of every gated method. Mutations to the **edited
> scene** (adding/removing nodes, property changes, CSG, scatterâŠ) are **not**
> gated: they go through `EditorUndoRedoManager`, so a plain Ctrl-Z undoes
> them.
>
> **`godot_assets`** makes outbound network requests to `polyhaven.com` and
> `ambientcg.com`. `import` writes files under
> `<project>/assets/<provider>/<id>/` (path learned via `get_project_info`)
> and then triggers a project rescan. CC0 sources only (public domain, no
> attribution legally required); a `NOTICE.txt` is written next to each
> imported asset regardless.
> **Node paths**: `parent_path` and `node_path` parameters of `godot_call`
> (e.g. `add_node`, `update_property`, `delete_node`) are **always relative to
> the root of the currently edited scene** (`"."` = scene root). Absolute
> Godot paths (`"/root"`, `"../..."`) are rejected â they would target the
> editor's internal tree instead of the scene.
>
> **Session handles**: any `node_path` parameter also accepts a handle (an
> `"@id:<n>"` string, returned as `"handle"` by `get_scene_tree`, `add_node`,
> `rename_node`, etc.) instead of a path. A handle keeps addressing the same
> node across a rename or reparent, where a path would break â useful for
> chaining several calls against the node you just created/modified. A
> handle goes stale when the scene is reloaded/reopened; call
> `get_scene_tree` again for a fresh one.
>
> **`godot_screenshot`** requires an editor with active rendering: it does not
> work in `--headless` mode ("Could not get image from viewport" error).
## MCP resources and prompts
Besides tools, the server exposes project state as **resources** (free in
tokens until actually read, unlike tools): `godot://scene/current`,
`godot://project/info`, `godot://project/settings`, `godot://logs/recent`,
and the template `godot://class/{name}` (ClassDB reflection, cached for 5
minutes â engine classes don't change mid-session).
Four reusable **prompts** guide the workflows this server was built for:
`blockout-3d-level`, `diagnose-crash`, `audit-scene-perf`, `asset-strategy`.
`godot_assets {action: "import"}` sends `notifications/progress` updates if
the client supplies a `progressToken` â the download can take a while on a
slow connection.
## Development
```bash
npm test # unit tests (vitest), including the addon/server contract-check
npm run contract # contract-check alone: get_commands()/get_command_schemas() agree, every module registered
npm run test:godot # headless GDScript tests (needs `godot`/`godot4` on PATH or GODOT_BIN)
npm run token-cost # measures the tool surface's token weight (and the counterfactual if an editor is connected)
```
## Structure
```
godot-hands/
âââ plugin/ â Godot plugin (bundled in the npm package)
âââ src/index.ts â MCP server (Node.js)
âââ src/assets/ â CC0 asset sourcing (Poly Haven, ambientCG)
âââ test/ â vitest suite + headless GDScript fixture project
âââ package.json
âââ tsconfig.json
âââ README.md
âââ LICENSE â MIT
```
## License
MIT
TDQS
Scored across 10 tools
Each tool has a clearly identifiable role: browsing, describing, calling, executing, capturing, status checking, job polling, diagnostics, and asset management. The main ambiguity is between the generic godot_call and the shorthands like godot_execute and godot_info, but their descriptions explicitly frame them as shorthands, which mitigates confusion.
All tools share a consistent godot_ prefix and snake_case style, making them easy to group and predict. However, naming mixes verb-based names like godot_call and godot_execute with noun-based names like godot_info, godot_status, and godot_assets, so it is not a strict verb_noun pattern throughout.
With 10 tools, the server is well-scoped: it covers generic invocation, method discovery, descriptions, project info, screenshots, script execution, connection status, async jobs, diagnostics, and asset import. Each tool earns its place, and the count is appropriate for a Godot editor integration surface.
The generic godot_call plus godot_list_methods and godot_describe provide comprehensive access to the addon API, while shorthands cover the most common operations. Async job handling, connection diagnostics, and asset search/preview/import fill out the workflow with no obvious dead ends.