Crafting minds for Minecraft with LLMs and Mineflayer!
The experimental version of Mindcraft!
FAQ |
Discord Support |
Website |
Andy API
Video Tutorial |
Blog Post |
Paper Website |
MineCollab
Caution
Do not connect this bot to public servers with coding enabled. This project allows an LLM to write/execute code on your computer. The code is sandboxed, but still vulnerable to injection attacks. Code writing is disabled by default, you can enable it by setting allow_insecure_coding to true in settings.js. Ye be warned.
Mindcraft CE is an experimental fork of Mindcraft with its own features and changes from the upstream project.
| Branch | Focus | Status | Key Features |
|---|---|---|---|
stable |
Production ready | Stable | Confirmed working snapshot |
develop |
Active development | Beta | Mindcraft CE features and the agent system |
Warning
Some of the new features may not work right, proceed at your own risk. If you encounter problems, consider contributing by submitting a pull request to the corresponding branch.
Optional support for Cartography for Mindcraft-CE, a small
local map service (Python, standard library only). The bot forwards the chunks it loads; the service builds a
terrain map from them. With it, the bot gets a short terrain summary in its prompt ($TOPOGRAPHY) and map
commands (!topography, !overview, !flatAreas, !shoreline, !landforms, !area_composition,
!bridgeSpan, !recall), which native tool calling exposes as tools. It needs no server mod or world save,
and the bot only knows what it has seen. Only the Overworld is mapped: chunks from other dimensions are sent
with their own dimension and ignored by the service, and the map commands answer that terrain data is
Overworld-only.
Off by default. To use it, start the service and enable it in settings.js or a profile:
python main.py --name my-world # in the cartography-service checkout{ "cartography_enabled": true, "cartography_service_url": "http://127.0.0.1:8090" }The service URL is resolved per agent: the profile's cartography_service_url, then the
CARTOGRAPHY_SERVICE_URL environment variable, then settings.js, then http://127.0.0.1:8090. Give each
bot its own URL in its profile to point bots at different services (different worlds, or a remote service);
a profile cartography_token is sent as the bearer token for that service (a profile with its own URL
never sends the global token). topography_perception,
topography_feed (bot or off) and topography_debug can also be set per profile. Results and
architecture are in the service README.
develop is the default branch and includes the agent system described below.
The Andy API is Mindcraft CE's OpenAI-compatible model gateway. The current public service is a standalone gateway while the integrated Mindcraft compute-pool and Unleashed platform continue development. Mindcraft CE uses it by default through andy/auto in andy.json, and it remains usable by ordinary OpenAI-compatible clients.
You can use the API without an API key. Adding an ANDY_API_KEY to keys.json enables authenticated account limits; keys do not multiply an account's capacity. The available models and service limits are live and may change, so use the API's model list and documentation for the current values.
For OpenAI-compatible clients, use:
https://andy.mindcraft-ce.com/api/v1/
Note
Andy API supports embeddings through /api/v1/embeddings. The andy/auto model selects an embedding-capable model automatically.
You do not need to run the Andy API local client or open a port to use the API.
The public endpoint and API contract are documented here independently of the gateway's internal implementation. Any future account or key migration will be announced in advance.
Native function calling is enabled by default. Brain/Task/RP orchestration, decision endpoints and task-model selection are off by default. See the settings guide and verification results and limits.
use_function_callinguses native tools backed by the existing command implementations. Set it tofalseto keep using the legacy text-command agent, including with a provider that lacks native tool support. Players can still enter!commandsin either mode.use_brain_agentenables a supervisory Brain, a Task executor and optional RP replies with explicit handoffs and saved goals.decisions.enabledenables a separate classifier. Without Brain, it only classifies player chat. MindServer ADMIN messages bypass it. With Brain, it also helps check task progress and goals. It needs a supported decision endpoint and credentials.model_selection.enabledlets Brain choose a Task model from your configured roster for each task. Fixedbrain_model,task_modelandrp_modeloverrides are also available; empty values use the main model.tool_narrationselectsall,periodic(default), ornone. Periodic updates use plain language after three completed tools or 30 seconds of silence during work. Questions, completion and important blockers remain visible.prompt_formatselectsautoorxml. Explicit profile prompts and the legacyuse_xml_promptsflag remain supported.load_memoryrestores saved conversation and agent state at startup. It defaults tofalse; memory is saved automatically. With the default setting, a restart starts fresh.
Ordinary mining, crafting and building use predefined tools and work with allow_insecure_coding: false. That flag controls generated executable code. Mining fixes cover tool speed, server-confirmed breaks and overhead reach. Idle automatic behavior no longer competes between native tool calls.
Default prompts remain in _default.json; XML templates are under profiles/defaults/commands/ and profiles/defaults/tools/. Provider text, vision, and embedding interfaces remain available. ACP and retrieval-augmented memory are deferred. Skill documentation, wiki lookup, and example embeddings remain available.
- Improved vision request handling across all model providers
- Andy API TTS implementation
- 🐳 Docker support with improved container configuration
- 📊 Multi-agent MineCollab framework
- 🌐 OpenRouter-compatible model configuration
- Minecraft Java Edition (up to and including v1.21.11)
- Node.js Installed (use Node 22, v22.13 or newer.
nvm useselects the configured version) - An available model from a supported provider. The default profile uses Andy API; local Ollama and LM Studio are also supported. Provider credentials are needed only when your chosen service requires them.
Important
If installing node on windows, ensure you check Automatically install the necessary tools
If you encounter npm install errors on macOS, see the FAQ for troubleshooting native module build issues
-
Make sure you have the requirements above.
-
Download the latest release and unzip it, or clone the repository.
-
Copy
keys.example.jsontokeys.jsonand fill in credentials required by your chosen provider. Set the model inandy.jsonor another profile. The default Andy configuration and local providers do not require a paid API key. -
In terminal/command prompt, run
npm installfrom the installed directory -
Start a Minecraft Java server or open a world to LAN. Set
host,portandauthinsettings.jsto match it. A LAN world's displayed port can change each time. The sample configuration useslocalhost:55916. -
Run
node main.jsfrom the installed directory
If you encounter issues, check the FAQ or find support on discord. We are currently not very responsive to github issues. To run tasks please refer to Minecollab Instructions
You can configure project details in settings.js. See file.
You can configure the agent's name, model, and prompts in a profile such as andy.json. Use a provider/model string such as "model": "ollama/your-installed-model", or a model object as shown below. Provide credentials when the selected provider requires them. See the supported APIs below.
⭐ VIEW SUPPORTED APIs ⭐
| API Name | Config Variable | Docs |
|---|---|---|
andy |
ANDY_API_KEY(optional) |
docs |
openai |
OPENAI_API_KEY |
docs |
GEMINI_API_KEY |
docs | |
anthropic |
ANTHROPIC_API_KEY |
docs |
xai |
XAI_API_KEY |
docs |
deepseek |
DEEPSEEK_API_KEY |
docs |
ollama (local) |
n/a | docs |
ollama_cloud |
OLLAMA_API_KEY |
docs |
qwen |
QWEN_API_KEY |
Intl./cn |
mistral |
MISTRAL_API_KEY |
docs |
replicate |
REPLICATE_API_KEY |
docs |
groq (not grok) |
GROQCLOUD_API_KEY |
docs |
huggingface |
HUGGINGFACE_API_KEY |
docs |
novita |
NOVITA_API_KEY |
docs |
openrouter |
OPENROUTER_API_KEY |
docs |
hyperbolic |
HYPERBOLIC_API_KEY |
docs |
vllm |
n/a | n/a |
cerebras |
CEREBRAS_API_KEY |
docs |
mercury |
MERCURY_API_KEY |
docs |
lmstudio |
n/a | docs |
For more comprehensive model configuration and syntax, see Model Specifications.
Use ollama/modelname for a local Ollama server (default: http://127.0.0.1:11434),
with no API key required. Use ollama_cloud/modelname for direct Ollama Cloud
access and set OLLAMA_API_KEY in keys.json or your environment. ollamacloud/
and ollama-cloud/ are also accepted prefixes.
Cloud models accessed through a signed-in local Ollama server still use ollama/;
the local server handles authentication. Use the model name recognized by the
server you connect to. See the example profiles for local Ollama
and Ollama Cloud.
For Andy model downloads and model-specific setup, see the Mindcraft CE Hugging Face collection. Use the exact model name installed in your chosen local server.
To connect to online servers your bot will need an official Microsoft/Minecraft account. You can use your own personal one, but will need another account if you want to connect too and play with it. To connect, change these lines in settings.js:
"host": "111.222.333.444",
"port": 55920,
"auth": "microsoft",
// rest is same...Important
The bot's name in the profile.json must exactly match the Minecraft profile name! Otherwise the bot will spam talk to itself.
To use different accounts, Mindcraft will connect with the account that the Minecraft launcher is currently using. You can switch accounts in the launcher, then run node main.js, then switch to your main account after the bot has connected.
Tasks automatically start the bot with a prompt and a goal item to acquire or blueprint to construct. To run a simple task that involves collecting 4 oak_logs run
node main.js --task_path tasks/basic/single_agent.json --task_id gather_oak_logs
Here is an example task json format:
{
"gather_oak_logs": {
"goal": "Collect at least four logs",
"initial_inventory": {
"0": {
"wooden_axe": 1
}
},
"agent_count": 1,
"target": "oak_log",
"number_of_target": 4,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": false
}
}The initial_inventory is what the bot will have at the start of the episode, target refers to the target item and number_of_target refers to the number of target items the agent needs to collect to successfully complete the task.
If you want more optimization and automatic launching of the minecraft world, you will need to follow the instructions in Minecollab Instructions
MindServer binds to 127.0.0.1 by default. Set MINDCRAFT_BIND_HOST to choose another address; a non-loopback address requires MINDCRAFT_CONTROL_TOKEN. Keep this token private because it authorizes agent management, messaging, and shutdown.
When a token is configured, open http://localhost:8080/?token=<your-token> once to authorize the UI. MindServer stores an HttpOnly cookie and redirects to /. Automatic UI startup supplies the token for you. Socket.IO control clients supply auth: { controlToken: "<your-token>" } when connecting; the Python client reads the token from the environment. Agent processes use separate credentials and can end a configured task run without operator access.
If you intend to allow_insecure_coding, it is a good idea to run the app in a docker container to reduce risks of running unknown code. This is strongly recommended before connecting to remote servers, although still does not guarantee complete safety.
export MINDCRAFT_CONTROL_TOKEN="$(openssl rand -hex 32)"
docker build -t mindcraft . && docker run --rm --add-host=host.docker.internal:host-gateway -p 127.0.0.1:8080:8080 -p 127.0.0.1:3000-3003:3000-3003 -e MINDCRAFT_BIND_HOST=0.0.0.0 -e MINDCRAFT_CONTROL_TOKEN -e SETTINGS_JSON='{"auto_open_ui":false,"profiles":["./profiles/gemini.json"],"host":"host.docker.internal"}' --volume ./keys.json:/app/keys.json --name mindcraft mindcraftor simply
export MINDCRAFT_CONTROL_TOKEN="$(openssl rand -hex 32)"
docker-compose up --buildWhen running in docker, if you want the bot to join your local minecraft server, you have to use a special host address host.docker.internal to call your localhost from inside your docker container. Put this into your settings.js:
"host": "host.docker.internal", // instead of "localhost", to join your local minecraft from inside the docker containerTo connect to an unsupported minecraft version, you can try to use viaproxy
Bot profiles are json files (such as andy.json) that define:
- Bot backend LLMs to use for talking, coding, and embedding.
- Prompts used to influence the bot's behavior.
- Examples help the bot perform tasks.
LLM models can be specified simply as "model": "gpt-5.4", or more specifically with "{api}/{model}", like "openrouter/google/gemini-2.5-pro". See all supported APIs here.
The model field can be a string or an object. A model object must specify an api, and optionally a model, url, and additional params. You can also use different models/providers for chatting, coding, vision, embedding, and voice synthesis. See the example below.
"model": {
"api": "openai",
"model": "gpt-5.4",
"url": "https://api.openai.com/v1/",
"params": {
"max_tokens": 1000,
"temperature": 1
}
},
"code_model": {
"api": "openai",
"model": "gpt-5.4-mini",
"url": "https://api.openai.com/v1/"
},
"vision_model": {
"api": "openai",
"model": "gpt-5.4",
"url": "https://api.openai.com/v1/"
},
"embedding": {
"api": "openai",
"url": "https://api.openai.com/v1/",
"model": "text-embedding-3-small"
},
"speak_model": "openai/tts-1/echo"model is used for chat, code_model is used for newAction coding, vision_model is used for image interpretation, embedding is used to embed text for example selection, and speak_model is used for voice synthesis. model will be used by default for all other models if not specified. Not all APIs support embeddings, vision, or voice synthesis.
All apis have default models and urls, so those fields are optional. The params field is optional and can be used to specify additional parameters for the model. It accepts any key-value pairs supported by the api. Is not supported for embedding models.
Embedding models are used to embed and efficiently select relevant examples for conversation and coding.
Embedding adapters include andy, openai, google, replicate, huggingface, novita and ollama (local). The selected model must support embeddings. Direct Ollama Cloud does not provide this adapter's embedding interface. "embedding": false disables embedding requests.
If you try to use an unsupported model, then it will default to a simple word-overlap method. Expect reduced performance. We recommend using supported embedding APIs.
Voice synthesis models are used to narrate bot responses and specified with speak_model. This field is parsed differently than other models and only supports strings formatted as "{api}/{model}/{voice}", like "openai/tts-1/echo". We only support openai and google for voice synthesis.
By default, the program will use the profiles specified in settings.js. You can specify one or more agent profiles using the --profiles argument: node main.js --profiles ./andy.json ./profiles/claude.json
We welcome contributions to the project! We are generally less responsive to github issues, and more responsive to pull requests. Join the discord for more active support and direction.
While AI generated code is allowed, please vet it carefully. Submitting tons of sloppy code and documentation actively harms development.
Some of the node modules that we depend on have bugs in them. To add a patch, change your local node module file and run npx patch-package [package-name]
@Sweaterdog | @riqvip | @uukelele | @mrelmida
Also thanks to all the other developers of the Mindcraft project: @MaxRobinsonTheGreat, @kolbytn, @icwhite, @Ninot1Quyi
This work is published in the paper Collaborating Action by Action: A Multi-agent LLM Framework for Embodied Reasoning. Please use this citation if you use this project in your research:
@article{mindcraft2025,
title = {Collaborating Action by Action: A Multi-agent LLM Framework for Embodied Reasoning},
author = {White*, Isadora and Nottingham*, Kolby and Maniar, Ayush and Robinson, Max and Lillemark, Hansen and Maheshwari, Mehul and Qin, Lianhui and Ammanabrolu, Prithviraj},
journal = {arXiv preprint arXiv:2504.17950},
year = {2025},
url = {https://arxiv.org/abs/2504.17950},
}
Thanks to everyone who has submitted issues on and off Github, made suggestions, and generally helped make this a better project.