Labsco
MCP SERVER

Slicer MCP

by zhaoyouj

Reach into a running 3D Slicer: list MRML nodes by class, name or ID, run Python inside Slicer's own environment and get the result back, and capture what the application currently looks like.

Biomedical: Genomics & Clinical DataVerified
Summary
The screenshot is what makes the Python worth having.

Node listing tells you what is loaded and execute_python_code does the work, but the third tool closes the loop: the model can see the current interface — panels, slice views, the 3D rendering, overlays — and act on what it sees rather than on what it assumed happened. One convention to know before the first call: execute_python_code returns nothing unless the code assigns its result to a variable named __execResult.

What it is

A three-tool bridge into 3D Slicer over its Web Server API — scene listing, Python execution and screenshots.

What you get
  • list_nodes across the MRML scene, returning names, IDs or properties and filterable by class_name, name and id
  • execute_python_code inside Slicer's own Python environment, returning whatever the code assigns to __execResult
  • capture_screenshot of the whole application window including dock widgets and slice views, or of one named view, with the camera axis and image size selectable
Requirements

3D Slicer running with its Web Server enabled — all three tools reach it through the Slicer Web Server API.

Setup effort

One command — uvx mcp-slicer