blockbench-mcp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blockbench MCP Integration

Blockbench MCP 集成

Connect Blockbench to Claude AI via Model Context Protocol for AI-assisted 3D modeling.
通过Model Context Protocol(MCP)将Blockbench与Claude AI连接,实现AI辅助3D建模。

Overview

概述

BlockbenchMCP enables Claude to directly interact with and control Blockbench, allowing:
  • AI-assisted 3D model creation
  • Texture application and manipulation
  • Real-time model modifications
  • Automated modeling operations
BlockbenchMCP 允许Claude直接与Blockbench交互并对其进行控制,支持以下功能:
  • AI辅助3D模型创建
  • 纹理的应用与编辑
  • 实时模型修改
  • 自动化建模操作

Prerequisites

前置要求

  • Blockbench 4.0 or newer
  • Node.js 18.0 or newer
  • pnpm package manager
  • Blockbench 4.0 或更高版本
  • Node.js 18.0 或更高版本
  • pnpm 包管理器

Installation

安装步骤

Step 1: Install pnpm

步骤1:安装pnpm

bash
npm install -g pnpm
bash
npm install -g pnpm

Step 2: Clone and Build

步骤2:克隆并构建项目

bash
git clone https://github.com/enfp-dev-studio/blockbench-mcp.git
cd blockbench-mcp
pnpm install
pnpm build
bash
git clone https://github.com/enfp-dev-studio/blockbench-mcp.git
cd blockbench-mcp
pnpm install
pnpm build

Step 3: Build the Blockbench Plugin

步骤3:构建Blockbench插件

bash
cd apps/mcp-plugin
pnpm build
bash
cd apps/mcp-plugin
pnpm build

Step 4: Install Plugin in Blockbench

步骤4:在Blockbench中安装插件

  1. Open Blockbench
  2. Go to File → Plugins → Load Plugin from File
  3. Select plugin from
    apps/mcp-plugin/dist/
  4. Enable by checking "MCP Plugin"

  1. 打开Blockbench
  2. 进入 文件 → 插件 → 从文件加载插件
  3. 选择
    apps/mcp-plugin/dist/
    目录下的插件文件
  4. 勾选“MCP Plugin”启用插件

Configuring MCP Client

配置MCP客户端

Option A: Antigravity (Recommended for this workspace)

选项A:Antigravity(此工作区推荐)

Antigravity has native MCP support! Configure it directly in your workspace:
Method 1: Via UI
  1. In Antigravity, go to Agent Session → MCP Servers → Manage MCP Servers
  2. Add a new MCP server with the blockbench configuration
Method 2: Via Config File
Create
.mcp.json
in your workspace root (
e:\Hytale Modding\.mcp.json
):
json
{
  "mcpServers": {
    "blockbench": {
      "command": "node",
      "args": [
        "C:/path/to/blockbench-mcp/apps/mcp-server/dist/index.js"
      ]
    }
  }
}
Replace
C:/path/to/blockbench-mcp
with your actual installation path.
After configuration, Claude in Antigravity will have direct access to Blockbench tools!

Antigravity原生支持MCP!可直接在工作区中配置:
方法1:通过UI界面
  1. 在Antigravity中,进入 Agent Session → MCP Servers → 管理MCP服务器
  2. 添加一个新的MCP服务器并配置Blockbench相关参数
方法2:通过配置文件
在工作区根目录创建
.mcp.json
文件(示例路径:
e:\Hytale Modding\.mcp.json
):
json
{
  "mcpServers": {
    "blockbench": {
      "command": "node",
      "args": [
        "C:/path/to/blockbench-mcp/apps/mcp-server/dist/index.js"
      ]
    }
  }
}
C:/path/to/blockbench-mcp
替换为你的实际安装路径。
配置完成后,Antigravity中的Claude将可直接访问Blockbench工具!

Option B: Claude Desktop

选项B:Claude Desktop

