Rosetta Mcp Server

io.github.Arielbs由 GitHub 账号 Arielbs 发布v1.3.1更新于 Oct 24, 2026

Rosetta/PyRosetta protein modeling and Biotite translation for computational biology

已验证STDIO仅桌面AI 与机器学习

概览

AI 生成的概览

让助手运行 Rosetta 与 PyRosetta 蛋白质建模任务、把 RosettaScripts XML 翻译成 Python,并在 Rosetta 与 Biotite 之间做函数映射。

可以做什么
提供 18 个面向计算结构生物学的工具:在 PDB 文件上运行 RosettaScripts XML 协议、用 PyRosetta 打分(可选逐残基能量分解)、按 Rosetta XSD 架构校验 XML,以及把 RosettaScripts XML 或 PyRosetta 代码翻译为 Python。还包含发现与文档工具,如实时 PyRosetta API 检索和 rosettacommons.org 文档搜索,以及 Rosetta 与 Biotite 的双向函数映射和整段脚本翻译。环境类工具可检查 Python 环境、定位 rosetta_scripts 可执行文件并安装 PyRosetta。
适用场景
适合助手需要处理 Rosetta 或 PyRosetta 蛋白质建模的场景:编写或校验 RosettaScripts 协议、转换为 PyRosetta 代码、给结构打分,或查找某个 Rosetta 操作对应的 Biotite 写法。适合已有 Rosetta 或 PyRosetta 环境、希望由 AI 客户端驱动这些流程的研究人员和开发者。
运行要求
以 npm 包形式通过 stdio 在本地运行(Node 14+)。需要装有 PyRosetta 和 Biotite 的 Python 3.8+ 解释器,可用 PYTHON_BIN 指定;ROSETTA_BIN 指向 rosetta_scripts 可执行文件或其目录。MCP_DEBUG 可开启调试日志。首次使用时 PyRosetta 可自动安装,耗时 10-30 分钟。仅支持桌面客户端。
安装前请注意
该服务器会在本地结构文件上执行 Rosetta 协议和 Python 代码,可能写出 PDB 等输出文件。install_pyrosetta_installer 工具会向所配置的 Python 环境安装软件包,从而改变该环境。文档工具会抓取 rosettacommons.org 页面并可能查询外部搜索服务,查询内容会离开本机。ROSETTA_BIN 与 PYTHON_BIN 指向本地可执行文件,应设置为可信路径。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Rosetta Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Rosetta MCP Server]

Rosetta MCP Server

Author: Ariel J. Ben-Sasson

A Model Context Protocol (MCP) server that lets Cursor (or any MCP client) work with Rosetta, PyRosetta, and Biotite: run RosettaScripts, validate XML protocols, translate between Rosetta and Biotite, score structures, and query documentation -- all from your AI coding assistant.

What's new in v1.3.0 (vs v1.1.8 on npm)

New: Biotite integration

  • rosetta_to_biotite -- Find the Biotite equivalent of any Rosetta function with working example code (21 mappings covering structure I/O, SASA, RMSD, superimposition, secondary structure, contacts, hydrogen bonds, B-factors, angles, and more)
  • biotite_to_rosetta -- Reverse lookup: find the Rosetta equivalent of a Biotite function
  • translate_rosetta_script_to_biotite -- Translate entire RosettaScripts XML or PyRosetta code to Biotite Python. Design/optimization operations are flagged as Rosetta-only.
  • Fuzzy search with keyword aliases ("contacts", "binding energy", "surface area", "align", etc.)

Improved: XML to PyRosetta translator

  • 37 element types supported (was 6): 11 movers, 9 filters, 10 selectors, 7 task operations
  • Full attribute handling: repeats, disable_design, cartesian, tolerance, threshold, distance, and more
  • Child element support: MoveMap (with Span), Reweight, ScoreFunction
  • Reports unrecognized elements so you know what needs manual work

Improved: Help and documentation

  • get_rosetta_help now accepts any topic: movers by name ("FastRelax"), concepts ("constraints", "docking"), or score functions ("ref2015") -- auto-fetches live docs from rosettacommons.org
  • search_rosetta_web_docs fallback: when DuckDuckGo is rate-limited, probes direct Rosetta docs URLs
  • get_cached_docs auto-caches: no need to call cache_cli_docs first
  • Expanded static help for score_functions, movers, filters, xml, and parameters

Improved: Scoring

  • pyrosetta_score: new per_residue option returns per-residue energy breakdown
  • scorefxn parameter now works (was ignored in v1.1.8)
  • Proper error messages for missing files instead of silent {}

Improved: Validation

  • validate_xml: new validate_against_schema option checks element names against the Rosetta XSD schema (catches typos like FastRleax)

