cmo-lua
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cmo-lua look up ScenEdit_AddUnit in the Command Lua API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cmo-lua
A small framework and MCP server for writing Command: Modern Operations scenarios in Lua.
Command stays the simulator. This project is the part an AI can edit: a folder of Lua event scripts, a check that the function names exist, and a reader for the .scen files already on your machine. The function list and the pages it fetches come from the community docs at commandlua.github.io.
It does not include Command, the Command database, or any official scenario.
What you can do
Search the Command Lua API and open the official page for one function.
Read a local
.scenfile: sides, missions, unit names, and the Lua inside its events.Replace one event's Lua and write a new scenario file beside the original.
Keep a scenario as a project (
cmo-project.jsonplusscripts/*.lua) and compileinstall.lua, which you run once in the Command Lua console.
Related MCP server: wow-vanilla-mcp
Project layout
{
"format": 1,
"title": "Strait patrol",
"events": [
{
"name": "Patrol briefing",
"trigger": { "name": "Scenario loaded", "type": "ScenLoaded" },
"action": { "name": "Show briefing", "file": "scripts/briefing.lua" }
}
]
}examples/strait-patrol is a complete one. Trigger types the compiler knows: ScenLoaded, ScenEnded, Time, RegularTime, RandomTime, UnitDestroyed, UnitDamaged, UnitDetected, UnitEntersArea, UnitRemainsInArea, Points.
Use it from an editor
Build it, then add the server to your MCP client:
npm install
npm run build
npm test{
"mcpServers": {
"cmo-lua": {
"command": "node",
"args": ["<path-to>/cmo-lua/dist/index.js"]
}
}
}On this machine that path is C:/Velodona/cmo-lua/dist/index.js.
Then ask for something like: look up ScenEdit_AddUnit, extract this scenario into a project, and add an event that posts a message when the scenario loads.
In Command, open the Lua console and run the generated install.lua with the scenario already loaded. The script removes and recreates only the events named in the project.
Scenario files
A current Command scenario is XML. The body is compress version 5: LZ4 chunks inside AES, the same container described by the public CMOScenTool project. cmo_read_scenario unpacks that so an assistant can see the events. cmo_write_action_script writes a separate .cmo-lua.scen and leaves the file you opened alone. Load the new file in Command before you throw away the original.
cmo_list_scenarios only reads the wrapper (title, setting, complexity), which is enough to find a file without unpacking it.
Tools
Tool | What it does |
| Search the function catalog |
| Fetch one official docs page |
| List |
| Unpack one scenario |
| Replace one Lua action and write a new |
| Turn a scenario into a project folder |
| Read a project and its scripts |
| Write a Lua file into a project |
| Check files and function names |
| Write |
There is also a prompt, cmo_draft_event, that tells the assistant to look functions up before it writes them.
Develop
npm test
npm run build
npm run smokeThe Dong Hoi round-trip test runs only when that scenario is installed with Command. It does not copy the scenario into this repository.
Available Tools
10 toolscmo_compile_loaderCompile install.luaADestructiveIdempotent
Write install.lua for a project. Run that file once in the Command Lua console with the scenario loaded. It removes and recreates the project's events, triggers, and Lua actions. Validate first; compilation is refused when the project has errors.
Inputs: directory (required).
cmo_extract_projectExtract a scenario into a Lua projectADestructive
Unpack a .scen file into a cmo-lua project: cmo-project.json plus one scripts/*.lua file per event action. Edit those files, then cmo_compile_loader. Refuses to replace an existing project unless overwrite is true.
Inputs: path (required), directory (required), overwrite.
cmo_get_functionGet Command Lua functionARead-onlyIdempotent
Fetch one function's page from the official Command Lua docs (commandlua.github.io). Use cmo_search_api if you are not sure of the exact name.
Inputs: name (required).
cmo_list_scenariosList scenario filesARead-onlyIdempotent
List .scen files in a folder using the XML wrapper only (title, setting, complexity). This does not unpack the scenario body. Pass the Command Scenarios directory, or a folder of your own saves.
Inputs: directory (required), limit, offset, response_format.
cmo_read_projectRead a cmo-lua projectARead-onlyIdempotent
Read cmo-project.json and the Lua source of each event. Use this after cmo_extract_project or when the user already has a project folder.
Inputs: directory (required).
cmo_read_scenarioRead a scenarioARead-onlyIdempotent
Unpack one .scen file and return its sides, missions, unit counts, and events. Lua action scripts are included when include_scripts is true. Use this to see what a scenario already does before editing it. Official and saved scenarios are read locally; nothing is uploaded.
Inputs: path (required), unit_limit, unit_offset, include_scripts, +1 more.
cmo_search_apiSearch Command Lua APIARead-onlyIdempotent
Search the Command Lua function catalog taken from https://commandlua.github.io/assets/Functions.html.
Use this before writing a script so the function name is real. Call cmo_get_function for the official page of one result.
Examples:
"add a ship" -> query="add unit"
"event triggers" -> query="set trigger"
Inputs: query (required), limit, offset, response_format.
cmo_validate_projectValidate a cmo-lua projectARead-onlyIdempotent
Check cmo-project.json and its Lua files. Reports missing files, bad probabilities, and Command function names that are not in the official catalog.
Inputs: directory (required).
cmo_write_action_scriptReplace a Lua action inside a scenarioADestructiveIdempotent
Replace the ScriptText of one Lua event action and write a new .scen file. The original file is left unchanged unless output_path is that same file.
The action is matched by its description, which cmo_read_scenario lists. Load the new file in Command to try it. This rewrites the compressed scenario body, so open the result in Command before you delete the original.
Inputs: path (required), action (required), script (required), output_path.
cmo_write_scriptWrite a project Lua fileADestructiveIdempotent
Write a .lua file inside a cmo-lua project and, if needed, add or update the matching event in cmo-project.json. Paths cannot leave the project directory.
Inputs: file (required), contents (required), directory (required), event_name, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools occupy clearly distinct roles: docs lookup (search_api/get_function) versus scenario inspection (list_scenarios/read_scenario) versus project workflows (extract/read/write/validate/compile). The main risk is cmo_write_action_script vs cmo_write_script, which both "write Lua" but differ in target (raw .scen event vs project file) — descriptions clarify but the names alone are close. cmo_read_scenario and cmo_read_project are also adjacent but resolvable from context.
Every tool uses the cmo_ prefix followed by a verb_noun snake_case pattern (search_api, get_function, list_scenarios, read_scenario, write_action_script, extract_project, read_project, write_script, validate_project, compile_loader). No camelCase or style mixing; the pattern is predictable throughout.
Ten tools is well within the ideal 3-15 range and each maps to a distinct step in the docs-lookup and scenario/project lifecycle. No tool feels redundant or like padding; the counts split naturally between reference lookup and file manipulation.
The surface covers the full workflow: look up real functions, inspect existing scenarios, extract to a project, edit scripts, validate function names, and compile a loader. Minor gaps exist — no tool to create a brand-new scenario from scratch, no delete/rename of events, and no direct write-back of a compiled .scen (by design, via install.lua). These are workaroundable but leave the lifecycle slightly one-directional.
Maintenance
Related MCP Connectors
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Search, read and install Agent Skills (SKILL.md) for Claude Code, Cursor, Codex and Copilot.
Read-only tools for the approved public KOKU SCRIPTS AI Catalog.
Write, type-check and run AILANG in a sandbox, with Z3-proved contracts and docs search.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with DCS World in real-time through chat by executing Lua scripts and providing tools for mission info, unit management, coordinate conversion, and more.109MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and retrieve documentation for Vanilla World of Warcraft Lua APIs, including function signatures, categories, protected flags, and addon scaffolding.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and control Command: Modern Operations scenarios locally via MCP tools, supporting real-time battle assessment, task planning, and scenario editing.12MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to develop Desynced mods by providing direct access to the game's Lua API reference, base-game source, live logs, and installed mods, plus live control via a debugger link for evaluating and reloading Lua in the running game.92MIT