Can you advise me how to setup the node environment with pnpm here, then run the server connecting to the minecraft server
Can you advise me how to setup the node environment with pnpm here, then run the server connecting to the minecraft server
total 244
drwxrwxr-x 1 jm jm 566 Feb 23 12:36 .
drwxr-xr-x 1 jm jm 768 Feb 14 23:19 ..
-rw-rw-r-- 1 jm jm 230 Feb 23 12:30 andy.json
drwxrwxr-x 1 jm jm 68 Feb 23 12:31 bots
-rw-rw-r-- 1 jm jm 787 Feb 14 23:19 docker-compose.yml
-rw-rw-r-- 1 jm jm 592 Feb 14 23:19 Dockerfile
-rw-rw-r-- 1 jm jm 46 Feb 14 23:19 .dockerignore
-rw-rw-r-- 1 jm jm 1244 Feb 14 23:19 eslint.config.js
-rw-rw-r-- 1 jm jm 2759 Feb 14 23:19 FAQ.md
drwxrwxr-x 1 jm jm 138 Feb 23 12:36 .git
-rw-rw-r-- 1 jm jm 632 Feb 14 23:19 .gitignore
-rw-rw-r-- 1 jm jm 464 Feb 14 23:19 keys.example.json
-rw-rw-r-- 1 jm jm 470 Feb 14 23:27 keys.json
-rw-rw-r-- 1 jm jm 1073 Feb 14 23:19 LICENSE
-rw-rw-r-- 1 jm jm 2161 Feb 14 23:19 main.js
-rw-rw-r-- 1 jm jm 14909 Feb 14 23:19 minecollab.md
drwxrwxr-x 1 jm jm 924 Feb 23 12:39 node_modules
-rw-rw-r-- 1 jm jm 1534 Feb 23 12:35 package.json
drwxrwxr-x 1 jm jm 320 Feb 14 23:19 patches
-rw-rw-r-- 1 jm jm 148040 Feb 23 12:35 pnpm-lock.yaml
-rw-rw-r-- 1 jm jm 83 Feb 23 12:36 pnpm-workspace.yaml
drwxrwxr-x 1 jm jm 380 Feb 14 23:19 profiles
-rw-rw-r-- 1 jm jm 13099 Feb 14 23:19 README.md
-rw-rw-r-- 1 jm jm 104 Feb 14 23:19 requirements.txt
drwxrwxr-x 1 jm jm 16 Feb 14 23:19 services
-rw-rw-r-- 1 jm jm 3479 Feb 23 12:27 settings.js
drwxrwxr-x 1 jm jm 88 Feb 14 23:19 src
drwxrwxr-x 1 jm jm 762 Feb 14 23:19 tasks
-rw-rw-r-- 1 jm jm 1345 Feb 14 23:19 Tasks.Dockerfile
{
"name": "mindcraft",
"type": "module",
"dependencies": {
"@anthropic-ai/sdk": "^0.17.1",
"@cerebras/cerebras_cloud_sdk": "^1.46.0",
"@google/genai": "^1.15.0",
"@huggingface/inference": "^2.8.1",
"@mistralai/mistralai": "^1.1.0",
"canvas": "^3.1.0",
"cheerio": "^1.0.0",
"express": "^4.18.2",
"google-translate-api-x": "^10.7.1",
"groq-sdk": "^0.15.0",
"mindcraft": "link:",
"minecraft-data": "^3.97.0",
"mineflayer": "^4.33.0...const settings = {
minecraft_version: "auto", // or specific version like "1.21.6"
host: "192.168.66.180", // or "localhost", "your.ip.address.here"
port: 25562, // set to -1 to automatically scan for open ports
auth: "microsoft", // or "microsoft"
// the mindserver manages all agents and hosts the UI
mindserver_port: 8080,
auto_open_ui: true, // opens UI in browser on startup
base_profile: "assistant", // survival, assistant, creative, or god_mode
profiles: [
"./andy.json",
// "./profiles/gpt.json",
// "./profiles/claude.json",
// "./profiles/gemini.json",
// "./profiles/llama.json",
// "./profiles/qwen.json",
// "./profiles/grok.json",
// "./profiles/mistral.json",
// "./profiles/deepseek.json",
// "./profiles/mercury.json",
// "./profiles/andy-4.json", // Supports up to 75 messages!
// using more than 1 profile requires you to /msg each bot indivually
// individual profiles override values from the base profile
],
load_memory: false, // load memory from previous session
init_message: "Respond with hello world and your name", // sends to all on spawn
only_chat_with: [], // users that the bots listen to and send general messages to. if empty it will chat publicly
speak: false,
// allows all bots to speak through text-to-speech.
// specify speech model inside each profile with format: {provider}/{model}/{voice}.
// if set to "system" it will use basic system text-to-speech.
// Works on windows and mac, but linux requires you to install the espeak package through your package manager eg: `apt install espeak` `pacman -S espeak`.
chat_ingame: true, // bot responses are shown in minecraft chat
language: "en", // translate to/from this language. Supports these language names: https://cloud.google.com/translate/docs/languages
render_bot_view: false, // show bot's view in browser at localhost:3000, 3001...
allow_insecure_coding: false, // allows newAction command and mode...Can you advise me how to setup the node environment with pnpm here, then run the server connecting to the minecraft server
I'll help you set up the Node environment with pnpm and run the server to connect to Minecraft. Let me first explore the project structure to understand what we're working with.
total 244
drwxrwxr-x 1 jm jm 566 Feb 23 12:36 .
drwxr-xr-x 1 jm jm 768 Feb 14 23:19 ..
-rw-rw-r-- 1 jm jm 230 Feb 23 12:30 andy.json
drwxrwxr-x 1 jm jm 68 Feb 23 12:31 bots
-rw-rw-r-- 1 jm jm 787 Feb 14 23:19 docker-compose.yml
-rw-rw-r-- 1 jm jm 592 Feb 14 23:19 Dockerfile
-rw-rw-r-- 1 jm jm 46 Feb 14 23:19 .dockerignore
-rw-rw-r-- 1 jm jm 1244 Feb 14 23:19 eslint.config.js
-rw-rw-r-- 1 jm jm 2759 Feb 14 23:19 FAQ.md
drwxrwxr-x 1 jm jm 138 Feb 23 12:36 .git
-rw-rw-r-- 1 jm jm 632 Feb 14 23:19 .gitignore
-rw-rw-r-- 1 jm jm 464 Feb 14 23:19 keys.example.json
-rw-rw-r-- 1 jm jm 470 Feb 14 23:27 keys.json
-rw-rw-r-- 1 jm jm 1073 Feb 14 23:19 LICENSE
-rw-rw-r-- 1 jm jm 2161 Feb 14 23:19 main.js
-rw-rw-r-- 1 jm jm 14909 Feb 14 23:19 minecollab.md
drwxrwxr-x 1 jm jm 924 Feb 23 12:39 node_modules
-rw-rw-r-- 1 jm jm 1534 Feb 23 12:35 package.json
drwxrwxr-x 1 jm jm 320 Feb 14 23:19 patches
-rw-rw-r-- 1 jm jm 148040 Feb 23 12:35 pnpm-lock.yaml
-rw-rw-r-- 1 jm jm 83 Feb 23 12:36 pnpm-workspace.yaml
drwxrwxr-x 1 jm jm 380 Feb 14 23:19 profiles
-rw-rw-r-- 1 jm jm 13099 Feb 14 23:19 README.md
-rw-rw-r-- 1 jm jm 104 Feb 14 23:19 requirements.txt
drwxrwxr-x 1 jm jm 16 Feb 14 23:19 services
-rw-rw-r-- 1 jm jm 3479 Feb 23 12:27 settings.js
drwxrwxr-x 1 jm jm 88 Feb 14 23:19 src
drwxrwxr-x 1 jm jm 762 Feb 14 23:19 tasks
-rw-rw-r-- 1 jm jm 1345 Feb 14 23:19 Tasks.Dockerfile
/home/jm/.local/share/pnpm/pnpm
v25.2.1
Great! Both pnpm and Node.js are already installed. Let me check the package.json and README to understand the project structure and how to run it:
<path>/home/jm/data/ai/mindcraft/package.json</path>
<type>file</type>
<content>1: {
2: "name": "mindcraft",
3: "type": "module",
4: "dependencies": {
5: "@anthropic-ai/sdk": "^0.17.1",
6: "@cerebras/cerebras_cloud_sdk": "^1.46.0",
7: "@google/genai": "^1.15.0",
8: "@huggingface/inference": "^2.8.1",
9: "@mistralai/mistralai": "^1.1.0",
10: "canvas": "^3.1.0",
11: "cheerio": "^1.0.0",
12: "express": "^4.18.2",
13: "google-translate-api-x": "^10.7.1",
14: "groq-sdk": "^0.15.0",
15: "mindcraft": "link:",
16: "minecraft-data": "^3.97.0",
17: "mineflayer": "^4.33.0",
18: "mineflayer-armor-manager": "^2.0.1",
19: "mineflayer-auto-eat": "^3.3.6",
20: "mineflayer-collectblock": "^1.4.1",
21: "mineflayer-pathfinder": "^2.4.5",
22: "mineflayer-pvp": "^1.3.2",
23: "node-canvas-webgl": "^0.3.0",
24: "open": "^10.2.0",
25: "openai": "^4.4.0",
26: "prismarine-item": "^1.15.0",
27: "prismarine-viewer": "^1.32.0",
28: "replicate": "^0.29.4",
29: "ses": "^1.9.1",
30: "socket.io": "^4.7.2",
31: "socket.io-client": "^4.7.2",
32: "three": "^0.128.0",
33: "vec3": "^0.1.10",
34: "yargs": "^17.7.2"
35: },
36: "overrides": {
37: "canvas": "^3.1.0",
38: "gl": "^8.1.6"
39: },
40: "scripts": {
41: "postinstall": "patch-package",
42: "start": "node main.js"
43: },
44: "devDependencies": {
45: "@eslint/js": "^9.13.0",
46: "eslint": "^9.13.0",
47: "eslint-plugin-no-floating-promise": "^2.0.0",
48: "globals": "^15.11.0",
49: "patch-package": "^8.0.0"
50: }
51: }
52:
(End of file - total 52 lines)
</content><path>/home/jm/data/ai/mindcraft/README.md</path>
<type>file</type>
<content>1: <h1 align="center">🧠mindcraft⛏️</h1>
2: <h1 align="center">
3: <a href="https://trendshift.io/repositories/9163" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9163" alt="kolbytn%2Fmindcraft | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
4: </h1>
5:
6: <p align="center">Crafting minds for Minecraft with LLMs and <a href="https://prismarinejs.github.io/mineflayer/#/">Mineflayer!</a></p>
7:
8: <p align="center">
9: <a href="https://github.com/mindcraft-bots/mindcraft/blob/main/FAQ.md">FAQ</a> |
10: <a href="https://discord.gg/mp73p35dzC">Discord Support</a> |
11: <a href="https://www.youtube.com/watch?v=gRotoL8P8D8">Video Tutorial</a> |
12: <a href="https://kolbynottingham.com/mindcraft/">Blog Post</a> |
13: <a href="https://github.com/users/kolbytn/projects/1">Contributor TODO</a> |
14: <a href="https://mindcraft-minecollab.github.io/index.html">Paper Website</a> |
15: <a href="https://github.com/mindcraft-bots/mindcraft/blob/main/minecollab.md">MineCollab</a>
16: </p>
17:
18: > [!Caution]
19: 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.
20:
21: # Getting Started
22: ## Requirements
23:
24: - [Minecraft Java Edition](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc) (up to v1.21.6, recommend v1.21.6)
25: - [Node.js Installed](https://nodejs.org/) (Node v18 or v20 LTS recommended. Node v24+ may cause issues with native dependencies)
26: - At least one API key from a supported API provider. See [supported APIs](#model-customization). OpenAI is the default.
27:
28: > [!Important]
29: > If installing node on...<path>/home/jm/data/ai/mindcraft/settings.js</path>
<type>file</type>
<content>1: const settings = {
2: minecraft_version: "auto", // or specific version like "1.21.6"
3: host: "192.168.66.180", // or "localhost", "your.ip.address.here"
4: port: 25562, // set to -1 to automatically scan for open ports
5: auth: "microsoft", // or "microsoft"
6:
7: // the mindserver manages all agents and hosts the UI
8: mindserver_port: 8080,
9: auto_open_ui: true, // opens UI in browser on startup
10:
11: base_profile: "assistant", // survival, assistant, creative, or god_mode
12: profiles: [
13: "./andy.json",
14: // "./profiles/gpt.json",
15: // "./profiles/claude.json",
16: // "./profiles/gemini.json",
17: // "./profiles/llama.json",
18: // "./profiles/qwen.json",
19: // "./profiles/grok.json",
20: // "./profiles/mistral.json",
21: // "./profiles/deepseek.json",
22: // "./profiles/mercury.json",
23: // "./profiles/andy-4.json", // Supports up to 75 messages!
24:
25: // using more than 1 profile requires you to /msg each bot indivually
26: // individual profiles override values from the base profile
27: ],
28:
29: load_memory: false, // load memory from previous session
30: init_message: "Respond with hello world and your name", // sends to all on spawn
31: only_chat_with: [], // users that the bots listen to and send general messages to. if empty it will chat publicly
32:
33: speak: false,
34: // allows all bots to speak through text-to-speech.
35: // specify speech model inside each profile with format: {provider}/{model}/{voice}.
36: // if set to "system" it will use basic system text-to-speech.
37: // Works on windows and mac, but linux requires you to install the espeak package through your package manager eg: `apt install espeak` `pacman -S espeak`.
38:
39: chat_ingame: true, // bot responses are shown in minecraft chat
40: language: "en", // translate to/from this language. Sup...Perfect! Now I have a good understanding of the project. Let me check if dependencies are already installed and then guide you through the setup:
total 144
drwxrwxr-x 1 jm jm 924 Feb 23 12:39 .
drwxrwxr-x 1 jm jm 566 Feb 23 12:36 ..
drwxrwxr-x 1 jm jm 6 Feb 23 12:35 @anthropic-ai
drwxrwxr-x 1 jm jm 60 Feb 23 12:39 .bin
lrwxrwxrwx 1 jm jm 38 Feb 23 12:35 canvas -> .pnpm/canvas@3.2.1/node_modules/canvas
drwxrwxr-x 1 jm jm 36 Feb 23 12:35 @cerebras
lrwxrwxrwx 1 jm jm 40 Feb 23 12:35 cheerio -> .pnpm/cheerio@1.2.0/node_modules/cheerio
drwxrwxr-x 1 jm jm 4 Feb 23 12:35 @eslint
lrwxrwxrwx 1 jm jm 39 Feb 23 12:35 eslint -> .pnpm/eslint@9.39.3/node_modules/eslint
lrwxrwxrwx 1 jm jm 92 Feb 23 12:35 eslint-plugin-no-floating-promise -> .pnpm/eslint-plugin-no-floating-promise@2.0.0/node_modules/eslint-plugin-no-floating-promise
lrwxrwxrwx 1 jm jm 41 Feb 23 12:35 express -> .pnpm/express@4.22.1/node_modules/express
lrwxrwxrwx 1 jm jm 42 Feb 23 12:35 globals -> .pnpm/globals@15.15.0/node_modules/globals
drwxrwxr-x 1 jm jm 10 Feb 23 12:35 @google
lrwxrwxrwx 1 jm jm 71 Feb 23 12:35 google-translate-api-x -> .pnpm/google-translate-api-x@10.7.2/node_modules/google-translate-api-x
lrwxrwxrwx 1 jm jm 59 Feb 23 12:35 groq-sdk -> .pnpm/groq-sdk@0.15.0_encoding@0.1.13/node_modules/groq-sdk
drwxrwxr-x 1 jm jm 18 Feb 23 12:35 @huggingface
lrwxrwxrwx 1 jm jm 2 Feb 23 12:35 mindcraft -> ..
lrwxrwxrwx 1 jm jm 56 Feb 23 12:35 minecraft-data -> .pnpm/minecraft-data@3.105.0/node_modules/minecraft-data
lrwxrwxrwx 1 jm jm 63 Feb 23 12:35 mineflayer -> .pnpm/mineflayer@4.35.0_encoding@0.1.13/node_modules/mineflayer
<path>/home/jm/data/ai/mindcraft/andy.json</path>
<type>file</type>
<content>1: {
2: "name": "Andy",
3: "model": {
4: "api": "ollama",
5: "model": "andy-4",
6: "url": "http://localhost:11434"
7: },
8: "embedding": {
9: "api": "ollama",
10: "model": "embeddinggemma",
11: "url": "http://localhost:11434"
12: }
13: }
14:
15:
(End of file - total 15 lines)
</content><path>/home/jm/data/ai/mindcraft/keys.json</path>
<type>file</type>
<content>1: {
2: "OPENAI_API_KEY": "",
3: "OPENAI_ORG_ID": "",
4: "GEMINI_API_KEY": "AIzaSyBZLQGbHfIgQLjD1XtBNQUWj0Ct3_f8kNo",
5: "ANTHROPIC_API_KEY": "",
6: "REPLICATE_API_KEY": "",
7: "GROQCLOUD_API_KEY": "",
8: "HUGGINGFACE_API_KEY": "",
9: "QWEN_API_KEY": "",
10: "XAI_API_KEY": "",
11: "MISTRAL_API_KEY": "",
12: "DEEPSEEK_API_KEY": "",
13: "GHLF_API_KEY": "",
14: "HYPERBOLIC_API_KEY": "",
15: "NOVITA_API_KEY": "",
16: "OPENROUTER_API_KEY": "",
17: "CEREBRAS_API_KEY": "",
18: "MERCURY_API_KEY": ""
19: }
20:
(End of file - total 20 lines)
</content>Perfect! I can see that:
/home/jm/.local/share/pnpm/pnpm)Now let me provide you with the complete setup and run instructions:
Your environment is mostly ready! Dependencies are already installed. Here's what you need to do:
Your andy.json is configured to use Ollama with the andy-4 model. You need to:
# Check if ollama is running
ollama list
# If models aren't installed, install them:
ollama pull sweaterdog/andy-4:micro-q8_0
ollama pull embeddinggemma
⚠️ Note: If you don't have Ollama installed or want to use a different model (like your Gemini API key), skip to Step 2.
Option A: Use Gemini API (Recommended - you already have the key)
Edit andy.json to use Gemini:
{
"name": "Andy",
"model": {
"api": "google",
"model": "gemini-2.5-pro"
}
}
Option B: Use Ollama (Local, free, but requires setup)
andy.json configOption C: Use OpenAI or other APIs
keys.jsonandy.json with the appropriate model configYour settings.js shows:
192.168.66.18025562microsoftBefore running the bot:
192.168.66.180:25562💡 For local testing, you can change to:
"host": "localhost", "port": 55916, // Default LAN port
Since you're using pnpm, run:
# Install dependencies (if needed - already done)
pnpm install
# Start the mindcraft server
pnpm start
Or directly with node:
node main.js
With specific profiles:
pnpm start --profiles ./andy.json
With a task:
pnpm start --task_path tasks/basic/single_agent.json --task_id gather_oak_logs
Once the server starts:
/msg Andy helloIf you get connection errors:
ping 192.168.66.180If you get model/API errors:
keys.json are validollama listIf you get native module errors (canvas, etc.):
# Rebuild native modules
pnpm rebuild
Assuming your Minecraft server is running and you want to use Gemini:
andy.json to use Geminicd /home/jm/data/ai/mindcraft
pnpm start
Would you like me to help you configure a specific model or troubleshoot any connection issues?
[mindcraft ❯ pnpm start --profiles ./andy.json develop ~3?2
mindcraft@ start /home/jm/data/ai/mindcraft
node main.js --profiles ./andy.json
MindServer running on port 8080
MC server found. (Host: 192.168.66.180, Port: 25565, Version: 1.21.11)
node:internal/modules/cjs/loader:1420
const err = new Error(message);
^
Error: Cannot find module '../build/Release/canvas.node'
Require stack:
I can see the issue! The canvas native module wasn't properly built during installation. This is a common issue with native dependencies. Let me help you fix this:
Let me check if the rebuild worked and try to start again:
bash{"command":"pnpm start --profiles ./andy.json","description":"Start mindcraft server","timeout":30000}
│[mindcraft ❯ pnpm node main.js --profile ./andy.json develop ~3?2
│MindServer running on port 8080
│MC server found. (Host: 192.168.66.180, Port: 25565, Version: 1.21.11)
│node:internal/modules/cjs/loader:1420
│ const err = new Error(message);
│ ^
│
│Error: Cannot find module '../build/Release/canvas.node'
│Require stack:
│- /home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/lib/bindings.js
│- /home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/lib/canvas.js
│- /home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/index.js
│- /home/jm/data/ai/mindcraft/node_modules/.pnpm/prismarine-viewer@1.33.0/node_modules/prismarine-viewer/viewer/lib/entities.js
│- /home/jm/data/ai/mindcraft/node_modules/.pnpm/prismarine-viewer@1.33.0/node_modules/prismarine-viewer/viewer/lib/viewer.js
│ at Module._resolveFilename (node:internal/modules/cjs/loader:1420:15)
│ at defaultResolveImpl (node:internal/modules/cjs/loader:1058:19)
│ at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1063:22)
│ at Module._load (node:internal/modules/cjs/loader:1226:37)
│ at TracingChannel.traceSync (node:diagnostics_channel:328:14)
│ at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
│ at Module.require (node:internal/modules/cjs/loader:1503:12)
│ at require (node:internal/modules/helpers:152:16)
│ at Object.
│js:3:18)
│ at Module._compile (node:internal/modules/cjs/loader:1760:14) {
│ code: 'MODULE_NOT_FOUND',
│ requireStack: [
│ '/home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/lib/bindings.js',
│ '/home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/lib/canvas.js',
│ '/home/jm/data/ai/mindcraft/node_modules/.pnpm/canvas@2.11.2_encoding@0.1.13/node_modules/canvas/index.js',
│ '/home/jm/data/ai/mindcraft/node_modules/.pnpm/prismarine-viewer@1.33.0/node_modules/prismarine-viewer/viewer/lib/entities.js',
│ '/home/jm/data/ai/mindcraft/node_modules/.pnpm/prismarine-viewer@1.33.0/node_modules/prismarine-viewer/viewer/lib/viewer.js'
│ ]
│}
│
│Node.js v25.2.1
│Agent process exited with code 1 and signal null
│Agent process exited too quickly and will not be restarted.
│Client connected
│Client connected
The canvas module needs to be rebuilt from source. This requires native build tools. Let me check what's missing and install the necessary dependencies:
bash{"command":"which gcc make python3 2>/dev/null || echo "Missing build tools"", "description":"Check for build tools"}
bash{"command":"dpkg -l | grep -E "libcairo2-dev|libpango1.0-dev|libjpeg-dev|libgif-dev|librsvg2-dev" || echo "Canvas deps not found"", "description":"Check canvas dependencies"}