AI clients#
moud mcp lets an AI client that speaks the Model Context Protocol (MCP) work in Moud Studio: read
the docs, look at and change the scene, write scripts, playtest, read the output and take
screenshots. Every scene change it makes is an edit you can undo.
It has two halves:
moud mcp, a small program your AI client starts. It talks to the client over stdin and stdout.- the
mcpeditor plugin, which runs in Studio and carries out what the client asks.
The plugin reaches moud mcp at 127.0.0.1:47811 on your own computer. Nothing leaves it except what
your AI client itself sends.
Getting the moud command#
moud is the command line tool that also runs fleets and publishing from CI.
It is not released as a download yet, so build it from the Moud repository. It needs Java 25.
./gradlew :cli:installDistThat makes cli/build/install/moud/bin/moud (and moud.bat on Windows). Put that bin folder on
your PATH, or use the full path wherever this page says moud. Check it with:
moud helpInstalling the plugin#
The plugin is in the repository at examples/plugins/mcp/. Copy the mcp folder into
~/.moud/plugins/, so ~/.moud/plugins/mcp/init.luau exists, and it runs in every project you
open. See Editor plugins.
The plugin adds an MCP button to the viewport toolbar. It reads Connected while moud mcp
is running, and Disconnected otherwise. Clicking it turns the plugin off and on again.
The first time the plugin reaches 127.0.0.1:47811, Studio asks whether mcp may reach that host.
Allow it.
Adding it to an AI client#
An AI client starts moud mcp itself, as a stdio server. Most clients take a JSON entry like this,
under mcpServers or the client's own name for it:
{
"mcpServers": {
"moud": {
"command": "moud",
"args": ["mcp"]
}
}
}When moud is not on the PATH the client sees, give the full path in command, such as
/home/you/Moud/cli/build/install/moud/bin/moud.
Then open your place in Studio. When the client calls a tool while Studio is closed, or the plugin is
not installed, the tool answers Moud Studio isn't connected. Open the place in Studio with the mcp plugin installed.
What it can do#
| Tools | |
|---|---|
search_docs |
searches these docs, or returns one whole page. Works without Studio |
get_reference |
classes, properties, methods, events and globals, with their types |
get_tree, get_selection, set_selection, get_properties |
read the open scene |
create, set_properties, clone, delete |
change it, each call one undo entry |
save_scene |
saves the scene to its file, as Save does |
create_prefab, instantiate_prefab |
save something as a prefab and place linked copies |
list_files, read_file, write_file, move_file, delete_file |
the project's files: scripts, scenes, place.toml |
get_diagnostics |
the type checker's problems |
play, stop, get_output, screenshot |
playtest, read the Output panel, see the viewport. They work while the place plays |
run_luau |
runs a piece of Luau in the plugin, with what it printed and returned |
import_asset |
brings a model, texture or sound into the project |
Instances are named by their path from game.world, with / between names: Map/Spawn is the
Spawn inside Map.
moud mcp also tells the client how to work in Moud when it connects: look things up in the docs
first, build the level in the scene, write the scripts, check them, play, read the output, look at a
screenshot, and fix what is wrong.
Another port#
When 47811 is taken, run moud mcp --port 47900, or put "--port", "47900" in args, and give
the plugin the same port. With Studio closed, add it to ~/.moud/plugin-settings.json:
{
"~/mcp": {
"port": 47900
}
}~/mcp is the plugin in ~/.moud/plugins/. Only one moud mcp can use a port at a time, and
starting a second one on it fails with port 47811 is taken, is another moud mcp running?.
