What is Minecraft Agent Harness?
Minecraft Agent Harness runs language-model agents in Minecraft through Mineflayer, letting them interact with a server like regular players. It is for developers and server operators who want to assign game objectives to AI agents, observe their actions, or run groups of agents together. The project supports several model providers and can connect to a local development server or an existing server. It is MIT-licensed and requires Node.js 22.19 or later.
Minecraft Agent Harness Features:
In-Game Actions: Agents can walk, mine, craft, build, fight, and chat through Mineflayer tools while working toward an assigned objective.
Model Providers: The harness supports Claude, GPT, Gemini, OpenRouter, and custom endpoints that use the OpenAI Responses API.
Resumable Sessions: Agent state is stored by name, so restarting an agent with the same name lets it continue its existing session.
Agent Shells: Each agent can use a Docker, E2B, or local-folder shell to keep notes and write scripts that call its game tools.
Multi-Agent Teams: A JSON team configuration can start multiple agents that message one another, with an optional shared machine.
Server Options: Run agents against the included development server or connect to an existing Minecraft server with host and port settings.
Minecraft Agent Harness Benefits:
Less Repeated Setup: Resuming saved sessions avoids starting from scratch each time an agent process is stopped and restarted.
Flexible Experiments: Choice of model providers and custom endpoints makes it easier to compare how different models handle the same game objective.
Visible Agent Activity: Streaming output and tool calls to the terminal helps operators follow what an agent is doing while it plays.
Controlled Execution: Selectable shell environments give teams options for where agent notes and scripts are kept and run.
Coordinated Play: Agents that can message one another make group objectives possible without managing every player as a separate process.
Use Cases:
Survival Objectives: Set an agent a task such as gathering wood and building a small shelter near the server spawn.
Resource Gathering: Run an agent on a survival server with a mining objective, such as collecting iron.
Bed Wars Matches: Use the included Bed Wars example to run agents in a match with rules and a referee.
Team Experiments: Configure several agents to work in the same game and communicate while pursuing a shared or coordinated objective.
Live Observation: Join the server in Minecraft to watch an agent play and send it a message through the in-game chat.

