Skip to main content
Glama

protein-blender-mcp

Style protein 3D structures in Blender by describing what you want in plain English.

"Fetch 4HHB, show the protein as a cartoon colored by chain, the hemes as sticks, put it on a white background and render it."

protein-blender-mcp is a Model Context Protocol server that connects an AI assistant such as Claude to Blender. It uses Molecular Nodes to import and draw structures. The assistant turns your words into tool calls like add_style(style="sticks", selection="resname HEM", color="element"). It then renders a preview to check the result, so you can keep refining in conversation.

You ──► Claude ──► protein-blender-mcp (MCP server) ──TCP:9877──► Blender add-on ──► Molecular Nodes

What you can ask for

  • Load: fetch from the PDB (4HHB) or AlphaFold DB (UniProt ID), or open a local .pdb / .cif / .bcif / .sdf file

  • Styles: cartoon, ribbon, surface, sticks, spheres, ball-and-stick, layered on any selection

  • Selections: chains, residue ranges, ligands, binding pockets ("residues within 5 Å of ATP"), backbone, residue types

  • Colors: by element, chain, rainbow (N→C), secondary structure, residue type, B-factor, AlphaFold pLDDT, Goodsell style, or any named / hex color

  • Materials: default, ambient occlusion, flat, squishy, transparent

  • Scene: background color or transparency, camera framing from front/back/top/…, EEVEE or Cycles, resolution

  • Output: preview renders returned to the assistant, final PNG renders, saved .blend files

  • Escape hatch: run arbitrary Blender Python for anything else (lighting, animation, node tweaks)

Related MCP server: Blender MCP

Requirements

  • Blender 4.2 or newer (developed on 5.2)

  • Molecular Nodes installed and enabled in Blender

  • uv (recommended), or Python 3.10+

  • An MCP client, such as Claude Desktop, Claude Code or Cursor

Installation

1. Install the Blender add-on

  1. Download this repository and zip the addon/protein_blender_mcp folder, or run python scripts/build_addon.py, which writes dist/protein_blender_mcp.zip.

    Close every other Blender window before installing or updating any extension. Installing an extension makes Blender re-sync the shared Python packages used by all extensions, including Molecular Nodes' scipy, pandas and MDAnalysis. On Windows, a second running Blender keeps those files locked, so they get removed but not restored. Molecular Nodes then fails with errors like No module named 'databpy'. If that happens, close all Blender windows and install the zip again; the re-sync restores everything.

    You can also install from the command line (with Blender closed):

    blender --command extension install-file -r user_default -e dist/protein_blender_mcp.zip
  2. In Blender, open Edit → Preferences → Get Extensions, click the ⌄ menu in the top right, and choose Install from Disk…. Select the zip.

  3. In the 3D viewport, press N, open the Protein MCP tab, and click Start MCP Bridge.

2. Register the MCP server with your client

Claude Code

claude mcp add protein-blender -- uvx --from git+https://github.com/OmarArias-Gaguancela/protein-blender-mcp protein-blender-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "protein-blender": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/OmarArias-Gaguancela/protein-blender-mcp", "protein-blender-mcp"]
    }
  }
}

From a local clone

pip install -e .

Then use protein-blender-mcp as the command.

Set PROTEIN_BLENDER_PORT if you changed the port in the Blender panel.

Windows: Claude desktop app and uv

The Claude desktop app on Windows redirects files that programs it launches write under AppData into its own private folder. That breaks the folder links uv creates when it downloads a Python, giving errors like:

error: Missing expected target directory for Python minor version link at
`C:\Users\<you>\AppData\Roaming\uv\python\cpython-3.13...`

To fix it, store uv's Pythons outside AppData with UV_PYTHON_INSTALL_DIR, and pin Python 3.13:

claude mcp add --scope user protein-blender -e UV_PYTHON_INSTALL_DIR=C:\Users\<you>\.uv\python -- uvx --python 3.13 --from git+https://github.com/OmarArias-Gaguancela/protein-blender-mcp protein-blender-mcp

For Claude Desktop, add the same thing to the server entry:

"env": { "UV_PYTHON_INSTALL_DIR": "C:\\Users\\<you>\\.uv\\python" },
"args": ["--python", "3.13", "--from", "git+https://github.com/OmarArias-Gaguancela/protein-blender-mcp", "protein-blender-mcp"]

When you run claude mcp add from Windows PowerShell 5.1, PowerShell drops the -- separator and you get unknown option '--python'. Run the command from Git Bash, cmd, or PowerShell 7 instead.

Example prompts

  • "Load 1EMA (GFP) as a cartoon colored rainbow from N to C terminus, with the chromophore as ball-and-stick."

  • "Show 6VXX as a surface colored by chain, with a flat material on a black background."

  • "Fetch AlphaFold model P69905 and color it by pLDDT confidence."

  • "Zoom in on the binding pocket of 3HTB: residues within 5 Å of the ligand as sticks, everything else as a transparent cartoon."

  • "Make the helices cylinders and the sheets flat, then render a 1920×1080 image with Cycles to ~/Desktop/figure.png."

Tools

Tool

What it does

get_scene_info

Molecules, chains, ligands, style layers, render settings

fetch_structure

Download from RCSB or AlphaFold DB with an initial style

load_file

Load a local structure file

add_style

Add a style layer to a selection with a color and material

clear_styles / remove_style

Remove style layers

frame_camera

Point the camera at a molecule or selection

set_background

Background color or transparency

set_render_settings

Engine, resolution, samples

render_image

Render and return the image

delete_molecule, save_blend

Scene housekeeping

execute_blender_python

Run custom Python inside Blender

Security note

The Blender add-on listens only on 127.0.0.1. The execute_blender_python tool runs whatever code the assistant sends, so only connect clients you trust. Stop the bridge from the panel when you're not using it.

Troubleshooting

  • "Could not reach Blender": make sure Blender is open and the panel says Running on port 9877.

  • "Molecular Nodes is not installed": install it from Get Extensions and enable it.

  • Nothing visible after styling: ask the assistant to call get_scene_info and frame_camera. A selection may have matched no atoms.

License

MIT

Available Tools

13 tools
add_styleA

Add a style layer to a molecule, optionally limited to a selection.

Layers stack, so "cartoon for the protein plus sticks for the ligand" is two calls. molecule is the object name from get_scene_info (default: the active or most recently loaded one). label names the layer for later removal.

options passes extra settings straight to the Molecular Nodes style node, e.g. cartoon: {"quality": 4, "helix_shape": "Cylinder", "loop_radius": 0.3, "sheet_arrows": "Flat"}; surface: {"quality": 4, "scale": 1.5, "separate_by": "chain_id"}; spheres/sticks: {"scale": 0.8}.

Selections use MDAnalysis selection syntax, for example: "chainID A" one chain (also "segid A") "chainID A B" several chains "protein" / "nucleic" all protein / DNA-RNA atoms "resid 10:50" residue range "resname HEM" a ligand or residue type by name "not protein and not nucleic and not water" ligands and other het groups "protein and around 5 resname ATP" binding pocket within 5 A "backbone" / "name CA" backbone atoms / alpha carbons "resname LYS ARG" / "resname ASP GLU" basic / acidic residues Combine with and / or / not and parentheses.

Color can be a scheme or a single color. Schemes: "element", "chain", "rainbow" (N->C terminus), "secondary_structure", "residue_type", "b_factor", "plddt", "goodsell". Single colors: a name ("red", "skyblue", "gold"...), a hex code ("#ff8800") or an RGB list ([255, 136, 0]).

Inputs: style (required), color, label, options, +3 more.

clear_stylesB

Remove every style layer from a molecule so it can be restyled from scratch.

Inputs: molecule.

delete_moleculeC

Remove a molecule from the scene.

Inputs: molecule (required).

execute_blender_pythonA

Run Python inside Blender for anything the other tools do not cover (custom lighting, node tweaks, animation). Available names: bpy, mn (Molecular Nodes), mg (Molecular Nodes geometry nodes), get_molecule(name). Assign to result or print() to return output. Prefer the dedicated tools when they fit.

Inputs: code (required).

fetch_structureA

Download a structure by ID and add it to the scene with an initial style.

pdb_id: a PDB code like "4HHB", or a UniProt accession when database is "alphafold". Use style="none" to load without any style and build it up with add_style.

Inputs: pdb_id (required), color, style, database, +1 more.

frame_cameraC

Point the scene camera at a molecule, or zoom in on a selection such as a binding site, from the given viewpoint.

Inputs: molecule, selection, viewpoint.

get_scene_infoA

List the molecules in the scene with their chains, ligands, residue counts and current style layers, plus render settings and the available styles, color schemes and materials. Call this before styling to learn chain IDs and ligand names.

Inputs: no named parameters.

load_fileC

Load a local structure file (.pdb, .cif, .bcif, .sdf, .mol) into the scene.

Inputs: path (required), color, style, material.

remove_styleB

Remove one style layer by its index (see get_scene_info).

Inputs: index (required), molecule.

render_imageA

Render the scene from the camera and return the image so you can check the styling. preview=True renders at 50% size for speed; set preview=False and give a path for the final figure.

Inputs: path, preview.

save_blendC

Save a copy of the current scene as a .blend file.

Inputs: path (required).

set_backgroundA

Set the background color the camera sees (name or hex), or make it transparent for figures placed on another background. Lighting is kept separate, so dark backgrounds still light the molecule; raise lighting_strength (e.g. 1.5) for a brighter scene.

Inputs: color, transparent, lighting_strength.

set_render_settingsB

Choose the render engine (EEVEE is fast, CYCLES is photoreal), output size in pixels and sample count.

Inputs: width, engine, height, samples.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action: scene inspection, structure acquisition (fetch_structure by ID vs load_file from disk, clearly differentiated), style layer lifecycle (add/remove/clear), camera, background, render settings, render, save, and delete. The only potential overlap is execute_blender_python as a catch-all escape hatch, but its description explicitly says to prefer the dedicated tools, so boundaries stay clear.

    Naming Consistency5/5

    All 13 names follow a strict verb_noun snake_case pattern (get_scene_info, add_style, remove_style, clear_styles, set_background, render_image, fetch_structure, load_file). No camelCase or vague bare verbs anywhere in the set.

    Tool Count5/5

    13 tools sits squarely in the well-scoped range and each one maps to a real step in the molecular-visualization workflow: load, style, frame, light/background, render, save. Nothing feels redundant or padded.

    Completeness4/5

    The domain lifecycle is well covered — acquisition (fetch/load), styling with layered add/remove/clear, camera framing, background, render settings, rendering, saving and deletion — with execute_blender_python as a safety net. Minor gaps remain around exporting to non-.blend formats, transforming/duplicating molecules, and scene-level lighting controls being only partially exposed (via background or Python).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers