分子动力学模拟服务

基于Docker的AmberTools25/Amber24分子动力学模拟和分析服务,提供蛋白质PDB结构的全MD模拟功能。

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

使用说明

琥珀色MCP

基于Docker的琥珀分子动力学模拟与分析

使用AmberTools25/Amber24和1个核心工具进行分子动力学模拟的MCP(模型上下文协议)服务器:

  • 单蛋白md_模拟 --使用GPU加速运行蛋白质PDB结构的完整MD模拟

Docker快速入门

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

最快的开始方式。每次发布时,预构建的Docker镜像都会自动发布到GitHub容器注册表。

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

# Register with Claude Code (runs as current user to avoid permission issues)
claude mcp add amber_mcp -- docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` ghcr.io/macromnex/amber_mcp:latest

注: 从项目目录运行。 `pwd` 展开到当前工作目录。

要求:

  • 支持NVIDIA GPU的Docker(NVIDIA-docker2或Docker 19.03+)
  • 已安装克劳德代码

就是这样!Amber MCP服务器现在可以在Claude Code中使用。


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

自己构建映像并将其安装到Claude Code中。适用于自定义或离线环境。

# Clone the repository
git clone https://github.com/MacromNex/amber_mcp.git
cd amber_mcp

# Build the Docker image
docker build -t amber_mcp:latest .

# Register with Claude Code (runs as current user to avoid permission issues)
claude mcp add amber_mcp -- docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` amber_mcp:latest

关于Docker标志:

  • -i --Claude Code的交互模式
  • --rm --退出后自动移除容器
  • --user `id -u`:`id -g` --以当前用户身份运行容器
  • --gpus all --允许访问所有可用的GPU进行MD模拟
  • --ipc=host --使用主机IPC命名空间进行共享内存访问
  • -v --装载项目目录

验证安装

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

在Claude Code中,您现在可以使用:

  • single_protein_md_simulation --运行蛋白质结构的MD模拟

后续步骤

  • 详细文件:参见 detail.md 获取全面的指南,包括本地安装、脚本使用和环境设置

使用示例

运行MD模拟

Run a 10 ns MD simulation for @example/input/1l2y.pdb using cuda:0, save results to results/md_1l2y

分析PDB结构

What tools are available from amber_mcp? Then run an MD simulation for my protein structure at /path/to/protein.pdb

AlphaFold输出处理

Run MD simulation for my AlphaFold predicted structure @predictions/model_1.pdb with 5 ns simulation time

故障排除

Docker问题

问题: 容器无法访问GPU

# Verify NVIDIA Docker runtime is installed
docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi

# If this fails, install nvidia-docker2:
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html

问题: 输出文件的权限被拒绝

# Ensure you're using the --user flag
docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` ghcr.io/macromnex/amber_mcp:latest

问题: MCP服务器没有响应

# Check if the container runs correctly
docker run --rm ghcr.io/macromnex/amber_mcp:latest --help

# Re-register with Claude Code
claude mcp remove amber_mcp
claude mcp add amber_mcp -- docker run -i --rm --user `id -u`:`id -g` --gpus all --ipc=host -v `pwd`:`pwd` ghcr.io/macromnex/amber_mcp:latest

问题: 在容器内找不到文件路径

# Make sure to run Claude Code from the directory containing your files
# The -v `pwd`:`pwd` flag mounts only the current directory
cd /path/to/your/project
claude

许可证

基于AmberTools25/Amber24分子动力学软件包。

学分

基于 AmberTools25/Amber24 分子动力学模拟软件。