world-of-claudecraft-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@world-of-claudecraft-mcp reset the game and play for 20 steps"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
world-of-claudecraft-mcp
一个 MCP server 适配器,让 LLM agent(如 OpenClaw)完全接管并自己玩 World of ClaudeCraft。
它把游戏官方的 headless 环境(headless/env_server.ts,NDJSON over stdio)包成一组
MCP 工具。LLM 当 policy:读状态 → 决策 → 执行动作,循环往复,直到一局结束。
游戏内核(Sim)是官方同一个,无需重写任何游戏逻辑。
观测向量(数值)被解码成 LLM 能读懂的文字:血量/蓝量/等级/朝向、当前目标、 5 个最近怪物、可交互物、任务进度、每个技能的就绪/冷却。
动作是命名枚举(来自游戏的
ACTIONS列表),LLM 直接选名字,不用猜整数。
1. 前置:构建游戏的 headless 环境
这个 MCP server 本身只是个"翻译层",它要 spawn 游戏编译出的 env_server.cjs。
所以先在**你的机器(Mac 推荐)**上把游戏的环境构建出来:
git clone https://github.com/levy-street/world-of-claudecraft
cd world-of-claudecraft
npm install
npm run build:env # 产出 dist-env/env_server.cjs
node dist-env/env_server.cjs --bench # 可选:跑个吞吐基准验证能起来Related MCP server: AgentSpawnMCP
2. 构建这个 MCP server
cd world-of-claudecraft-mcp
npm install
npm run build # 产出 dist/index.js3. 接进 OpenClaw 的 MCP 配置
把下面这段加进 OpenClaw 的 MCP servers 配置(路径改成你机器上的绝对路径):
{
"mcpServers": {
"world-of-claudecraft": {
"command": "node",
"args": ["/ABS/PATH/TO/world-of-claudecraft-mcp/dist/index.js"],
"env": {
"WOC_ENV_SERVER": "/ABS/PATH/TO/world-of-claudecraft/dist-env/env_server.cjs"
}
}
}
}也可以设环境变量 WOC_ENV_SERVER 指向 env_server.cjs,不写进配置。
4. 让 OpenClaw「自己玩」
LLM 就是玩家。给它这套系统提示词 / 操作规程,它就会自主循环:
你是 World of ClaudeCraft(类魔兽世界经典版的 MMO)的玩家。用
wow_*工具自主游玩, 不要等人类一步步指令,自己读状态、自己决策、自己执行。循环:
调用
wow_reset开新的一局(可选 seed 以复现)。反复执行:调用
wow_state读当前局面 → 决定接下来 1~10 个动作 → 用wow_play([...])一次性执行这批动作。当某次返回
terminated=true或truncated=true时,这一局结束, 调用wow_reset开下一局,或调用wow_close收工。生存本能: HP 低(看 HP%)就
eat_drink;附近有敌对怪物就target_nearest然后attack;技能就绪(ability_N在 ready 列表里)且合适就放; 有可交互物(corpse/object/quest)就interact去拾取/接任务/交任务。目标优先级: 活着 > 完成/交付任务(升级拿 XP)> 击杀练级。
forward/turn_left/turn_right/strafe_*用来走位接近或拉开距离。
动作速查(来自 wow_list_actions)
动作 | 含义 |
| 什么都不做 |
| 前进 / 后退 |
| 转向(同时前进) |
| 横移 |
| 跳(带前进) |
| 选最近的敌人 |
| 开始自动攻击当前目标 |
| 按学会顺序施放技能(N 随职业不同) |
| 拾取尸体 / 开物体 / 与任务 NPC 对话 |
| 停止移动和攻击 |
| 吃喝回血/回蓝 |
5. 成本与收敛提醒
默认每个 env step = 5 个 sim tick(约每秒 4 次决策)。每次
wow_step都是一次 LLM 调用。 一局最长 8000 步 → 最多 8000 次调用,单局成本不低。 务必用wow_play([...])批量执行(一次 LLM 调用推进多步),而不是一步步wow_step。想更省:可在
wow_reset的config里调大frameSkip(每步推进更多 tick,决策更稀疏), 或调小maxSteps。环境是确定性的:同
seed+ 同动作序列 = 完全可复现,方便调试 agent 行为。
6. 文件结构
world-of-claudecraft-mcp/
├── src/
│ ├── index.ts # MCP server:暴露 wow_* 工具
│ ├── env_client.ts # spawn env_server.cjs 的 NDJSON stdio 客户端
│ └── obs_decode.ts # 把数值观测向量解码成 LLM 可读文字(依据 src/sim/obs.ts)
├── package.json
├── tsconfig.json
├── openclaw-mcp-config.json # 直接抄进 OpenClaw MCP 配置
└── README.md7. 本地冒烟测试(无需构建完整游戏)
想先验证适配器本身(客户端往返 + 观测解码)不依赖完整游戏,可用仓库里的 mock:
npm run build
WOC_ENV_SERVER="$(pwd)/mock_env.cjs" node test_run.mjs它会打印解码后的可读状态,确认动作/目标/怪物/任务都被正确还原。
已知限制 / 可增强
技能在观测里是
ability_1..N(按学会顺序的槽位),没有映射成真实法术名 (如 "Heroic Strike")。想让 LLM 知道每个槽位是什么技能,可额外读src/sim/content的职业技能表做一层名字映射。仅接了 headless 离线环境(和真实 Sim 同源,但是单人对练,不是线上服)。 想上
worldofclaudecraft.com和真人同场,需要另写 WS/REST 客户端(并注意反 bot / ToS)。
Available Tools
7 toolswow_closeA
Shut down the environment subprocess. Call when you are completely done playing.
Inputs: no named parameters.
wow_infoA
Return environment metadata: observation size, number of actions, the full action vocabulary, and max level. Call once at the start to learn the action names.
Inputs: no named parameters.
wow_list_actionsA
List the available action names for the current class setup. Same as wow_info action list.
Inputs: no named parameters.
wow_playA
Apply a SEQUENCE of named actions, one env step each. Fewer round-trips than calling wow_step repeatedly, so prefer batches of 1-10 actions per call. Stops early if the episode ends. Returns total reward, end flags, and final state.
Inputs: actions (required).
wow_resetA
Start a NEW episode (or restart after one ends). Returns the initial decoded game state. player_class examples: warrior, paladin, priest, mage, hunter, rogue, warlock, druid, shaman.
Inputs: seed, talents, player_class, player_level.
wow_stateA
Re-decode and return the CURRENT game state without taking any action. Use this to read the situation before deciding.
Inputs: no named parameters.
wow_stepA
Take ONE named action and advance the sim by one env step (5 sim ticks ~ 0.25s). Returns reward, end flags, and the new decoded state.
Inputs: action (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have distinct purposes, but wow_info and wow_list_actions overlap in listing actions, causing minor ambiguity. The distinction between wow_step and wow_play is clear (single vs batch).
All tools start with 'wow_' and use underscores, but some verbs are nouns (wow_state) and two tools (info, list_actions) serve similar informational roles with different names.
7 tools is well-scoped for a game environment MCP server, covering reset, step, batch play, shutdown, info, actions, and state without unnecessary extras.
The tool surface covers all essential operations for interacting with a game environment: starting, stepping, batching, closing, metadata, and state reading. No obvious gaps.
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
An MCP server that provides agents access to the KeldynAI platform
Hosted YouTube MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server to dynamically load Claude Code skills into AI agents515MIT
- AlicenseNot gradedqualityDmaintenanceA universal MCP server for spawning agents with any OpenAI-compatible LLM, supporting cloud and local models, and integrating with Claude Code, OpenCode, and Codex CLI.61 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets Claude control a Minecraft bot with 40+ actions including movement, combat, crafting, and inventory management. Built on Mineflayer, it supports Microsoft authentication, pathfinding, and auto-reconnect.3MIT
- FlicenseCqualityDmaintenanceAn MCP server that exposes Discord bot actions as tools for LLM clients.291-