MCCTP
by lucasoyen
MCCTP exposes a WebSocket server inside the Minecraft client on port 8765, letting external programs read game state and send action commands.
What it does
After a player joins a world, a WebSocket server opens on port 8765, and a client reaches it at the path ws://localhost:8765/mcctp. Multiple clients can connect at the same time. The game state is streamed out on every tick, with fields such as health, position, held item and combat context always present, and clients send JSON messages with action parameters to act in the game. The protocol is plain JSON over WebSocket, so it can be used from any programming language.
The mod runs on the client alone, so only the player's own game needs it and servers do not. It targets Minecraft 1.21.11 with Fabric Loader 0.18.0 and is released under the MIT License as open source. A reference Python client is included in the python/ folder, and the mod is paired with MCSTP, which requires it. Remote play.py keyboard and mouse passthrough is also included, so a person on another computer can play the world.
Key features
Game state stream
Game state is sent out on every tick, covering health, position, the held item and combat context.
Action commands
Thirteen action types cover movement, combat, inventory, camera and more, and are triggered by JSON messages.
Item categories
Held items are classified automatically into categories such as SWORD, BOW, BLOCK and FOOD.
Hotbar wheel overlay
A circular HUD overlay shows the nine hotbar slots and can be controlled through commands.
Thread-safe dispatch
The WebSocket server runs on its own Netty thread group, and actions are passed over to the game thread.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Required by 1 mod
Use cases
External control programs
Scripts or agents written in any language can read the game state and send actions over the socket.
Remote play
The bundled play.py passes keyboard and mouse input through, so someone on another computer can play the world.
Who it’s for: Developers building bots, agents or research tools that need a live, structured view of the game and a way to act in it. Players who want to play a world from another computer may also use it.
Questions
Does MCCTP need to be installed on a server?
Which loader and game version does MCCTP use?
Which mod depends on MCCTP?
More from lucasoyen
What the author says
A Fabric mod that exposes a WebSocket server on your Minecraft client. It streams game state out every tick and accepts action commands in — letting any program, in any language, control the player. Copy build/libs/mcctp-1.0.0.jar to your.minecraft/mods/ folder (alongside Fabric Loader + Fabric API).
Official listing
- Modrinth page
- modrinth.com/mod/mcctp
- Owner
- lucasoyen
- Published
- 2026-02-18
- Updated on Modrinth
- 2026-03-03
- Facts verified
- 2026-10-15
