This guide documents the MCC AI-assisted development workflow as a real working loop, not a patch generator running on guesses. The goal is to give the agent an environment it can drive on its own: build MCC, start a local server, send commands, inspect logs, and repeat. Once that loop is in place, iteration is faster and regressions are easier to catch.
If you are looking for the broader contributor entry point first, start with [Contributing](contibuting.md) and then come back here for the agent workflow.
If you develop on Windows, use WSL2. This workflow is built around Unix-style shells, `tmux`, `python3`, and shell helper functions. Do not try to run the full AI workflow from plain PowerShell or CMD.
</div>
## Index
- [What This Workflow Covers](#what-this-workflow-covers)
- [Setup](#setup)
- [How The Harness Works](#how-the-harness-works)
- [Repository Tools](#repository-tools)
- [Skills](#skills)
- [Standard Development Loop](#standard-development-loop)
- [Testing And Validation](#testing-and-validation)
The local server harness uses `java` directly, so Java 21 needs to be on your `PATH`.
Ubuntu and Ubuntu-based distros:
```bash
sudo apt update
sudo apt install openjdk-21-jdk
```
Debian:
Package availability varies by Debian release. If `openjdk-21-jdk` is not available in your configured repositories, install a current JDK 21 build from your preferred vendor instead of forcing a stale package name.
If your clone lives somewhere else, update the path in the `source` line.
</details>
<details>
<summary><strong>Verify the environment</strong></summary>
Run these checks:
```bash
git --version
dotnet --version
java -version
python3 --version
tmux -V
```
Then make sure the helper functions are loaded:
```bash
type mc-start
type mcc-build
type mcc-run
```
</details>
## How The Harness Works
AI agents do not get a rich interactive terminal in the same way a human does. That is why this workflow uses a harness instead of relying on live keyboard input.
The moving parts are:
- a local Minecraft server running in `tmux`
-`mc-rcon` for server-side commands such as `/op`, `/give`, `/summon`, or gamerule setup
- MCC started with `MCC_FILE_INPUT=1`
-`FileInputBot`, which watches `mcc_input.txt` and turns file lines into MCC commands or server chat
- logs from MCC and the local server, which the agent can inspect between runs
The result is simple: the agent can change code, rebuild, start the app, inject commands, and read the result without waiting for a human to sit in the terminal.
## Repository Tools
These are the repo-level tools that make the workflow practical.
| Path | Purpose |
| --- | --- |
| `tools/mcc-env.sh` | Loads the shell helper functions used for the normal loop. |
| `tools/start-server.sh` | Starts a local Minecraft server in a named `tmux` session with a FIFO for stdin. |
| `tools/mc-rcon.sh` | Sends RCON commands to the local server using `python3`. |
| `tools/decompile.sh` | Downloads `MinecraftDecompiler.jar` if needed, decompiles the requested Minecraft version, and fetches `server.jar` for server-side work. |
| `tools/diff_registries.py` | Compares registries between two Minecraft versions to show which palettes need updates. |
| `tools/gen_item_palette.py` | Generates item palette source from decompiled or reported registry data. |
| `tools/gen_command_argument_registry.py` | Helps update modern declare-commands registry order. |
| `tools/gen_block_shapes.py` | Downloads and compacts collision shape data for physics support. |
There is one more piece worth calling out:
-`MinecraftClient/ChatBots/FileInputBot.cs` is what makes file-driven command injection possible.
- It is loaded when `MCC_FILE_INPUT=1` is set.
-`mcc-run` in `tools/mcc-env.sh` already sets that flag for you.
## Skills
The tools above do the work. The skills in `.skills/` tell the AI when to use them and what good output looks like.
| Skill | What it is for | Notes |
| --- | --- | --- |
| `mcc-dev-workflow` | The default build, run, debug, and local server loop. | This is the skill to use for most day-to-day MCC debugging. It assumes WSL, `tmux`, Java, and the local harness. |
| `mcc-integration-testing` | Repeatable end-to-end testing against a local offline server. | This skill bundles its own scripts under `.skills/mcc-integration-testing/scripts/`. Those are skill resources, not top-level repo scripts. |
| `mcc-version-adaptation` | Protocol and palette updates for new Minecraft versions. | Use this when routing, registries, metadata, palettes, or structured components change. |
| `mcc-chatbot-authoring` | Authoring or repairing built-in bots and standalone `/script` bots. | This skill bundles references and templates under `.skills/mcc-chatbot-authoring/`. It defaults to standalone `/script` bots unless built-in wiring is requested. |
| `mcc-prompt-engineer` | Generating structured prompts for MCC development tasks. | Manually triggered. Interviews the user, explores the codebase, and produces a self-contained prompt with reasoning framework, skill references, and sub-agent directives. |
- lines starting with `/` are sent as server commands or chat
- lines without `/` are treated as MCC internal commands first
- if a line is not an MCC internal command, it falls back to normal chat sending
### 6. Inspect the result
Read the MCC output and the server log, decide what changed, and either keep iterating or stop.
### 7. Rebuild and restart fast
```bash
mcc-reload
```
That is the usual tight loop for regression work.
## Testing And Validation
There are two main testing styles in this workflow.
### Manual validation
This is enough for smaller changes:
- join the local server
- grant operator privileges with `mc-rcon`
- run internal MCC commands through `mcc-cmd`
- trigger gameplay or server state changes through `mc-rcon`
- inspect logs for parsing errors, disconnects, or wrong output
Typical manual checks:
- inventory listing and creative item injection
- entity tracking after `summon`
- terrain and chunk handling after join
- chat and command flow
- explosion, particle, and sound events
### Scripted full-spectrum testing
The `mcc-integration-testing` skill goes further. It bundles its own scripts under `.skills/mcc-integration-testing/scripts/` and expects the shell helpers from `~/.zshrc`.
Treat those scripts as skill-owned resources. Read the skill before running them directly, and do not assume they behave like top-level repo tools.
That skill is designed for repeatable offline validation of:
- chat
- slash commands
- MCC internal commands
- inventory handling
- entity handling
- particles and sounds
- TNT and explosion handling
Server settings that matter for AI-driven offline testing:
-`eula=true`
-`online-mode=false`
-`enforce-secure-profile=false`
-`enable-rcon=true`
-`rcon.password=test123`
If those are wrong, the loop gets noisy fast.
## Version Adaptation Notes
Version work needs a stricter process than normal bug fixing.
The important rule is simple:
- for newer versions, especially `1.21.9+`, use server data reports as the authority for items and blocks
- use decompiled source for implementation details, field order, codecs, and serializer logic
- do not stop at a palette diff; finish with a build and a live server test
The usual order is:
1.`tools/decompile.sh --version <ver>`
2. generate server reports from `server.jar`
3. run `tools/diff_registries.py`
4. regenerate the palettes that actually changed
5. update version routing and packet handling
6. build MCC
7. test against the real target version
That is exactly the sort of work `mcc-version-adaptation` is meant to guide.
## Example Workflows
These are four common patterns this guide is meant to support.
### Example 1: Debug a runtime regression
Use skills:
-`mcc-dev-workflow`
-`csharp-best-practices`
Typical loop:
```bash
mc-start 1.20.6
mcc-build
mcc-run
mc-rcon "op CursorBot"
mcc-cmd "inventory player list"
mcc-cmd "entity"
```
Then inspect the MCC output, patch the code, and use:
```bash
mcc-reload
```
### Example 2: Build or repair a bot
Use skills:
-`mcc-chatbot-authoring`
-`csharp-best-practices`
-`mcc-dev-workflow`
Typical flow:
1. Decide whether this should be a standalone `/script` bot or a built-in bot.
2. Use the authoring skill's references and templates.
3. Build MCC.
4. Start a local server and join it.
5. Test the bot behavior through live commands, chat, or event-driven actions.
6. Make sure cleanup paths such as `OnUnload()` are correct.
For standalone script work, the skill defaults to `/script` unless built-in repo wiring is explicitly needed.
### Example 3: Adapt MCC to a new Minecraft version
Then regenerate the palettes that changed, update routing, build MCC, start a local server for the target version, and run live validation before calling the work done.
### Example 4: Write or update documentation for the workflow itself
Use skills:
-`humanizer`
-`skill-creator`, if you are changing the skills rather than just the docs
Typical flow:
1. Re-read the relevant skill files and repo tools.
2. Update the guide so the written process matches the real process.
3. Keep the instructions concrete enough that another contributor can follow them without guessing.
4. If the workflow itself changed, update the relevant skill too instead of leaving the docs ahead of the automation.