MCP spec compliance fixes

  • tools/call responses now use correct { content: [{ type: "text", text }] } format
  • Tool errors return isError: true (not JSON-RPC errors)
  • Standard JSON-RPC error codes (-32601, -32700, -32603)
  • Removed false resources capability advertisement

Security fixes

  • User input no longer interpolated into Python code (uses env vars / stdin)
  • Temp files written to os.tmpdir() (not module directory)

Cleanup

  • Removed 3 redundant tools: list_functions (merged into get_rosetta_info), search_pyrosetta_wheels, cache_cli_docs (auto-cache in get_cached_docs)
  • Removed hardcoded personal paths
  • Fixed shadowed variables, async anti-patterns, dead code
  • 18 tools (was 21), all with improved agent-oriented descriptions

Example: asking a naive question

This is what makes the MCP server powerful -- an AI agent can answer domain questions by calling the right tools automatically:

User asks in Cursor: "How do I relax my protein and what's the Biotite equivalent?"

The agent calls two MCP tools behind the scenes:

1. get_rosetta_help("FastRelax") returns 6000+ chars of live documentation:

FastRelax performs all-atom relaxation using the FastRelax protocol. Parameters include scorefxn, repeats, cartesian, disable_design, MoveMap configuration...

2. rosetta_to_biotite("FastRelax") returns:

json
{  "found": true,  "results": [{    "rosetta": { "name": "FastRelax", "example": ["relax = FastRelax()", "relax.set_scorefxn(get_score_function('ref2015'))", "relax.apply(pose)"] },    "biotite": null,    "equivalence": "none_from_biotite",    "notes": "Biotite does NOT perform structure optimization. These are Rosetta-specific capabilities."  }]}

The agent synthesizes: "FastRelax is Rosetta's all-atom relaxation protocol. Here's how to use it... Note: Biotite is analysis-only and has no equivalent -- you need PyRosetta for structure optimization."

Without the MCP, the agent would guess from training data and likely get parameter names or API signatures wrong.


What you get (18 tools)

Discovery & Help

ToolDescription
get_rosetta_infoAll available score functions, movers, filters, selectors, parameters
get_rosetta_helpHelp for any topic -- accepts mover names, concepts, or score functions
pyrosetta_introspectLive PyRosetta API search with docs and signatures

Documentation

ToolDescription
search_rosetta_web_docsSearch rosettacommons.org documentation
get_rosetta_web_docFetch and read a specific docs page
get_cached_docsSearch cached CLI help (auto-caches on first use)

Execution & Scoring

ToolDescription
run_rosetta_scriptsRun a RosettaScripts XML protocol on a PDB
pyrosetta_scoreScore a PDB with optional per-residue breakdown

Translation

ToolDescription
xml_to_pyrosettaXML to PyRosetta Python (37 element types)
rosetta_to_biotiteFind Biotite equivalent of a Rosetta function
biotite_to_rosettaFind Rosetta equivalent of a Biotite function
translate_rosetta_script_to_biotiteTranslate full scripts from Rosetta to Biotite

Validation & Schema

ToolDescription
validate_xmlCheck XML syntax + optional schema validation
rosetta_scripts_schemaGenerate XSD schema and extract element names

Environment

ToolDescription
python_env_infoPython version and installed packages
check_pyrosettaVerify PyRosetta is available
install_pyrosetta_installerAuto-install PyRosetta (10-30 min)
find_rosetta_scriptsLocate the rosetta_scripts binary

Quick start

1. Install from npm

bash
npm install -g rosetta-mcp-server

2. Set up Python environment

bash
# Create a venv with PyRosetta and Biotiteuv venv ~/.venvs/rosetta-mcp~/.venvs/rosetta-mcp/bin/pip install pyrosetta-installer biotite~/.venvs/rosetta-mcp/bin/python -c "import pyrosetta_installer as I; I.install_pyrosetta()"

Or skip this step -- PyRosetta auto-installs on first use (takes 10-30 min).

3. Configure your MCP client

Cursor (~/.cursor/mcp.json):

json
{  "mcpServers": {    "rosetta": {      "command": "rosetta-mcp-server",      "args": [],      "env": {        "ROSETTA_BIN": "/path/to/rosetta_scripts.default.macosclangrelease",        "PYTHON_BIN": "/path/to/.venvs/rosetta-mcp/bin/python"      }    }  }}

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "rosetta": {      "command": "rosetta-mcp-server",      "env": {        "ROSETTA_BIN": "/path/to/rosetta_scripts.default.macosclangrelease",        "PYTHON_BIN": "/path/to/.venvs/rosetta-mcp/bin/python"      }    }  }}

Environment variables:

VariableRequiredDescription
ROSETTA_BINNoPath to rosetta_scripts binary or its directory. If not set, searches common paths and PATH.
PYTHON_BINNoPython interpreter with PyRosetta/Biotite. Defaults to python3.
MCP_DEBUGNoSet to 1 for debug logging to stderr.

