Skip to main content
Glama

Cellpose MCP Server

Python 3.10+ License: BSD-3-Clause PyPI

Cellpose-mcp 是一个 Model Context Protocol (MCP) 服务器,它使 Claude、Cursor IDE 等 AI 助手能够通过自然语言命令执行细胞分割。该工具通过 13+ 个 MCP 工具提供全面的 Cellpose 功能,包括 2D/3D 分割、批处理、图像恢复(去噪、去模糊、上采样)和自定义模型训练。该系统可与 Napari 无缝集成,支持从分割到交互式可视化的完整工作流。

Cellpose-MCP Research Poster

📌 注意:本项目最初是一个受 napari-mcp 启发、为 Cellpose 分割工作流改编的趣味项目。如果您愿意贡献代码,请通过 ssahu2@ucmerced.edu 与我联系。

🚀 快速开始

要求: Python 3.10、3.11 或 3.12,以及 Cellpose 3.1.1.2。

Cellpose 4 不包含此服务器所使用的恢复 API。该软件包将版本固定为 Cellpose 3 的最终版本,直至恢复功能有经过测试的替代方案。

从 PyPI 安装:

pip install cellpose-mcp

一步安装并配置 Cursor:

pip install cellpose-mcp && cellpose-mcp-install cursor

安装程序使用运行该命令的 Python 解释器(若存在名为 Cellpose_mcp 的 conda 环境,则使用该环境)。配置完成后请重启 Cursor。

开发模式安装(从源码):

git clone https://github.com/surajinacademia/cellpose_mcp.git
cd cellpose_mcp
pip install -e .

自动配置您的 AI 应用

执行 pip install cellpose-mcp 后,为您的应用运行安装程序。它会使用您当前的 Python 写入正确的 MCP 配置文件。

应用程序

命令

备注

Cursor IDE

cellpose-mcp-install cursor

写入 ~/.cursor/mcp.json

Claude Desktop

cellpose-mcp-install claude-desktop

添加到 Claude Desktop 配置

Antigravity

cellpose-mcp-install antigravity

配置 Antigravity MCP

VS Code (Cline/Roo Cline)

cellpose-mcp-install vscode

配置 Cline/Roo Cline 扩展

Claude Code

仅手动

请参阅下面的手动配置

选项:使用 --python-path /path/to/python 指定特定的 Python;使用 --env-name NAME 指定 conda 环境(默认:Cellpose_mcp)。

如果您更倾向于手动设置(或使用 Claude Code),请在项目根目录中创建 .mcp.json 文件。如果 python 不是安装了 cellpose-mcp 的解释器(例如 venv 或 conda),请使用 Python 可执行文件的完整路径:

{
  "mcpServers": {
    "cellpose": {
      "command": "python",
      "args": ["-m", "cellpose_mcp"],
      "env": {
        "KMP_DUPLICATE_LIB_OK": "TRUE",
        "OMP_NUM_THREADS": "1"
      }
    }
  }
}

对于 Cursor,请在 ~/.cursor/mcp.json(全局)或项目中的 .cursor/mcp.json 中使用相同的结构。

安装完成后,重启您的 AI 应用并尝试提问:

"Can you list available Cellpose models?"
"Segment the cells in ./data/sample.tif using the cyto2 model"

🎯 您可以做什么?

示例:细胞分割实战

基本细胞分割

"Segment the cells in ./data/sample.tif using the cyto2 model"
"List available Cellpose models"
"Estimate cell diameter from ./data/image.tif"

高级工作流

"Segment all TIFF files in ./data/images/ and save masks to ./output/"
"Train a custom segmentation model using images in ./train/images/ and masks in ./train/masks/"
"Restore and segment the noisy image in ./data/noisy.tif using oneclick_cyto3"

批处理

"Process all images in ./data/ with the cyto2 model and save results to ./output/"

Related MCP server: BambuStudio MCP Server

🛠 可用的 MCP 工具

该服务器提供 13+ 个工具,涵盖完整的 Cellpose 功能:

分割工具

  • segment_cells_2d - 分割 2D 图像中的细胞

  • segment_cells_3d - 分割 3D 体数据中的细胞

  • segment_cells_batch - 批量处理多张图像

图像恢复工具

  • denoise_image - 对显微图像去噪

  • deblur_image - 对显微图像去模糊

  • upsample_image - 对低分辨率图像进行上采样

  • restore_and_segment - 恢复与分割组合

训练工具

  • train_segmentation_model - 训练自定义分割模型

  • train_restoration_model - 训练自定义恢复模型

实用工具

  • list_available_models - 列出所有预训练模型

  • estimate_cell_diameter - 从图像中估计细胞直径

  • save_masks - 以多种格式保存掩膜

  • load_image_info - 获取图像元数据

📖 文档

📋 架构

  • FastMCP 服务器:处理 MCP 协议通信

  • Cellpose 集成:管理模型加载和分割操作

  • 工具层:将 Cellpose 功能作为 MCP 工具对外公开

  • 文件 I/O:处理图像读取、写入和掩膜生成

主要特性:

  • 线程安全:所有操作均被正确序列化

  • 非阻塞:采用异步操作以获得更好的性能

  • Napari 集成:与 Napari 集成以进行可视化和分析

作者: Suraj Sahu
所属机构: University of California Merced 物理系,美国加利福尼亚州
邮箱: ssahu2@ucmerced.edu

📄 许可证

BSD-3-Clause 许可证 - 详情请参阅 LICENSE 文件。

🙏 致谢


A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
20dResponse time
7wRelease cycle
5Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides end-to-end 3D printing automation for Bambu Lab printers, allowing users to generate, slice, and monitor prints using natural language. It features model generation from text or images, real-time camera monitoring, and automated print quality improvement.
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to process 3D point clouds and meshes using CloudCompare through natural language commands.
    12
    2
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to control Fiji/ImageJ for microscopy image analysis through natural language commands, supporting operations like image opening, filtering, particle analysis, and automated workflows.
    19
    2
    BSD 3-Clause

View all related MCP servers

Related MCP Connectors

  • LLM chat, text summarization and AI image generation

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

  • Connect AI assistants to Stellary projects, boards, documents, and governed agent workflows.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/surajinacademia/cellpose_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server