Skip to main content
Glama
huangjianhuster

Biomolecule Modeling MCP Server

生物分子建模 MCP 服务器

一个 MCP (模型上下文协议) 服务器,允许 AI 助手 (Claude 等) 清理 PDB 结构并运行初始阶段的能量弛豫 — 这是在生产级 MD 或粗粒化 (例如 Martini) 流水线之前的准备步骤。


快速入门 (Claude Code)

使用此服务器最简单的方法是通过 uvx — 无需手动管理依赖项:

claude mcp add "biomolecule-modeling" --scope user -- \
  uvx --from git+https://github.com/YOUR_USERNAME/biomolecule-modeling-mcp biomodeling

就是这样。uvx 会自动将该包及其所有 Python 依赖项安装到隔离环境中。运行此命令后,重启 Claude Code,该服务器将列在活动的 MCP 服务器下。

OpenMM 注意事项: uvx 安装的是 OpenMM 的 PyPI wheel (仅限 CPU)。如果您需要 GPU 加速,请先通过 conda 安装 OpenMM (conda install -c conda-forge openmm pdbfixer),然后改用 手动注册 方法。


Related MCP server: PLUMED2 MCP Server

它能做什么

该服务器公开了一组工具,引导 LLM 完成结构化的工作流程:

query_pdb_structure          # inspect chains, sequences, gaps, structural breaks
  └─ split_pdb               # separate protein / nucleic acid / ligands
       └─ fix_pdb_structure  # clean structure (PDBFixer): residues, hydrogens, heavy atoms
            └─ assemble_pdb_structures  # recombine components after separate fixing
                 └─ relax_pdb_structure # energy minimise ± short restrained MD (OpenMM)

在任何时候,get_workflow_report 都会返回一份 Markdown 总结,包含 LLM 做出的每一个决定及其推理过程,该总结可以保存到磁盘。


工具

工具

描述

query_pdb_structure

链级检查:类型、序列、残基范围、编号间隙、骨架断裂

split_pdb

将多组分 PDB 拆分为按类型划分的文件 (蛋白质、核酸、配体)

fix_pdb_structure

PDBFixer 包装器:移除杂原子、替换非标准残基、添加缺失的原子/氢原子

assemble_pdb_structures

将多个 PDB 文件合并回一个,并解决冲突

relax_pdb_structure

OpenMM 能量最小化 + 可选的短骨架约束 MD

query_ff_presets

列出可用的力场预设及其参数

get_workflow_report

返回和/或保存所有工具调用和 LLM 推理的 Markdown 报告

reset_workflow_report

清除会话日志以处理新结构

set_working_directory

更改相对路径解析的工作目录


力场预设

预设

溶剂

备注

amber14_implicit

GBn2 隐式

默认。 无需周期性盒子。速度快。

amber14_explicit

TIP3P-FB 显式

需要预溶剂化的周期性盒子

amber99sb_implicit

OBC2 隐式

旧版 AMBER,隐式溶剂

charmm36_explicit

CHARMM TIP3P 显式

需要预溶剂化的周期性盒子


手动安装

如果您想要 GPU 加速的 OpenMM 或更喜欢本地检出,请使用此方法。

1. 安装 OpenMM (推荐使用 conda 以获得 GPU 支持)

conda install -c conda-forge openmm pdbfixer

2. 克隆并安装依赖项

git clone https://github.com/YOUR_USERNAME/biomolecule-modeling-mcp
cd biomolecule-modeling-mcp
uv sync

3. 在 Claude Code 中注册

claude mcp add "biomolecule-modeling" --scope user -- \
  /path/to/uv run --directory /path/to/biomolecule-modeling-mcp python main.py

/path/to/uv 替换为 which uv,并使用克隆仓库的绝对路径。

重要: 使用 --directory (而不是 --project)。--project 会设置虚拟环境,但将 cwd 留在调用者所在的位置,这会破坏相对 utils/ 导入。

独立脚本 (无需 MCP 客户端)

uv run utils/pdb_query.py structure.pdb        # inspect structure
uv run utils/pdb_fix.py input.pdb              # fix structure
uv run utils/openmm_relax.py input.pdb         # minimise structure

示例会话

以下示例展示了您可以给 Claude 的真实自然语言提示,以及服务器为响应而驱动的工具调用序列。


