The MCP-Slicer server enables interaction with 3D Slicer for medical image processing and scene manipulation via the Model Context Protocol.
- List and Filter MRML Nodes: Retrieve node names, IDs, or properties based on filters like class name, node name, or ID.
- Execute Python Code: Run Python scripts directly in the 3D Slicer environment to manipulate scenes, create models, and perform operations.
Provides integration with the Python Package Index for installation of the MCP-Slicer package
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.
Features
- list_nodes: List and filter Slicer MRML nodes and view their properties
- execute_python_code: Execute Python code in the Slicer environment
Installation
Prerequisites
- 3D Slicer 5.8 or newer
- Python 3.13 or newer
- uv package manager
If you're on Mac, please install uv as
On Windows
and then
Otherwise installation instructions are on their website: Install uv
⚠️ Please install UV first
Claude for Desktop Integration
Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:
Cline Intergration
Usage
Check Claude Settings
Open Slicer Web Server
- Open the Slicer Web Server module,
- ensure the required interfaces are checked,
- then start the server
Examples
- list_nodes
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
- execute python code
Draw a translucent green cube of 8 cm in the Slicer scene, mark its vertices, and then draw a red sphere inscribed in it.
Technical Details
Utilizes existing Slicer Web Server interfaces. For technical details, please see Slicer web server user guide
Limitations & Security Considerations
- The
execute_python_code
tool allows running arbitrary Python code in 3D Slicer, which is powerful but potentially dangerous.⚠️ Not recommended for production use. - Complex operations may need to be broken down into smaller steps.
Contributing
Contributions are welcome! Feel free to submit Pull Requests.
Disclaimer
This is a third-party integration project, not developed by the 3D Slicer team.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Connects 3D Slicer with AI assistants through the Model Context Protocol, enabling medical image processing and scene manipulation using natural language.
Related MCP Servers
- AsecurityFlicenseAqualityConnects Sketchup to Claude AI through the Model Context Protocol, allowing Claude to directly interact with and control Sketchup for prompt-assisted 3D modeling and scene manipulation.Last updated -10121
- AsecurityAlicenseAqualityProvides an interface between AI assistants and Tripo AI via Model Context Protocol, enabling generation of 3D assets from natural language and importing them to Blender.Last updated -15169PythonMIT License
- -securityFlicense-qualityA server that integrates Blender with local AI models via the Model Context Protocol, allowing users to control Blender using natural language prompts for 3D modeling tasks.Last updated -43Python
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to analyze images using OpenRouter vision models through a simple interface.Last updated -11PythonMIT License