mc-bench / orchestrator

Orchestrator to spin up MC server, connect mineflayer bot, generate + execute build commands and export the structure
MIT License
144 stars 9 forks source link

Orchestrator

Orchestrator to spin up MC server, run Mindcraft agent, save building and run eval

Please join our Discord to follow discussions, help plan the roadmap and hear about next steps

Setup

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd orchestrator
  2. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows use: .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the server:

    python server_manager.py

Usage

The current server manager provides functionality to:

Running server_manager.py directly will create a demo server that:

Basic example:

  from server_manager import MinecraftServerManager

  manager = MinecraftServerManager()

  # Create a server instance
  llm_id = "my_agent"
  server_id = manager.create_server(llm_id)

  # Wait for server to be ready (10 minute timeout)
  if manager.wait_for_server_ready(llm_id):
      # Prepare a building area with grid lines and corner markers
      manager.prepare_building_area(llm_id, size=50)

  # Clean up when done
  manager.stop_server(llm_id)

Configuration

The server uses Docker containers with the following default settings:

Connecting to the Server

To view the building process in Minecraft:

  1. Open Minecraft Java Edition
  2. Go to Multiplayer
  3. Add Server
  4. Enter localhost:25565 as the server address
  5. Connect to the server