r/ComputerCraft • u/WittleWogeyPogey • 14d ago
I updated CraftOS to work as an MCP server for ai assisted coding. (Not here to debate AI.)
Okay so first before anything. If you don’t like AI or don’t like seeing it then just don’t use the tool and move on. This won’t be for everyone. This tool is also useful if you don’t use AI but the MCP part of it is the main reason I made it. I truly do not want to hear the same back and forth arguments about how bad AI is or is not. This post is not the place for it.
But if you DO use coding agents this makes your computer craft coding sessions SUPER reliable. if you use Claude Code / Cursor / Copilot for CC stuff you know the problem: it writes Lua it has never run, and you find the bugs when you try to run it in game. And then you’re sitting there trying to describe the issues to the agent and it can’t actually view the errors itself so it guesses and you go back and forth with it.
so I made craftos-mcp, a CC:Tweaked emulator the agent can drive itself. it runs the program, reads the terminal and monitors, taps buttons, changes the world under it (player walks up, chest fills, train arrives at a Create station, Mekanism reactor heats up, an hour passes) and writes and runs `*.test.lua` files, then fixes what broke and goes again until it actually works. in the video the agent tests and fixes a door controller, then I drop the same file into real minecraft and it works first try, zero code changes. setup is one line: `npx -y craftos-mcp serve`
it simulates rednet between several computers, turtles in a real block world, and peripherals from Advanced Peripherals, Create, Mekanism, Tom's Peripherals and Bigger/Extreme Reactors (MC 1.18.2, 1.20.1 partly). each mod is a switch so the agent only gets the ones your pack has
works without AI too: a window like CraftOS-PC, a browser tab with world buttons, or `craftos-mcp test` in CI. and some games I built with it are playable in the browser: https://rogiedoji.com/craftos
every difference from the real game is a bug to me, so tell me if you find one. engine is forked from CraftOS-PC, thanks JackMacWindows