Token导航 LogoToken导航

MCP Server · AI代理

agentic scGPT

一个通过模型上下文协议(MCP)将scGPT单细胞基础模型功能作为工具暴露的Pydantic AI代理,用于单细胞基因组学分析。

stdio官方级别未说明来源级核验工具 3
PythonClaudeAI代理

快速开始

作者 / 组织
JIClarke93
提供方
JIClarke93
运行时
Python

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

agentic scGPT 属于AI代理类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,适配 Claude,有可以直接复制的安装命令;接入前先确认权限范围。

分类

AI代理

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

python -m scripts.download_checkpoints

客户端配置示例

{
  "mcpServers": {
    "agentic-scgpt": {
      "command": "python",
      "args": [
        "-m",
        "scripts.download_checkpoints"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 3 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

代理scGPT

一个暴露的Pydantic AI代理 scGPT 通过模型上下文协议(MCP)将单细胞基础模型功能作为工具。

项目概述

该项目通过以下方式弥合了对话式人工智能代理和单细胞基因组学分析之间的差距:

  1. 将scGPT函数作为MCP工具公开 通过 FastMCP
  2. 创建Pydantic AI代理 可以编排这些工具
  3. 使用Temporal增加可靠性 用于重试逻辑和工作流编排

建筑

┌─────────────────────────────────────────────────────────────────┐
│                      Pydantic AI Agent                          │
│                    (Orchestration Layer)                        │
└─────────────────────────┬───────────────────────────────────────┘
                          │ MCP Protocol
                          ▼
┌─────────────────────────────────────────────────────────────────┐
│                    FastMCP Server                               │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────────┐ │
│  │ Cell Type   │  │ Batch       │  │ Gene Network            │ │
│  │ Annotation  │  │ Integration │  │ Inference               │ │
│  └─────────────┘  └─────────────┘  └─────────────────────────┘ │
└─────────────────────────┬───────────────────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────────────────┐
│                   Temporal Workflows                            │
│              (Retry Logic & Orchestration)                      │
└─────────────────────────┬───────────────────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────────────────┐
│                      scGPT Model                                │
│              (GPU-accelerated inference)                        │
└─────────────────────────────────────────────────────────────────┘

计划中的MCP工具(第一阶段)

工具1: annotate_cell_types

使用scGPT包埋基于基因表达谱对单细胞进行注释。

@mcp.tool
async def annotate_cell_types(
    expression_data: str,  # Path to h5ad file or CSV
    reference_dataset: str = "cellxgene",
    batch_size: int = 64
) -> dict:
    """
    Annotate cell types from single-cell RNA-seq data.

    Returns predicted cell types with confidence scores.
    """

工具2: integrate_batches

整合多个scRNA-seq数据集,同时校正批处理效应。

@mcp.tool
async def integrate_batches(
    dataset_paths: list[str],  # Paths to multiple h5ad files
    batch_key: str = "batch",
    n_hvg: int = 2000
) -> dict:
    """
    Integrate multiple single-cell datasets with batch correction.

    Returns path to integrated dataset and integration metrics.
    """

工具3: get_gene_embeddings

提取基因嵌入物用于下游分析或基因网络推理。

@mcp.tool
async def get_gene_embeddings(
    gene_list: list[str],
    model_checkpoint: str = "scGPT_human"
) -> dict:
    """
    Get scGPT embeddings for a list of genes.

    Returns gene embeddings that can be used for similarity analysis.
    """

开发阶段

第一阶段:基础设置

  • \[x\] 通过以下方式设置项目结构 uv
  • \[x\] 安装核心依赖项(scGPT、FastMCP、Pydantic AI)
  • \[x\] 验证GPU/CUDA兼容性
  • \[x\] 下载scGPT预训练检查点

第2阶段:MCP服务器实施

  • \[x\] 创建FastMCP服务器骨架
  • \[x\] 实施 annotate_cell_types 工具
  • \[x\] 实施 integrate_batches 工具
  • \[x\] 实施 get_gene_embeddings 工具
  • \[x\] 使用Pydantic模型添加输入验证
  • \[x\] 使用编写工具测试 糖浆般的 快照测试

第三阶段:时间整合

  • \[\]设置临时工
  • \[\]将scGPT操作包装为时态活动
  • \[\]为GPU操作添加重试策略
  • \[\]实施多步骤分析的工作流程

第四阶段:Pydantic AI代理

  • \[\]使用MCP服务器连接创建代理
  • \[\]定义生物学领域的系统提示
  • \[\]添加对话记忆/上下文
  • \[\]实施示例分析工作流

第5阶段:测试和文件编制

  • \[\]使用样本数据进行集成测试
  • \[\]性能基准
  • \[\]API文件
  • \[\]使用示例和教程

安装

先决条件

  • Python 3.11+
  • 支持CUDA的GPU(推荐)
  • 紫外线 包管理器

设置

# Clone the repository
git clone 
cd agentic_scgpt

# Create virtual environment and install dependencies
uv sync

# Download scGPT checkpoints
python -m scripts.download_checkpoints

# Start Temporal (if using retry logic)
temporal server start-dev

# Run the MCP server
uv run python -m src.server

项目结构

agentic_scgpt/
├── src/
│   ├── __init__.py
│   ├── server.py           # FastMCP server with scGPT tools
│   ├── agent.py            # Pydantic AI agent
│   ├── tools/
│   │   ├── __init__.py
│   │   ├── annotate.py     # Cell type annotation tool
│   │   ├── integrate.py    # Batch integration tool
│   │   └── embeddings.py   # Gene embeddings tool
│   ├── workflows/
│   │   ├── __init__.py
│   │   └── activities.py   # Temporal activities
│   └── models/
│       ├── __init__.py
│       └── schemas.py      # Pydantic schemas for tool I/O
├── scripts/
│   ├── check_gpu.py        # GPU diagnostics
│   └── download_checkpoints.py
├── tests/
├── checkpoints/            # scGPT model weights
├── pyproject.toml
└── README.md

依赖项

包装用途
scgpt单细胞基础模型
fastmcpMCP服务器框架
pydantic-aiAI代理框架
temporalio工作流编排和重试
torch深度学习后端
scanpy单细胞分析实用程序
anndatascRNA-seq的数据结构

示例用法

运行MCP服务器

# src/server.py
from fastmcp import FastMCP

mcp = FastMCP("scGPT Tools")

@mcp.tool
async def annotate_cell_types(expression_data: str) -> dict:
    """Annotate cell types from scRNA-seq data."""
    # Implementation here
    pass

if __name__ == "__main__":
    mcp.run(transport="streamable-http", port=8000)

连接Pydantic AI代理

# src/agent.py
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP

server = MCPServerStreamableHTTP("http://localhost:8000/mcp")

agent = Agent(
    "anthropic:claude-sonnet-4-20250514",
    toolsets=[server],
    system_prompt="""You are a single-cell genomics expert assistant.
    You help researchers analyze scRNA-seq data using scGPT tools.
    Always explain your analysis steps and interpret results."""
)

async def main():
    async with agent:
        result = await agent.run(
            "Annotate the cell types in my dataset at data/pbmc.h5ad"
        )
        print(result.output)

使用临时检索

# src/workflows/activities.py
from temporalio import activity
from datetime import timedelta

@activity.defn
async def annotate_cells_activity(data_path: str) -> dict:
    """Activity with automatic retry on GPU OOM errors."""
    # scGPT annotation logic
    pass

# In workflow
await workflow.execute_activity(
    annotate_cells_activity,
    "data/sample.h5ad",
    start_to_close_timeout=timedelta(minutes=10),
    retry_policy=RetryPolicy(
        maximum_attempts=3,
        initial_interval=timedelta(seconds=5),
        non_retryable_error_types=["InvalidDataError"]
    )
)

GPU要求

scGPT需要一个支持CUDA的GPU来进行高效推理。运行GPU检查脚本:

uv run python scripts/check_gpu.py

推荐规格:

  • 配备8GB+VRAM的NVIDIA GPU
  • 第11.8节+
  • cuDNN 8.6+

资源

许可证

麻省理工学院

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

单细胞基因组学Python本地部署AI代理基因表达分析批处理整合细胞类型注释

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

多步任务编排

把拆解、检索、执行串成一条链,模型按步骤调用工具。

长期上下文

把会话、笔记和知识放到外部存储,换个会话还能接着做。

接自有流程

把内部系统和模型连起来,让助手调用已有的工作流。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
agentic scGPT

MCP World · 本页

3stdio有1 个2026-05-17
Everything Claude Code

MCP World

0stdio有1 个2026-05-17
Filesystem 560c4363

MCP World

13未说明未标注2 个2026-05-17
Time 7365cb6d

MCP.so

2SSE有2 个2026-05-17
Server Everything (everything)

MCP World

11stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

agentic scGPT 怎么安装?

公开资料给出的安装命令是 python -m scripts.download_checkpoints,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

agentic scGPT 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

agentic scGPT 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

agentic scGPT 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

agentic scGPT 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP