蛋白质建模服务器

Boltz MCP服务器是一个用于蛋白质3D结构预测和蛋白质-配体结合亲和力预测的工具,支持异步作业监控和批量处理。

  • by MacromNex
  • Python
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 Biomolecular-Design-Nexus/boltz_mcp

使用说明

Boltz MCP服务器

通过Docker使用Boltz2进行结构和亲和力预测

用于Boltz2蛋白质建模的MCP(模型上下文协议)服务器,配备13个工具:

  • 从序列或YAML配置预测蛋白质3D结构
  • 预测蛋白质配体结合亲和力
  • 通过异步监控提交长时间运行的作业
  • 跟踪和检索作业结果
  • 验证蛋白质序列和配体SMILES
  • 批量处理多个序列
  • 预先计算MSA支持快速配体筛选

Docker 快速入门

方法1:从GitHub中提取预构建映像

# Pull the latest image
docker pull ghcr.io/macromnex/boltz_mcp:latest

# Register with Claude Code
claude mcp add boltz -- docker run -i --rm \
  --user `id -u`:`id -g` --gpus all --ipc=host \
  -v ~/.boltz:/opt/boltz_cache:ro \
  -v `pwd`:`pwd` \
  ghcr.io/macromnex/boltz_mcp:latest

方法2:在本地构建Docker镜像

git clone https://github.com/MacromNex/boltz_mcp.git
cd boltz_mcp
docker build -t boltz_mcp:latest .

claude mcp add boltz -- docker run -i --rm \
  --user `id -u`:`id -g` --gpus all --ipc=host \
  -v ~/.boltz:/opt/boltz_cache:ro \
  -v `pwd`:`pwd` \
  boltz_mcp:latest

要求:

  • 支持GPU的Docker(nvidia-docker 或带有NVIDIA运行时的Docker)
  • Boltz2型号检查点位于 ~/.boltz (首次本地运行时自动下载)
  • 已安装克劳德代码

Docker标志详解

标志 目的
-i MCP stdio的交互模式
--rm 退出后取出容器
--user `id -u`:`id -g` 以当前用户身份运行(输出文件归您所有)
--gpus all 访问所有GPU
--ipc=host PyTorch性能的主机IPC命名空间
-v ~/.boltz:/opt/boltz_cache:ro 装载缓存的模型检查点(只读)
-v path:path 装载用于输入/输出访问的工作目录

预先计算的MSA用于快速筛查

当针对同一蛋白质筛选多个配体时,挂载一个预先计算的MSA目录以跳过缓慢的MSA服务器查询(每次运行节省约5分钟):

claude mcp add boltz -- docker run -i --rm \
  --user `id -u`:`id -g` --gpus all --ipc=host \
  -v ~/.boltz:/opt/boltz_cache:ro \
  -v /path/to/msa_files:/opt/msa:ro \
  -v `pwd`:`pwd` \
  boltz_mcp:latest

然后通过 msa_path="/opt/msa/protein.a3m" 任何预测工具。MSA .a3m 文件在第一次运行时自动生成 --use_msa_server 可以在输出目录中找到 msa/.


验证安装

claude mcp list
# You should see 'boltz' in the output

可用工具(共13个):

  • simple_structure_prediction / simple_affinity_prediction --同步预测
  • submit_structure_prediction / submit_affinity_prediction / submit_batch_structure_prediction --异步作业
  • get_job_status / get_job_result / get_job_log / cancel_job / list_jobs --作业管理
  • validate_protein_sequence / validate_ligand_smiles --输入验证
  • list_example_data --列出捆绑示例

用法示例

快速结构预测

Predict the structure of this protein: MVLSEGEWQLVLHVWAKVEADVAGHGQDILIRLFKSHPETLEKFDRFKHLKTEREQESRKEAAG. Save to /path/to/results/.

蛋白质配体亲和力

Predict binding affinity between protein MVLSE... and aspirin (SMILES: CC(=O)Oc1ccccc1C(=O)O). Use simple_affinity_prediction.

基于预计算MSA的快速配体筛选

Screen these 10 ligands against KRAS using simple_affinity_prediction with msa_path="/opt/msa/kras.a3m" for each.

具有潜力的高质量结构

Submit a structure prediction with use_potentials=True for the sequence in /path/to/protein.fasta. Monitor until complete.

CLI使用情况(无MCP)

# Structure prediction
./env/bin/python scripts/structure_prediction.py --sequence "MVLSE..." --output results/out

# Affinity prediction
./env/bin/python scripts/affinity_prediction.py \
  --protein-seq "MVLSE..." --ligand-smiles "CC(=O)O" --output results/out

# With pre-computed MSA (skips MSA server, much faster)
./env/bin/python scripts/affinity_prediction.py \
  --protein-seq "MVLSE..." --ligand-smiles "CC(=O)O" \
  --msa-path /path/to/protein.a3m --output results/out

故障排除

找不到Docker?

docker --version  # Install Docker if missing

GPU无法访问?

  • 确保安装了NVIDIA Docker运行时
  • 与核对 docker run --gpus all ubuntu nvidia-smi

模型检查点缺失?

  • 首先运行本地预测以自动下载到 ~/.boltz
  • 或设置 BOLTZ_CACHE=/path/to/cache 跑步前

未找到克劳德代码?

npm install -g @anthropic-ai/claude-code

后续步骤

看 detail.md 有关可用工具、YAML配置格式、本地设置和性能优化的全面指南。

许可证

麻省理工学院