How to Use Claude Code with Substance 3D Painter (MCP Setup)
Claude Code can drive Adobe Substance 3D Painter directly: inspect texture sets, build layer stacks, apply smart materials, bake mesh maps and export textures for your engine, all from the terminal you already code in. This guide covers the full setup with MCP Pro for Painter, the first prompts worth trying, and fixes for the errors people actually hit.
What you need
- Adobe Substance 3D Painter 11.0 or later. Creative Cloud and Steam editions both work. The server is tested on Painter 12.0.3 and 12.2.0.
- Python 3.10, 3.11 or 3.12 on the same machine.
- Claude Code, installed and signed in.
- The MCP Pro for Painter package from itch.io. It contains the
server/Python package, example configs and the install docs.
Setup takes about ten minutes. There is no plugin to install inside Painter.
How the connection works
Painter ships with a remote scripting endpoint. When you start it with the --enable-remote-scripting flag, it listens for JSON requests on http://localhost:60041/run.json and runs the Python (or JavaScript) it receives inside the running app.
MCP Pro for Painter is a Python MCP server that sits between Claude Code and that endpoint:
Claude Code <-- stdio (MCP) --> MCP Pro for Painter <-- HTTP :60041 --> Substance 3D Painter
(Python server) /run.json --enable-remote-scripting
Claude Code starts the server as a subprocess and talks to it over stdio. Each tool call, such as list_texture_sets or add_fill_layer, becomes a small Python snippet that the server posts to Painter. Painter sends back JSON, and the server wraps it in a standard {"ok": true, "data": ...} or {"ok": false, "error": ..., "type": ...} envelope. Everything stays on your machine. The server only calls localhost unless you point it at another host.
Step 1: Launch Painter with remote scripting
The endpoint only exists when Painter starts with the flag. Quit Painter if it is already open, then start it from a terminal.
Windows
"C:\Program Files\Adobe\Adobe Substance 3D Painter\Adobe Substance 3D Painter.exe" --enable-remote-scripting
To make this permanent, right-click your Painter shortcut, open Properties, and append --enable-remote-scripting to the end of Target.
macOS
/Applications/Adobe\ Substance\ 3D\ Painter.app/Contents/MacOS/Adobe\ Substance\ 3D\ Painter --enable-remote-scripting
Linux
/opt/Adobe/Adobe_Substance_3D_Painter/Adobe\ Substance\ 3D\ Painter --enable-remote-scripting
The Linux path depends on how you installed Painter. Adjust it to match your system.
Check that the endpoint is up
From a second terminal:
curl -s -X POST http://localhost:60041/run.json \
-H 'Content-Type: application/json' \
-d '{"command": "import json; json.dumps(2+2)", "type": "python"}'
You should get {"value": "4"}. If the connection is refused, Painter is either not running or was started without the flag. Fix this before going further, because nothing else will work until this request succeeds.
Step 2: Install the MCP server
Unzip the package somewhere permanent, for example ~/tools/mcp-pro-for-painter/. Then create a virtual environment and install the package into it:
cd /ABSOLUTE/PATH/TO/mcp-pro-for-painter
python3 -m venv .venv
.venv/bin/pip install -e .
On Windows the interpreter lives at .venv\Scripts\python.exe instead of .venv/bin/python, so use .venv\Scripts\pip install -e ..
This installs three commands into the venv:
painter-mcp: the MCP server itself.painter-mcp-setup: writes client configs and runs a health check.painter-cli: calls the same tools straight from the shell, without MCP.
If you use uv, you can skip the manual venv and let uvx build one when the server starts. The config for that is shown in the next step.
Step 3: Register the server with Claude Code
Option A: let painter-mcp-setup write it
Activate the venv, cd into the project folder where you run Claude Code, and run:
painter-mcp-setup configure
The tool checks the known client config locations, starting with project-level files. If none exist, it creates .mcp.json in the current directory, which is the project-scoped config Claude Code reads. Use painter-mcp-setup paths to list every config path it knows, and painter-mcp-setup configure --target "Claude Code" to force the Claude Code target.
Option B: write .mcp.json by hand
With the pip and venv install, point Claude Code at the venv's Python:
{
"mcpServers": {
"mcp-pro-for-painter": {
"command": "/ABSOLUTE/PATH/TO/mcp-pro-for-painter/.venv/bin/python",
"args": ["-m", "server.main", "--mode", "full"]
}
}
}
With uv, use uvx instead:
{
"mcpServers": {
"mcp-pro-for-painter": {
"command": "uvx",
"args": [
"--from", "/ABSOLUTE/PATH/TO/mcp-pro-for-painter",
"painter-mcp",
"--mode", "full"
]
}
}
}
Always use absolute paths. Claude Code launches the server from its own working directory, so relative paths break as soon as you open a different project.
Option C: the claude mcp command
You can also register the server from the Claude Code CLI. Everything after -- is the command Claude Code will run:
claude mcp add mcp-pro-for-painter -- /ABSOLUTE/PATH/TO/mcp-pro-for-painter/.venv/bin/python -m server.main --mode full
Pick a tool mode
The server exposes the same tools in four sizes, selected with --mode:
| Mode | What it includes |
|---|---|
minimal | Core project, texture set, layer, mask, material and export tools only |
lite | Core plus validation, engine export presets, anchors and events |
default | Lite plus batch, baking, UV, history, layer effects, symmetry, introspection, selection, properties and project search |
full | Everything, including shaders, channel filters, the smart material builder, color management, mesh map import and saved workflows |
For Claude Code, use full. Claude Code defers loading tool definitions until it needs them, so a large tool list costs very little context. Smaller modes are for clients with hard tool limits.
Step 4: Verify the connection
- Make sure Painter is running with the flag, ideally with a project open.
- Start Claude Code in the folder that holds
.mcp.json. The first time, Claude Code asks whether to trust the project's MCP servers. Approvemcp-pro-for-painter. - Run
/mcpinside Claude Code. The server should show as connected. - Ask: "Call painter_connect."
A healthy reply looks like this:
{
"ok": true,
"data": {
"connected": true,
"painter_version": "12.2.0",
"api_version": "..."
}
}
If you get "ok": false with "type": "ConnectionError", the server is fine but Painter is not reachable. Go back to Step 1.
For a fuller check, run painter-mcp-setup doctor in a terminal. It checks Python, the mcp SDK, the server, the Painter endpoint and your client configs in one pass.
First prompts to try
Start read-only so you can see how the agent reads your project before it changes anything.
List my texture sets, and for each one tell me its resolution and how many channels it has.
Claude should call list_texture_sets and get_texture_set_info and summarize the results. Next, an audit:
Audit the layer stack of every texture set. Report empty channels, unused layers, and any layer still named with Painter's default "Layer N" pattern. Don't change anything.
This uses audit_layer_stack, find_empty_channels, find_unused_layers and validate_naming_convention. Then a small edit:
In the texture set "Body", add a fill layer called BASE_Paint at the top of the stack with a dark red base color, then list the stack again so I can check it.
Claude calls add_fill_layer with a color triple in the 0 to 1 range, then list_layers. Every layer change is wrapped in a scoped modification, so one Ctrl+Z in Painter reverts it cleanly.
Finally, an export:
Export every texture set to D:/Game/Textures/ for Unreal Engine using the packed ORM preset, 8-bit TGA. Tell me which preset Painter actually used.
This runs export_for_unreal. The response includes preset and preset_method, so you can confirm which built-in preset was picked.
Working well with Claude Code
Tool permissions
Claude Code asks before each new tool runs. Once you trust the workflow, you can allow every tool from this server by adding mcp__mcp-pro-for-painter to permissions.allow in .claude/settings.json. Read-only tools are low risk. Export tools write to whatever absolute path they are given, so keep approving those individually if your output folders matter.
Raw code execution
execute_python and execute_js let the agent run arbitrary code inside Painter. They are useful when no dedicated tool exists. If you share the machine or connect an untrusted client, start the server with --no-execute-arbitrary and both tools are removed, while everything else keeps working.
Long operations
Bakes and large exports can take minutes. The default request timeout is 30 seconds. Baking and export tools pass their own longer timeouts, but for slow machines add --timeout 120 to the server args. For exports, ask Claude to use export_textures_async and poll get_export_status, or wait with wait_for_export_complete.
Let Claude look at the result
take_viewport_screenshot saves the current viewport to a file you name. Claude Code can then open that image and comment on it. This is the easiest way to close the loop after a material change.
Write your conventions down
Put your studio rules in the project's CLAUDE.md: naming regex, resolution budget per asset type, default export folder and target engine. Claude reads it every session, so prompts can stay short.
Troubleshooting
ConnectionError: Cannot reach Painter at localhost:60041
Painter is not running, or was started without --enable-remote-scripting. Run the curl check from Step 1. If you use a custom host or port, add --host and --port to the server args. Behind a VPN or a strict firewall, try --host 127.0.0.1.
TimeoutError: Painter did not respond
Painter accepted the request but was busy. A bake or export may be running, or a modal dialog may be waiting for input. Bring Painter to the front, dismiss any dialog, and retry. Raise the global limit with --timeout 120.
The server appears but registers 0 tools
Usually the mcp package is missing from the environment Claude Code uses, or --mode has a typo. Only minimal, lite, default and full are accepted. Add -vv to the args to see which modules failed to load.
ProjectError: No project open
Most tools need an open project. Open one in Painter, or ask Claude to call open_project with the path to your .spp file.
AttributeError from the substance_painter module
The Painter Python API changes slightly between releases. The tools try known variations, but a brand-new Painter build can rename something. Run painter-cli probe smoke --category readonly to see which checks fail, then report the Painter version and failing tool on Discord.
Updating
- Download the new package from your itch.io purchase page.
- Replace the old folder, or unzip over it, keeping the same path.
- Reinstall into the venv with
.venv/bin/pip install -e . --upgrade. Withuvx, there is nothing to do. - Restart Claude Code so it launches the new server.
If the install path stays the same, .mcp.json does not need to change.