Add to Claude Desktop config:
Windows:
%APPDATA%\Claude\claude_desktop_config.json
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
json
{
  "mcpServers": {
    "blockbench": {
      "command": "node",
      "args": [
        "/path/to/blockbench-mcp/apps/mcp-server/dist/index.js"
      ]
    }
  }
}

添加配置到Claude Desktop的配置文件中:
Windows系统:
%APPDATA%\Claude\claude_desktop_config.json
macOS系统:
~/Library/Application Support/Claude/claude_desktop_config.json
json
{
  "mcpServers": {
    "blockbench": {
      "command": "node",
      "args": [
        "/path/to/blockbench-mcp/apps/mcp-server/dist/index.js"
      ]
    }
  }
}

Usage

使用方法

Starting the Connection

启动连接

  1. In Blockbench, open View → Panels
  2. Find "MCP Plugin" panel
  3. Click "Connect to MCP Server"
  4. Plugin listens on port 9999
  1. 在Blockbench中,打开 视图 → 面板
  2. 找到“MCP Plugin”面板
  3. 点击 “连接到MCP服务器”
  4. 插件将在 9999端口 监听连接

Capabilities

功能特性

Once connected, Claude can:
  • Get model and project information
  • Create, delete, and modify block models
  • Apply textures and materials
  • Execute custom modeling operations
  • Track command history in real-time
连接成功后,Claude可实现以下操作:
  • 获取模型与项目信息
  • 创建、删除及修改方块模型
  • 应用纹理与材质
  • 执行自定义建模操作
  • 实时追踪命令历史

Example Prompts for Claude

给Claude的示例提示词

"Create a simple sword model with proper proportions"
"Add a crossguard to the existing sword model"
"Create a chest model with opening animation"
"Generate a pickaxe tool with different material variants"
"Show me the current model structure and elements"
"Create a character head with facial features"
"创建一个比例合适的简单剑模型"
"给现有剑模型添加护手"
"创建一个带开启动画的箱子模型"
"生成带有不同材质变体的镐子工具"
"展示当前模型的结构与元素"
"创建一个带面部特征的角色头部"

Architecture

架构说明

Claude AI ← MCP Protocol → MCP Server ← Socket.IO → Blockbench Plugin
  • Socket.IO for real-time communication
  • WebSocket on port 9999
  • JSON-based commands with type/payload structure
  • Event-driven architecture
Claude AI ← MCP协议 → MCP服务器 ← Socket.IO → Blockbench插件
  • 采用 Socket.IO 实现实时通信
  • 9999端口 基于WebSocket通信
  • 采用 JSON格式 的命令结构,包含类型与负载
  • 基于 事件驱动 的架构设计

Project Structure

项目结构

blockbench-mcp/
├── apps/
│   ├── mcp-server/     # MCP server (Node.js)
│   └── mcp-plugin/     # Blockbench plugin
└── packages/
    └── shared/         # Shared TypeScript types
blockbench-mcp/
├── apps/
│   ├── mcp-server/     # MCP服务器(Node.js)
│   └── mcp-plugin/     # Blockbench插件
└── packages/
    └── shared/         # 共享TypeScript类型定义

Troubleshooting

问题排查

IssueSolution
Connection issuesEnsure Blockbench plugin running, MCP server configured
Port conflictsPort 9999 in use - close conflicting apps
Plugin not loadingVerify build successful, Blockbench version compatible
Command timeoutsSimplify requests, break into smaller steps
No tools in AntigravityCheck .mcp.json path is correct, restart Antigravity
No hammer icon in Claude DesktopRestart Claude Desktop after config change
问题解决方案
连接问题确保Blockbench插件已运行,MCP服务器配置正确
端口冲突9999端口被占用 - 关闭占用该端口的应用
插件无法加载验证构建是否成功,Blockbench版本是否兼容
命令超时简化请求内容,拆分为更小的步骤
Antigravity中无可用工具检查.mcp.json路径是否正确,重启Antigravity
Claude Desktop中无锤子图标修改配置后重启Claude Desktop