minecraft-mod-mcp-server
minecraft-mod-mcp-server
用于 Minecraft 模组包开发的 Cloudflare Workers MCP 服务器。生成 FTB Quests 章节和任务、KubeJS 脚本(武器、护甲、配方),验证 SNBT/配置文件,并提供诊断检查。
部署
此 MCP 运行在 Cloudflare Workers 上。部署后,可通过以下地址访问:
https://<your-worker>.<your-subdomain>.workers.dev/mcp本地开发使用 wrangler dev 在部署前进行预览。
Related MCP server: Datapack MCP Server
工具
FTB Quests 生成
工具 | 描述 |
| 生成完整的 FTB Quests 章节文件(SNBT 格式),包含多个任务、依赖和奖励 |
| 生成单个 FTB Quests 任务定义(item/kill/advancement/checklist 类型) |
| 为 FTB Quests 章节/任务 ID 生成 16 位随机十六进制 ID |
| 生成 |
| 生成 |
KubeJS 脚本生成
工具 | 描述 |
| 生成 KubeJS 武器注册代码(攻击伤害、速度、耐久度、技能) |
| 生成 KubeJS 护甲套装注册代码(头盔/胸甲/护腿/靴子及等级定义) |
| 生成 KubeJS 有型合成配方代码(3x3 合成模式及材料映射) |
| 生成 KubeJS 无型合成配方代码(仅材料和输出) |
| 生成 KubeJS 熔炼/熔炉/烟熏炉配方代码 |
| 生成 KubeJS 配方移除代码(覆盖或禁用原版/模组配方) |
验证与诊断
工具 | 描述 |
| 验证 SNBT 文件语法(检查未匹配的花括号、Count 格式问题等) |
| 检查 KubeJS 脚本中的常见错误(已弃用的 API、Rhino 引擎兼容性问题) |
| 生成 KubeJS 物品/护甲纹理路径指南,以确保文件放置正确 |
特性
FTB Quests 生成 — 完整的 SNBT 输出,用于带依赖、奖励和分组的任务书
KubeJS 脚本生成 — 武器、护甲、有型/无型/熔炼配方及配方移除
SNBT 验证 — 在语法错误导致游戏内运行时问题之前捕获它们
KubeJS 诊断 — 检测已弃用的 API 和 Rhino 引擎兼容性问题
零网络依赖 — 所有生成均为纯算法实现;不调用外部 API
Cloudflare Workers 部署 — 通过 Workers 边缘网络在全球范围内低延迟运行
安装(本地开发)
先决条件
Node.js 18+
npm
设置
cd minecraft-mcp-server
npm install本地运行
npm start
# or
npx wrangler dev然后通过 MCP 客户端连接到 http://localhost:8788/mcp。
部署到 Cloudflare
npm run deployMCP 客户端配置
部署后,将以下内容添加到 MCP 客户端配置中:
{
"mcpServers": {
"minecraft-mod": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-stdio"],
"env": {
"MCP_SERVER_URL": "https://<your-worker>.<your-subdomain>.workers.dev/mcp"
}
}
}
}或者如果使用基于 HTTP 的 MCP 客户端:
{
"mcpServers": {
"minecraft-mod": {
"url": "https://<your-worker>.<your-subdomain>.workers.dev/mcp"
}
}
}将 <your-worker> 和 <your-subdomain> 替换为您实际的 Cloudflare Workers 部署 URL。
架构
minecraft-mcp-server/
├── src/
│ ├── index.ts # Cloudflare Worker entry point + MCP server setup
│ ├── types.ts # Cloudflare Workers environment types
│ ├── tools/
│ │ ├── quest.ts # FTB Quests generation logic
│ │ ├── kubejs.ts # KubeJS script generation logic
│ │ └── validate.ts # SNBT validation + KubeJS diagnostics
│ └── templates/
│ ├── quest_chapter.ts
│ ├── kubejs_item.ts
│ └── kubejs_recipe.ts
├── __tests__/
│ └── unit.test.ts # Unit tests (fully offline, 49 tests)
├── vitest.config.ts # Vitest config (ESM, globals: false)
├── package.json # Dependencies (@modelcontextprotocol/sdk, agents, zod, wrangler)
└── wrangler.jsonc # Cloudflare Workers deployment config该 MCP 服务器基于 @modelcontextprotocol/sdk v1.x 构建,并使用 agents 库的 createLegacyMcpHandler 部署为 Cloudflare Worker。
测试
npm test
# or
npx vitest run全部 49 个单元测试均可完全离线运行——测试无需网络或 Cloudflare 账户。
平台兼容性
方面 | Windows | macOS | Linux |
本地开发( | ✅ | ✅ | ✅ |
单元测试( | ✅ | ✅ | ✅ |
生产环境部署 | ✅ (Cloudflare) | ✅ (Cloudflare) | ✅ (Cloudflare) |
MCP 客户端连接 | ✅ | ✅ | ✅ |
此 MCP 完全运行在 Cloudflare Workers 基础设施上。唯一的平台依赖是拥有一个启用了 Workers 的 Cloudflare 账户。所有生成逻辑均为纯 JavaScript/TypeScript,完全跨平台。
许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
Format/lint JS, Python, HubL for automation platforms. Tools: format_code, format_json, ask_codefmt
The official Svelte MCP server providing docs and autofixing tools for Svelte development
Checks whether generated Minecraft Bedrock content will actually load. Nine read-only tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables document retrieval, code generation, and code review for Minecraft China (NetEase) ModSDK development. It automates the creation of Mod projects, JSON configurations, and Python scripts while ensuring compliance with official development standards.93GPL 3.0
- AlicenseNot gradedqualityDmaintenanceValidates Minecraft datapack JSON files (recipes, advancements, loot tables, etc.) against official Minecraft data formats using Spyglass.MIT
- AlicenseNot gradedqualityBmaintenanceEnables creating Minecraft modpack structures, searching Modrinth mods, resolving dependencies, and checking compatibility.MIT
- AlicenseNot gradedqualityCmaintenanceEnables reading, validating, and managing Minecraft resource packs, including structure checks, asset listing, pack comparison, and Modrinth queries.MIT