基本能力
产品定位
MCP-Slicer是一个用于3D Slicer的集成工具,通过MCP协议实现与模型客户端的交互,支持自然语言控制3D Slicer进行医学图像处理和场景操作。
核心功能
- list_nodes:列出并过滤Slicer MRML节点,查看其属性。
- execute_python_code:在Slicer环境中执行Python代码。
适用场景
- 医学图像处理
- 3D场景创建与操作
- 通过自然语言控制3D Slicer
工具列表
- list_nodes:用于查看和过滤Slicer中的节点及其属性。
- execute_python_code:用于在Slicer中执行Python代码,实现复杂操作。
常见问题解答
- 安全性问题:
execute_python_code
工具允许在3D Slicer中执行任意Python代码,具有潜在危险,不建议在生产环境中使用。 - 复杂操作:可能需要将复杂操作分解为多个小步骤。
使用教程
使用依赖
- 3D Slicer 5.8或更高版本
- Python 3.13或更高版本
- uv包管理器
安装uv
- Mac:
bash
brew install uv - Windows:
bash
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\nntra\.local\bin;%Path%
安装教程
- Claude Desktop集成:
在Claude > Settings > Developer > Edit Config > claude_desktop_config.json中添加以下内容:
json
{
"mcpServers": {
"slicer": {
"command": "uvx",
"args": ["mcp-slicer"]
}
}
} - Cline集成:
在配置文件中添加与Claude Desktop相同的内容。
调试方式
- 检查Claude设置:确保在Claude Desktop App中看到相应的slicer工具。
- 启动Slicer Web Server:
- 打开Slicer Web Server模块。
- 确保所需的接口已勾选。
- 启动服务器。
示例
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.