Make Computer Play ADOFAI.
A real MCP server for the ADOFAI level editor.
Yes, the "AI Slop" thing is a bit. This one actually works.
hahahahahahahahaha lets AI Slop hahahahahahahahaha
No GUI. One config file. The AI gets the editor, the level, the events and the camera.
"AI Slop" is the joke name for the workflow, not a description of the code. Under the troll branding this is a normal, tested MelonLoader mod:
- A local MCP server over HTTP (JSON-RPC 2.0, Streamable HTTP).
- The mod never calls an AI and stores no API keys. It only listens; T3 Code, OpenCode, Claude Code or any MCP client connects from outside.
- Every game call is queued and executed on Unity's main thread.
- Editor tools for tiles, events, decorations, settings, history, files, playback and screenshots.
- A tested protocol layer and a tested main-thread queue.
- No UI, no popups, no workshop upload, no telemetry.
The point is to let an AI build and inspect a level in a loop: read the level, edit it, take a screenshot, play it, save it, repeat.
If you only want the joke, skip to Slop Mode. If you want to use it, keep reading.
While the game is running, the mod hosts an MCP endpoint at http://127.0.0.1:8765/mcp.
An AI client can:
- Read the level as raw
.adofaiJSON. - List tiles with angles, timing and attached events.
- Add/remove tiles, change angles, replace the whole path.
- Add/update/remove action events and decorations.
- Read and write every level setting (song, BPM, offset, colors, background, camera...).
- Undo/redo, save, load and create levels.
- Move the editor camera and take PNG screenshots.
- Fall back to reflection for anything without a dedicated tool.
The editor stays open the whole time. Edits apply immediately, and undo entries are still created.
- A Dance of Fire and Ice with MelonLoader.
- .NET SDK only if you build from source (tests target
net10.0).
- Build the mod.
- Copy
MCP.dllinto the game'sModsfolder. - Launch the game.
- The MelonLoader console should print
[MCP] listening on http://127.0.0.1:8765/mcp.
Build:
dotnet build -c ReleaseSet GamePath in Directory.Build.props to your game folder. The build copies the DLL into Mods automatically.
All settings live in UserData/MelonPreferences.cfg. There is no in-game UI and no separate settings file.
[MCP]
Host = "127.0.0.1"
Port = 8765
Token = ""
RequestTimeoutSeconds = 60
ScreenshotWidth = 960
MaxBatchCalls = 100
LogRequests = false| Key | Meaning |
|---|---|
Host |
Bind address. Keep 127.0.0.1 for local use. |
Port |
HTTP port. Default 8765. |
Token |
Optional bearer token. Required for a non-loopback host. |
RequestTimeoutSeconds |
How long a tool call waits for the game thread (10–600). |
ScreenshotWidth |
Default screenshot width in pixels (64–1920). Per-call override exists. |
MaxBatchCalls |
Maximum tool calls in one batch (1–1000). |
LogRequests |
Log every successful tool call to the console. Failures are always logged. |
Restart the game after editing the config.
Security: invoke can execute game code, and load_level/new_level touch files. Keep the server on loopback. If you change Host, set a Token; without one the mod refuses the public bind and falls back to 127.0.0.1.
There is no AI inside the mod and no outbound connection.
The mod is a server that lives inside the running game:
T3 Code / OpenCode / Claude Code / any MCP client
|
| HTTP + JSON-RPC 2.0
v
http://127.0.0.1:8765/mcp
|
v
ADOFAI + scnEditor
Start the game first. The endpoint exists only while the game is running. The client connects to it; the mod never connects to the client.
Claude Code
claude mcp add --transport http adofai http://127.0.0.1:8765/mcpWith a token:
claude mcp add --transport http adofai http://127.0.0.1:8765/mcp \
--header "Authorization: Bearer YOUR_TOKEN"OpenCode (opencode.json)
{
"mcp": {
"adofai": {
"type": "remote",
"url": "http://127.0.0.1:8765/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}T3 Code
Add a remote HTTP MCP server in the app's MCP settings with the same URL and optional bearer header. The exact menu label depends on the T3 Code version.
Generic client
{
"mcpServers": {
"adofai": {
"type": "http",
"url": "http://127.0.0.1:8765/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Omit the headers block when Token is empty.
The server implements initialize, tools/list, tools/call and ping. It answers with JSON by default and with SSE when the client asks only for text/event-stream.
The MCP initialize response includes workflow instructions, so a connected agent can discover the editor rules without reading this file.
The mod also works outside the editor: editor_state reports editorOpen: false and editing tools return a clear error instead of crashing.
30 tools.
Read
editor_state get_level get_floors get_events get_event_types get_event_info
Edit
add_floor remove_floor set_floor set_angles select_floor
add_event update_event remove_event set_settings set_level_json
History / playback
undo redo play stop
Files
save_level load_level new_level
View
set_camera screenshot
Power tools
invoke list_members find_types
Meta
batch help
helpreturns connection, config and workflow notes; call it if the client hides server instructions.- Angles are degrees.
0= straight,90= 90-degree turn,999= midspin,-999= S-spin. - Tile 0 has no angle.
set_floorrequires index >= 1. add_floorinserts after a tile;remove_floordeletes a tile. Both shift event floors and tile references (startTile,endTile) to match.get_floorsreports the raw angle used to reach each tile, plusentryTimeand effectivespeed.get_eventsreturns list indices. Re-read after adding/removing events.add_event/update_eventuse the same field names as.adofaiJSON.get_event_infolists the valid fields and defaults.- Colors are hex strings without
#, matching.adofai(for examplefffffforff000080). set_level_jsonchanges the live level in memory only.save_levelwrites to disk.screenshotrenders the game camera to a PNG.tileframes a specific tile first.playstarts preview playback from a tile. You canscreenshotwhile it runs.batchruns several tools in order and reports each result.find_types→list_members→invokereaches anything the dedicated tools do not cover.invoketargets can be roots (editor,game,controller,camera,selectedFloor,song) or dot paths such ascontroller.camy.
editor_state— is the editor open, what level is loaded?get_level/get_floors/get_events— understand the current state.add_floor,add_event,set_settings, ... — edit.screenshot— verify the view.play→screenshot— verify in gameplay.save_level— write the result.undoif the AI has produced a crime scene.
Use batch when a step needs many calls. Use get_event_info before guessing event fields. Use screenshot instead of assuming the edit looks right.
The test project runs without the game or Unity assemblies. Pure sources are linked directly, like a sane person would.
./test.shCoverage includes:
- MCP JSON-RPC: initialize, tools/list, tools/call, ping, notifications, errors, batches, IDs.
- Main-thread queue: ordering, timeout cancellation, exception propagation, drain limits.
- Tool schemas: exact 30-tool set, unique snake_case names, required fields, array item schemas, enums, descriptions.
- Floor math: insert/remove shifts, tile reference boundaries, inverse operations.
- Config clamping and tool result formatting.
Current suite: 79 tests.
MCP/ mod source (netstandard2.1)
MCP.Tests/ xUnit tests (net10.0, no game DLLs)
AGENTS.md short guide for coding agents
Directory.Build.props
MCP.sln
test.sh
LICENCE.md
The mod uses four small layers:
McpServer— HTTP transport, auth, CORS, request framing.McpProtocol— JSON-RPC methods, batches, errors (pure, tested).GameThread— request queue drained fromOnUpdate(pure, tested).EditorTools— the actualscnEditorintegration.
GPLv3. See LICENCE.md.
This mod claims no rights to the game and ships no game assets.
Back up your levels. Reflection is not a sandbox, and undo has limits.
Okay. Now the bit.
This is the part where you point an AI at a rhythm-game editor and say "make it good". It will confidently add a 720-degree spin at BPM 400, call it "musical", and save over your file.
That is Slop Mode. It is not a bug. It is a lifestyle.
AI: adds 300 tiles
AI: "the level now has a clear difficulty curve"
AI: takes screenshot
AI: screenshot is a pile of overlapping squares
AI: "looks great"
hahahahahahahahaha lets AI Slop hahahahahahahahaha
Use it for prototypes, joke levels, mass edits, tedious JSON surgery, or letting an agent do the boring 90% while you fix the last 10%.
Do not let it near a level you love without a backup. The AI does not respect undo. For real.