AI-powered control of ZBrush through the Model Context Protocol (MCP).
This project enables AI agents to control ZBrush programmatically, providing comprehensive access to:
- Scene Management - Create, load, save projects
- Subtool Operations - List, select, create, duplicate, delete subtools
- Transform Operations - Move, rotate, scale with precision
- Sculpting - Select brushes, adjust settings, perform strokes
- Mesh Operations - Subdivide, decimate, Dynamesh, ZRemesher
- Masking - Mask all, clear, invert, mask by features
- Materials & Textures - Apply materials, polypaint, generate maps
- Rendering & Export - BPR render, viewport capture, mesh export
- Timeline & Animation - Keyframes, turntable renders
- Batch Operations - Process multiple subtools efficiently
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ AI Agent │────▶│ MCP Server │────▶│ Bridge │────▶│ ZBrush │
│ (agent.py) │◀────│(mcp_server) │◀────│ (socket/ │◀────│ (Plugin) │
└─────────────┘ └─────────────┘ │ file/batch)│ └─────────────┘
└─────────────┘
- ZBrush 2024+ with Python SDK support
- Python 3.10+
- OpenRouter API Key (for the test agent)
git clone <repository-url>
cd zbrush-agent
pip install -r requirements.txtcp .env.example .env
# Edit .env with your settingsCopy zbrush_plugin/mcp_bridge.py to your ZBrush plugins directory:
macOS:
cp zbrush_plugin/mcp_bridge.py ~/Library/Application\ Support/ZBrush/ZStartup/ZPlugs64/Windows:
copy zbrush_plugin\mcp_bridge.py "C:\Users\<username>\Documents\ZBrushData\ZStartup\ZPlugs64\"Or set the ZBRUSH_PLUGIN_PATH environment variable.
Launch ZBrush. The MCP bridge plugin will automatically start and listen on port 9876.
python agent.pyOptionally specify a different model:
python agent.py --model "openai/gpt-4o"
python agent.py --model "anthropic/claude-sonnet-4"Example commands:
> List all subtools in the current project
> Create a new sphere subtool and name it "Head"
> Subdivide the current subtool 2 times
> Apply Dynamesh at resolution 256
> Show me the viewport
> Export the mesh as OBJ to /tmp/model.obj
The MCP server supports three communication modes:
Direct TCP socket connection to ZBrush plugin.
ZBRUSH_BRIDGE_MODE=socket
ZBRUSH_HOST=localhost
ZBRUSH_PORT=9876File-based polling for environments where sockets are restricted.
ZBRUSH_BRIDGE_MODE=file
ZBRUSH_FILE_DIR=/tmp/zbrush_mcpLaunches ZBrush in batch mode for each command. Slowest but most isolated.
ZBRUSH_BRIDGE_MODE=batch
ZBRUSH_PATH=/path/to/ZBrushThe zbrush_see_viewport tool captures the current ZBrush viewport as an image, enabling multimodal AI models to:
- Verify sculpting results
- Check mesh topology
- Inspect material application
- Guide iterative workflows
zbrush-agent/
├── src/zbrush_mcp/ # Client library
│ ├── __init__.py
│ ├── client.py # Main ZBrush client
│ ├── models.py # Pydantic models
│ └── modules/ # Operation modules
│ ├── bridge.py # Communication bridges
│ ├── scene.py # Scene operations
│ ├── subtool.py # Subtool operations
│ ├── transform.py # Transform operations
│ ├── sculpting.py # Sculpting operations
│ ├── mesh.py # Mesh operations
│ ├── masking.py # Masking operations
│ ├── material.py # Material operations
│ ├── render.py # Render operations
│ ├── timeline.py # Timeline operations
│ └── batch.py # Batch operations
├── zbrush_plugin/ # ZBrush plugin
│ └── mcp_bridge.py # Socket server plugin
├── agents/ # Agent prompts
│ └── zbrush.md
├── mcp_server.py # MCP server
├── agent.py # Test agent
├── requirements.txt
├── .env.example
└── README.md
- Ensure ZBrush is running
- Check that the plugin loaded (look for "ZBrush MCP Bridge started" in ZBrush)
- Verify port 9876 is not blocked
- Check ZBrush version supports Python SDK (2024+)
- Verify plugin path is correct
- Check ZBrush console for errors
- Increase
ZBRUSH_TIMEOUTvalue - For heavy operations (ZRemesher, etc.), timeouts are expected
- Consider using batch mode for long operations
MIT