案例 1 — 从 RCSB 下载、检查、清理并弛豫 PDB

您给 Claude 的提示:

下载 PDB 1UBQ,查询其结构信息,清理蛋白质部分,并弛豫该结构。

Claude 的操作:

第 1 步 — 下载文件

Claude 从 RCSB (https://files.rcsb.org/download/1UBQ.pdb) 获取 1UBQ.pdb 并将其保存在本地。

第 2 步 — 检查结构

query_pdb_structure(
    pdb_file="1UBQ.pdb",
    notes="Initial inspection before cleaning. Need to identify chain types, "
          "any non-standard residues, and structural gaps."
)
chains:
  A — protein, 76 residues (MET1–GLY76), no numbering gaps, no structural breaks
heterogens: HOH (58 water molecules)
non_standard_residues: []
missing_residues: []

Claude 的推理: 单个蛋白质链,无间隙,无非标准残基。存在水分子 — 将移除它们。没有需要担心的配体;可以直接进行 fix_pdb_structure

第 3 步 — 清理结构

fix_pdb_structure(
    input_pdb="1UBQ.pdb",
    output_pdb="1UBQ_fixed.pdb",
    remove_heterogens=True,      # removes the 58 water molecules
    add_hydrogens=True,
    ph=7.0,
    fix_missing_residues=False,  # no gaps — nothing to fix
    notes="Removing waters, adding hydrogens at pH 7.0. No non-standard residues "
          "or gaps detected so no other fixing steps needed."
)
output_pdb: 1UBQ_fixed.pdb
n_residues: 76
n_atoms: 1231
heterogens_removed: 58
nonstandard_residues: []
missing_atoms_added: 0
hydrogens_added: true

第 4 步 — 弛豫结构

relax_pdb_structure(
    input_pdb="1UBQ_fixed.pdb",
    output_pdb="1UBQ_relaxed.pdb",
    preset="amber14_implicit",
    run_md=False,
    notes="Minimisation-only run. Structure is clean and small (76 residues); "
          "a full MD run is not needed for clash removal."
)
output_pdb: 1UBQ_relaxed.pdb
preset_used: amber14_implicit
n_atoms: 1231
energy_initial_kJ_mol: -18423.4
energy_final_kJ_mol:   -24817.9

Claude 的总结: 在最小化过程中能量下降了约 6400 kJ/mol — 这对于添加氢原子后的晶体结构来说是典型的。输出的 1UBQ_relaxed.pdb 已准备好用于下游 MD 或粗粒化。


案例 2 — 清理本地多链结构,仅保留选定的链

您给 Claude 的提示:

查询 ./structures/complex.pdb 下的 PDB 结构,清理它以仅保留链 A 和链 B,并弛豫该结构。

Claude 的操作:

第 1 步 — 检查结构

query_pdb_structure(
    pdb_file="./structures/complex.pdb",
    notes="Inspecting the multi-chain complex before chain selection and cleaning."
)
chains:
  A — protein, 312 residues (SER5–LEU316), 2 numbering gaps (at 47–51, 203–208)
  B — protein, 289 residues (MET1–LYS289), no gaps
  C — protein, 145 residues (ALA1–GLU145), no gaps
  D — nucleic (DNA), 24 residues
heterogens: MG (3 ions), HOH (412 waters), ATP (1 molecule)
non_standard_residues: [MSE → MET in chain A (4 occurrences)]

Claude 的推理: 用户只想保留链 A 和链 B。链 A 有两个编号间隙 — 这些很可能是晶体中短的无序环;将不尝试环建模。链 A 中的 MSE (硒代甲硫氨酸) 将被转换为 MET。在运行 OpenMM 弛豫之前,必须移除 ATP 和离子。

第 2 步 — 清理,仅保留链 A 和链 B

fix_pdb_structure(
    input_pdb="./structures/complex.pdb",
    output_pdb="./structures/complex_AB_fixed.pdb",
    chains_to_keep=["A", "B"],
    replace_nonstandard_residues=True,   # converts MSE → MET
    remove_heterogens=True,              # removes ATP, Mg²⁺, waters
    add_missing_heavy_atoms=True,
    add_hydrogens=True,
    ph=7.0,
    fix_missing_residues=False,          # gaps are 4–5 residues; skipping loop modelling
    notes="Keeping chains A and B only per user request. Converting 4 × MSE → MET "
          "in chain A. Removing ATP, Mg ions, and waters — these cannot be "
          "parameterised with standard AMBER presets. Not fixing the two loops "
          "in chain A (gaps of 4–5 residues) to avoid poor loop geometry."
)
output_pdb: complex_AB_fixed.pdb
n_residues: 601   (312 + 289)
n_atoms: 9847
chains_kept: [A, B]
nonstandard_residues: [MSE→MET ×4 in chain A]
heterogens_removed: 416   (ATP ×1, MG ×3, HOH ×412)
missing_atoms_added: 12
hydrogens_added: true

Claude 给用户的警告: “链 A 在残基 47–51 和 203–208 处仍有两个短间隙(晶体结构中缺失)。这些区域在弛豫后的输出中将不存在。如果您在下游模拟中需要完整的环,请告诉我,我可以尝试环建模 — 尽管这种大小的间隙的几何形状可能比较粗糙。”

第 3 步 — 弛豫双链复合物

relax_pdb_structure(
    input_pdb="./structures/complex_AB_fixed.pdb",
    output_pdb="./structures/complex_AB_relaxed.pdb",
    preset="amber14_implicit",
    run_md=True,
    restrain_backbone=True,
    restraint_k=1000.0,
    production_steps=25000,
    notes="Running short restrained MD (25 000 steps ≈ 100 ps) to relax side chains "
          "around the 12 newly added heavy atoms and the two gap termini in chain A. "
          "Backbone restrained at 1000 kJ/mol/nm² to preserve experimental fold."
)
output_pdb: complex_AB_relaxed.pdb
preset_used: amber14_implicit
n_atoms: 9847
energy_initial_kJ_mol: -71203.1
energy_post_min_kJ_mol: -89441.6
energy_post_md_kJ_mol:  -94308.2
energy_final_kJ_mol:    -95112.4

Claude 的总结: 能量在最小化 → MD → 最终最小化过程中稳步下降。结构已收敛并准备就绪。输出:complex_AB_relaxed.pdb


项目结构

biomolecule-modeling-mcp/
├── main.py                  # MCP server entry point; all @mcp.tool() definitions
├── pyproject.toml           # dependencies + CLI entry point (biomodeling)
├── utils/
│   ├── pdb_query.py         # Structure inspection (BioPython)
│   ├── pdb_fix.py           # PDBFixer wrapper
│   ├── pdb_splitter.py      # Split multi-component PDB by chain type
│   ├── pdb_assemble.py      # Merge PDB files
│   └── openmm_relax.py      # OpenMM energy minimisation + restrained MD
└── data/                    # Example / test PDB files

关键注意事项

  • 默认情况下永远不要修复大环。 fix_missing_residues=False 是安全的默认设置;超过 5–10 个残基的环用 PDBFixer 处理会产生较差的几何形状。

  • 配体会破坏标准弛豫。 在使用 AMBER/CHARMM 预设运行 OpenMM 之前,必须移除(或单独参数化)非标准 HETATM 残基。

  • OpenMM >= 8.x 隐式溶剂。 隐式溶剂 XML (例如 implicit/gbn2.xml) 进入 ForceField(),而不是 createSystem()


许可证

MIT

Install Server
F
license - not found
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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
    D
    maintenance
    Enables AI assistants to generate, validate, and optimize PLUMED input files for molecular dynamics simulations, with templates and performance suggestions.
    12
    GPL 3.0
  • A
    license
    Not graded
    quality
    F
    maintenance
    Integrates GROMACS molecular dynamics simulations with VMD visualization, enabling setup, execution, analysis, and 3D visualization of molecular dynamics workflows through natural language.
    21
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI assistants to execute computational chemistry and drug discovery workflows using Schrödinger Suites 2026, including protein preparation, docking, ADMET, QM/MM calculations, and job management.
    28
    MIT

View all related MCP servers

Related MCP Connectors

  • AI-powered bioprotocol optimization — generate, search, and manage lab protocols via MCP

  • Build, validate, and deploy multi-agent AI solutions from any AI environment.

  • Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.

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/huangjianhuster/biomolecule-modeling-mcp'

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