内容
# 通用Blender MCP服务器(UBM)
> 与Link2Blender.skill配合使用,使您的AI代理能够通过操纵CLI并利用Rust本地截图功能来创建Blender模型、动画和游戏资产。
## 概述
UBM是一个通用的Blender MCP服务器,可供任何AI代理使用:
- **Claude Desktop** 通过MCP
- **Cursor** 通过MCP
- **VS Code** 通过MCP
- **Link2Blender.skill** (LBD)适用于OpenClaw生态系统
## 架构
```
AI 代理(Claude/Cursor/小跃)
↓ (MCP / OpenClaw 协议)
UBM MCP 服务器
↓ (CLI / TCP 套接字)
Blender + UBM 插件
↓ (bpy)
3D 场景
```
## 功能
- 🚀 **Rust本地截图** - 高性能视口捕获
- 🔧 **完整CLI** - 直接命令执行(`ubm create`,`ubm capture`)
- 🎯 **MCP协议** - 标准模型上下文协议
- 🌐 **通用** - 与任何AI代理一起工作
- 📦 **Blender插件** - 原生Blender集成
## 安装
```bash
pip install universal-blender-mcp
```
或从源代码安装:
```bash
git clone https://github.com/Starsails/UniversalBlenderMCP
cd UniversalBlenderMCP
pip install -e ".[dev]"
# 可选:构建Rust截图模块
pip install maturin
maturin develop
```
## 使用
### 作为MCP服务器(适用于Claude Desktop)
添加到Claude Desktop配置:
```json
{
"mcpServers": {
"blender": {
"command": "ubm",
"args": ["serve", "--stdio"]
}
}
}
```
### CLI
```bash
# 启动服务器
ubm serve
# 创建对象
ubm create --type CUBE --location 0 0 0 --size 2
# 变换
ubm transform "Cube" --location 5 0 0 --rotation 0 0 1.57
# 捕获视口(使用Rust本地截图)
ubm capture --output screenshot.png --width 1920 --height 1080
# 检查状态
ubm status
```
### 与Link2Blender.skill配合使用
参见 [Link2Blender.skill](../Link2Blender/) 以获取OpenClaw集成。
## 开发
### 项目结构
```
UniversalBlenderMCP/
├── src/
│ ├── server/ # MCP服务器实现
│ │ ├── mcp_server.py
│ │ └── tools/ # MCP工具
│ ├── cli/ # CLI接口
│ │ └── main.py
│ ├── blender/ # Blender通信
│ │ └── connector.py
│ └── rust_bridge/ # Rust截图绑定
├── rust/ # Rust本地模块
│ └── src/
│ └── lib.rs
├── addon/ # Blender插件
│ └── __init__.py
└── tests/
```
### 运行测试
```bash
pytest tests/ -v
```
### 构建Rust模块
```bash
cd rust
maturin develop # 用于开发
maturin build # 用于分发
```
## 版本兼容性
| UBM | Link2Blender.skill |
|-----|-------------------|
| 0.1.x | 0.1.x |
## 许可证
MIT