4. Restart your editor

Open Settings -> MCP. The "rosetta" server should appear green with 18 tools.


XML to PyRosetta translation example

Input XML:

xml
<ROSETTASCRIPTS>  <SCOREFXNS>    <ScoreFunction name="ref" weights="ref2015"/>  </SCOREFXNS>  <RESIDUE_SELECTORS>    <Chain name="chainA" chains="A"/>  </RESIDUE_SELECTORS>  <MOVERS>    <FastRelax name="relax" scorefxn="ref" repeats="5" cartesian="true"/>  </MOVERS>  <PROTOCOLS>    <Add mover="relax"/>  </PROTOCOLS></ROSETTASCRIPTS>

Generated PyRosetta code:

python
import pyrosettafrom pyrosetta import pose_from_pdbfrom pyrosetta.rosetta.core.scoring import get_score_functionfrom pyrosetta.rosetta.core.select.residue_selector import *from pyrosetta.rosetta.protocols.relax import *
pyrosetta.init("-mute all")
pose = pose_from_pdb("your_protein.pdb")
# Residue SelectorschainSelector = ChainSelector()chainSelector.set_chain_strings("A")
# MoversfastRelax = FastRelax()fastRelax.set_scorefxn(get_score_function("ref"))fastRelax.set_default_repeats(5)fastRelax.cartesian(True)
sfxn = get_score_function("ref2015")
# Apply moversfastRelax.apply(pose)
pose.dump_pdb("output.pdb")score = pose.energies().total_energy()print(f"Final score: {score}")

Rosetta <-> Biotite mapping coverage

CategoryRosettaBiotiteEquivalence
Structure I/Opose_from_pdbPDBFile.readFull
Structure I/Opose.dump_pdbPDBFile.writeFull
Structure I/Opose_from_file (CIF)CIFFile.readFull
Surface AnalysisSasaMetricbiotite.structure.sasaFull
AlignmentSuperimposeMoverbiotite.structure.superimposeFull
RMSDall_atom_rmsdbiotite.structure.rmsdFull
Secondary StructureDsspMoverannotate_ssePartial
Sequencepose.sequence()get_residuesFull
DistanceAtomPairConstraintbiotite.structure.distanceFull
Anglespose.phi/psi/omegabiotite.structure.dihedralFull
InterfaceInterfaceAnalyzerMoversasa + selectionPartial
Databasercsb.pose_from_rcsbrcsb.fetchFull
SelectionChainSelector etc.numpy boolean indexingFull
Contactsdistance matricesCellListPartial
Ramachandranpose.phi/psidihedral_backbonePartial
H-bondsHBondSetbiotite.structure.hbondPartial
B-factorspdb_info().bfactorAtomArray.b_factorFull
Center of Masscenter_of_massmass_centerFull
ScoringScoreFunctionNoneRosetta only
OptimizationFastRelaxNoneRosetta only
DesignFastDesignNoneRosetta only

Troubleshooting

  • Server shows red in Cursor: Restart Cursor. Use absolute path in config (e.g., /opt/homebrew/bin/rosetta-mcp-server). Ensure Node 14+ and Python 3.8+.
  • run_rosetta_scripts fails: Verify ROSETTA_BIN points to a valid binary. Try "$ROSETTA_BIN" -help.
  • PyRosetta tools say "not available": Install via pip install pyrosetta-installer then run the installer, or let the MCP server auto-install on first use.
  • Biotite tools return no results: Install Biotite in the same Python env: pip install biotite
  • get_rosetta_help returns "No detailed help": Try the exact Rosetta class name (e.g., "FastRelax" not "relax"). The tool resolves common aliases but may miss unusual names.

Verify from the command line

bash
# Check versionecho '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05"}}' | rosetta-mcp-server 2>/dev/null | python3 -c "import sys,json; print(json.loads(sys.stdin.readline())['result']['serverInfo'])"
# List all toolsecho '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | rosetta-mcp-server 2>/dev/null | python3 -c "import sys,json; [print(t['name']) for t in json.loads(sys.stdin.readline())['result']['tools']]"

Development

rosetta-mcp-server/├── rosetta_mcp_wrapper.js   # Node MCP server (protocol + all 18 tools)├── rosetta_mcp_server.py    # Python helper (static Rosetta data)├── install_pyrosetta.js     # Standalone PyRosetta installer├── package.json             # npm package config└── README.md

License and attribution

  • MIT for this repository
  • Rosetta/PyRosetta: see RosettaCommons licenses; commercial use requires the appropriate license
  • Biotite: BSD 3-Clause license

来源:README.md,提交 0c710cb

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.1最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。