godot-mcp

Public

Godot engine MCP server for LM Studio. Need to install Godot engine first and point the Godot executable path in plugin setting.

75 Downloads

1 star

README

Godot — LM Studio Plugin

An LM Studio plugin (TypeScript) that lets the model drive the Godot game engine and look up the official Godot documentation while it works.

This is a native LM Studio Plugin, not a standalone MCP server. Tools are exposed directly to the model through @lmstudio/sdk, and per-chat settings are rendered automatically by LM Studio from a config schema.

Features

Godot engine tools

ToolDescription
launch_editorLaunch the Godot editor for a project directory.
run_projectRun a project in debug (headless) mode and capture output.
get_debug_outputReturn captured stdout/stderr of the running project.
stop_projectStop the running project and return its final output.
get_godot_versionReturn the resolved Godot executable version.
list_projectsFind Godot projects inside a directory.
get_project_infoProject metadata: name, path, version, file-type breakdown.
create_sceneCreate a new scene with a root node type.
add_nodeAdd a node to an existing scene.
load_spriteLoad a texture into a Sprite2D / Sprite3D / TextureRect.
export_mesh_libraryExport a 3D scene as a MeshLibrary .res.
save_sceneSave a scene, optionally writing a variant.
get_uidGet the UID for a file (Godot 4.4+).
update_project_uidsRefresh UID references across a project (Godot 4.4+).

Error handling: The engine tools validate paths, class names and scene existence before calling Godot. When the Godot executable cannot be launched (for example it is not installed, or the path is wrong), they return a clear Error: Failed to spawn Godot executable "<path>": <ENOENT|EACCES|EPERM> message instead of silently reporting success. Set the godotPath setting or the GODOT_PATH environment variable, or install Godot Engine.

Documentation tools (new)

ToolDescription
search_godot_docsSearch the official Godot docs and return matching pages (title, URL).
fetch_godot_docsFetch and return the readable text of a single docs page.

The docs search page renders results with client-side JavaScript only, so this plugin queries the underlying Sphinx search index (searchindex.js) directly on the server side — no browser required. Results are cached per-doc-version.

Per-chat settings

Rendered automatically by LM Studio. All are optional and have sane defaults.

KeyTypeDefaultDescription
docsMaxResultsnumeric5Max results from the docs search tool.
docsMaxCharsnumeric20000Max characters returned by the docs fetch tool.
docsVersionselectstableDocs version to query (stable/beta/4.3/4.4/5.0).
godotPathstring(empty)Explicit Godot executable path (overrides GODOT_PATH).
toolsEnabledbooleantrueToggle the engine-control tools. Docs tools are always available.

Requirements

  • LM Studio with the Plugin runtime (Node.js).
  • Godot Engine installed, or set the GODOT_PATH environment variable / godotPath setting. If the executable is missing or cannot be launched, the engine tools report a clear Failed to spawn Godot executable ... <ENOENT|EACCES|EPERM> error instead of silently succeeding.

Development

npm install
npm run typecheck   # tsc --noEmit
npm run lint        # eslint src
npm run build       # tsc → dist/  + copy godot_operations.gd into dist/scripts
lms dev             # build, load into LM Studio, watch & reload on change

Then in LM Studio: open the plugin list → enable godot-mcp → open a model that supports tool calling → confirm the tools are listed and callable.

lms (the LM Studio CLI) is required for lms dev / lms push. Build, typecheck and lint run locally without it.

Publish

npm run typecheck
npm run lint
npm run build
lms push            # add --private for a private artifact

Architecture

src/
├── index.ts              # Plugin entry: exports toolsProvider + configSchematics
├── toolsProvider.ts      # @lmstudio/sdk tool() definitions (16 tools)
├── config.ts             # createConfigSchematics() per-chat schema
└── core/
    ├── godotCore.ts      # Godot detection, validation, GDScript operation runner
    └── godotDocs.ts      # Docs search (searchindex.js) + page content fetch
dist/                     # Compiled output loaded by LM Studio
scripts/build.mjs          # Copies scripts/godot_operations.gd next to dist/

Attribution

This project is ported from the original godot-mcp, created by Solomon Elias (Coding-Solo). We are grateful for the original work that made this LM Studio Plugin possible. The MIT License of the original repository also applies to the ported material — see LICENSE.

License

MIT — see LICENSE.