Skip to main content

A MCP server for 3D Slicer

Project description

logo

MCP-Slicer - 3D Slicer Model Context Protocol Integration

English | 简体中文

Python Version License: MIT PyPI version

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

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

  2. 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

brew install uv

On Windows

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

and then

set Path=C:\Users\nntra\.local\bin;%Path%

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:

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

Cline Intergration

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

Usage

Open Slicer Web Server

First, open the Slicer Web Server module, ensure the required interfaces are checked, then start the server Image

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_slicer-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_slicer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_slicer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c31033b5893ba8eb2565d3f0e8e6a11f8955b7d636dcfd1ec7e485cd47209b5
MD5 3d499d6aca88c1b1373f797da1e07b10
BLAKE2b-256 288751584034c124e73179fb8150b99b095ef97caea90fe91096319b4d5d6421

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page