AlphaFold2 MCP服务器
通过Docker预测单体、多聚体和批处理的蛋白质结构
用于AlphaFold2蛋白质结构预测的MCP(模型上下文协议)服务器,具有5个核心工具:
- 预测单个蛋白质(单体)的三维结构
- 预测蛋白质复合物(多聚体)
- 批量处理多种蛋白质
- 提交长时间运行的作业并跟踪其进度
- 分析FASTA文件并获得建议
Docker快速入门
方法1:从GitHub中提取预构建映像
最快的开始方式。每次发布时,预构建的Docker镜像都会自动发布到GitHub容器注册表。
# Pull the latest image
docker pull ghcr.io/macromnex/alphafold2_mcp:latest
# Register with Claude Code (runs as current user to avoid permission issues)
claude mcp add alphafold2 -- docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` ghcr.io/macromnex/alphafold2_mcp:latest注: 从项目目录运行。 ` pwd ` 展开到当前工作目录。
要求:
- 支持GPU的Docker(
nvidia-docker或带有NVIDIA运行时的Docker) - 已安装克劳德代码
就是这样!AlphaFold2 MCP服务器现在可以在Claude Code中使用。
______________________________________________________________________
方法2:在本地构建Docker镜像
自己构建映像并将其安装到Claude Code中。适用于自定义或离线环境。
# Clone the repository
git clone https://github.com/MacromNex/alphafold2_mcp.git
cd alphafold2_mcp
# Build the Docker image
docker build -t alphafold2_mcp:latest .
# Register with Claude Code (runs as current user to avoid permission issues)
claude mcp add alphafold2 -- docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` alphafold2_mcp:latest注: 从项目目录运行。 ` pwd ` 展开到当前工作目录。
要求:
- 支持GPU的Docker
- 已安装克劳德代码
- Git(克隆存储库)
关于Docker标志:
-i--Claude Code的交互模式--rm--退出后自动移除容器- `
--userid -u:id -g` --以当前用户身份运行容器,因此输出文件归您所有(不是root) --gpus all--授予对所有可用GPU的访问权限--ipc=host--使用主机IPC命名空间以获得更好的性能-v--装载您的项目目录,以便容器可以访问您的数据
______________________________________________________________________
验证安装
添加MCP服务器后,您可以验证它是否正常工作:
# List registered MCP servers
claude mcp list
# You should see 'alphafold2' in the output在Claude Code中,您现在可以使用所有5个AlphaFold2工具:
submit_monomer_predictionsubmit_multimer_predictionsubmit_batch_predictionget_job_statusget_job_result
______________________________________________________________________
后续步骤
- 详细文件:参见 detail.md 有关以下内容的全面指南:
- 可用的MCP工具和参数 - 本地Python环境设置(Docker的替代方案) - 示例工作流和用例 - 配置文件选项 - AlphaFold数据库设置
______________________________________________________________________
使用示例
注册后,您可以直接在Claude Code中使用AlphaFold2工具。以下是一些常见的工作流程:
示例1:单体结构预测
I have a protein sequence in /path/to/protein.fasta. Can you submit a monomer structure prediction using submit_monomer_prediction with the reduced_dbs preset and save results to /path/to/results/?示例2:蛋白质复合物预测
I have two protein chains in /path/to/complex.fasta that I want to model as a heterodimer. Can you use submit_multimer_prediction to predict the complex structure and generate 5 prediction attempts?示例3:批处理
I have a directory of FASTA files at /path/to/sequences/ containing 10 proteins. Can you submit them for batch prediction using submit_batch_prediction and track the job status until they complete?______________________________________________________________________
故障排除
找不到Docker?
docker --version # Install Docker if missingGPU无法访问?
- 确保安装了NVIDIA Docker运行时
- 核对
docker run --gpus all ubuntu nvidia-smi
未找到克劳德代码?
# Install Claude Code
npm install -g @anthropic-ai/claude-codeAlphaFold数据库丢失?
- 从官方AlphaFold数据库库下载
- 使用
reduced_dbs预设用于在没有完整数据库的情况下进行更快的测试
______________________________________________________________________
许可证
基于 DeepMind AlphaFold --Apache 2.0
