Skip to content

Connect an AI assistant (MCP) ​

While the editor is open, AI assistants that speak the Model Context Protocol can build terrain in it. They can:

  • read the node types and the open project, and see which nodes you have selected;
  • add, connect and change nodes, tidy the graph with comments, layout and custom nodes;
  • check the graph for problems;
  • look at the terrain: a picture from above, and the editor's own 3D view or map;
  • mark outputs, and save, open and build projects.

You watch the graph change as they work, and each change is one step you can undo. Assistants can undo their own changes but never yours. They ask you before discarding unsaved work, replacing a file or starting a very large build.

Setting up ​

Open Help → Connect an AI Assistant…. It shows whether the server is running, its actual address, and setup to copy for your client. The default address is http://127.0.0.1:17428/mcp. A second editor window automatically uses another port. You can change the preferred port there; Restart server applies it.

sh
claude mcp add --transport http libreterrain http://127.0.0.1:17428/mcp
# then run /mcp in Claude Code to check the connection
json
{"mcpServers":{"libreterrain":{"command":"/absolute/path/to/libreterrain-mcp","args":[]}}}
json
{"mcpServers":{"libreterrain":{"url":"http://127.0.0.1:17428/mcp"}}}
json
{"servers":{"libreterrain":{"type":"http","url":"http://127.0.0.1:17428/mcp"}}}

Claude Desktop and other stdio clients use the libreterrain-mcp bridge shipped beside LibreTerrain:

PackageBridge location
Windows (installer or portable)Beside LibreTerrain.exe (libreterrain-mcp.exe)
macOSBeside LibreTerrain.app
Linux .deb / .rpm/usr/bin/libreterrain-mcp
Linux portable zipBeside LibreTerrain.x86_64
AppImageLibreTerrain.AppImage --mcp-bridge
Flatpakcommand flatpak, args ["run", "--command=libreterrain-mcp", "uk.co.ellisondigital.LibreTerrain"]

The bridge finds a running editor automatically, including one on a fallback port. Launch it with --port PORT to pick a specific window.

Working without the editor ​

The bridge can also serve a saved project directly, without starting Godot:

sh
libreterrain-mcp --project /absolute/path/to/terrain.lterrain

This offers the same graph tools, top-down previews and CPU builds. Edits are written back only when the assistant saves.

Safety and control ​

  • The server listens on this computer only.
  • Settings → Allow AI Changes (or the switch in the AI Assistants panel) lets assistants look without changing anything.
  • Settings → AI Assistants (MCP) turns the server off altogether.
  • The AI Assistants panel (the sparkle on the left) lists everything assistants have done. Click an entry to select the nodes it touched.

Both settings are remembered.

Code dual-licensed MIT / Apache-2.0. "LibreTerrain" and its logo belong to EllisonDigital.