MCP-Slicer

by zhaoyouj

Not rated
GitHub

About

Integrates 3D Slicer with model clients via MCP, allowing natural language control for medical image processing and scene manipulation.

Details

Author
zhaoyouj
Categories
Developer Tools, Other, AI, Automation

Setup

Install MCP-Slicer in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/zhaoyouj/mcp-slicer

Follow the installation instructions in the repository README, then restart your MCP client.

MCP-Slicer - 3D Slicer Model Context Protocol Integration

MCP-Slicer connects 3D Slicer with model clients like Claude Desktop or Cline through the Model Context Protocol (MCP), enabling direct interaction and control of 3D Slicer. This integration allows for medical image processing, scene creation, and manipulation using natural language.
-

list_nodes: List and filter Slicer MRML nodes and view their properties

execute_python_code: Execute Python code in the Slicer environment

capture_screenshot: Capture real-time screenshots of Slicer views

- Full application window (including module panels)
- Individual slice views (Red/Yellow/Green)
- 3D rendering view
- Enables complete REACT loop with visual feedback

- 3D Slicer 5.8 or newer
- Python 3.13 or newer
- uv package manager

If you're on Mac, please install uv as

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\nntra\.local\bin;%Path%

Otherwise installation instructions are on their website:Install uv

Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:

{ "mcpServers": { "slicer": { "command": "uvx", "args": ["mcp-slicer"] } } }
{ "mcpServers": { "slicer": { "command": "uvx", "args": ["mcp-slicer"] } } }

- Open the Slicer Web Server module,
- ensure the required interfaces are checked,
- then start the server

What Markups nodes are in the Slicer scene now, list their names, what is their length if it is a line, and what is its angle if it is an angle

Draw a translucent green cube of 8 cm in the Slicer scene, mark its vertices, and then draw a red sphere inscribed in it.

Capture the current state of Slicer to provide visual feedback to AI

- capture_screenshot()- Capture full application window
- capture_screenshot(view_type="slice", view_name="red")- Capture Red slice view
- capture_screenshot(view_type="3d", camera_axis="A")- Capture 3D view from anterior

This enables a complete REACT loop where AI can:
- Reasonabout what to do
- Actusingexecute_python_code
- Observethe result usingcapture_screenshot

Utilizes existing Slicer Web Server interfaces. For technical details, please see[Slicer web server user guide

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.