Rosetta Context

by arielbs

Not rated
GitHub

About

Rosetta protein design & modeling for agents

Details

Author
arielbs
Categories
Other, AI

Setup

Install Rosetta Context in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/arielbs/rosetta-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

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)

- 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.)

- 37 element typessupported (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(withSpan),Reweight,ScoreFunction
- Reports unrecognized elements so you know what needs manual work

- get_rosetta_helpnow accepts any topic: movers by name ("FastRelax"), concepts ("constraints", "docking"), or score functions ("ref2015") -- auto-fetches live docs from rosettacommons.org
- search_rosetta_web_docsfallback: when DuckDuckGo is rate-limited, probes direct Rosetta docs URLs
- get_cached_docsauto-caches: no need to callcache_cli_docsfirst
- Expanded static help for score_functions, movers, filters, xml, and parameters

- pyrosetta_score: newper_residueoption returns per-residue energy breakdown
- scorefxnparameternow works (was ignored in v1.1.8)
- Proper error messages for missing files instead of silent{}

- validate_xml: newvalidate_against_schemaoption checks element names against the Rosetta XSD schema (catches typos likeFastRleax)

- tools/callresponses now use correct{ content: [{ type: "text", text }] }format
- Tool errors returnisError: true(not JSON-RPC errors)
- Standard JSON-RPC error codes (-32601, -32700, -32603)
- Removed falseresourcescapability advertisement

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

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

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 includescorefxn,repeats,cartesian,disable_design,MoveMapconfiguration...

2.rosetta_to_biotite("FastRelax")returns:

{ "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.

# Create a venv with PyRosetta and Biotite uv 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).

{ "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):

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

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

<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>
import pyrosetta from pyrosetta import pose_from_pdb from pyrosetta.rosetta.core.scoring import get_score_function from 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 Selectors chainSelector = ChainSelector() chainSelector.set_chain_strings("A") # Movers fastRelax = FastRelax() fastRelax.set_scorefxn(get_score_function("ref")) fastRelax.set_default_repeats(5) fastRelax.cartesian(True) sfxn = get_score_function("ref2015") # Apply movers fastRelax.apply(pose) pose.dump_pdb("output.pdb") score = pose.energies().total_energy() print(f"Final score: {score}")

Rosetta <-> Biotite mapping coverage

- 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_scriptsfails: VerifyROSETTA_BINpoints to a valid binary. Try"$ROSETTA_BIN" -help.
- PyRosetta tools say "not available": Install viapip install pyrosetta-installerthen 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_helpreturns "No detailed help": Try the exact Rosetta class name (e.g., "FastRelax" not "relax"). The tool resolves common aliases but may miss unusual names.

# Check version echo '{"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 tools echo '{"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']]"
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

A unified framework for bioinformatics research, integrating multiple specialized MCP servers for longevity and bioinformatics.

Institutional research and manager diligence reports on hedge funds, venture capital and private equity managers. Summary of filings, personnel changes, media screening and social signals delivered to you in minutes.

Control anaerobic digestion modeling (ADM1) using natural language.

Structured regulatory intelligence for AI agents. Check compliance obligations, deadlines, and cross-jurisdiction requirements for EU AI Act, Singapore IMDA, and Colorado AI Act.

aTars MCP by aarna provides AI agents with structured access to crypto market signals, technical indicators, and sentiment analysis.

An AI-powered Bazi calculator providing precise data for personality analysis and destiny forecasting.

Detect and audit AI bias across protected characteristics — demographic parity, equalized odds, disparate impact analysis

Bioinformatics data for AI agents — gene search, protein structures, clinical variants, PubMed literature, and DNA sequences via NCBI and UniProt. No API key required.

Canada Artificial Intelligence and Data Act compliance — risk classification, impact assessment, regulatory readiness by MEOK AI Labs

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.