refua-mcp
MCP server for biological protein design, folding, and affinity prediction using Refua tools, with optional support for ADMET, clinical simulation, preclinical planning, wet-lab automation, and more.
README
Refua MCP Server
MCP server exposing strict, typed Refua tools for Boltz2 folding/affinity and BoltzGen design workflows.
Protocol target: MCP spec revision 2025-11-25.
Install
pip install refua[cuda] # remove [cuda] if you don't need gpu support
pip install refua-mcp
ADMET predictions are optional; install refua[admet] to enable them:
pip install refua[admet]
Clinical trial simulation is optional; install the clinical extra:
pip install "refua-mcp[clinical]"
Data catalog/query/source-validation tools are optional; install the data extra:
pip install "refua-mcp[data]"
Preclinical planning/scheduling/bioanalysis/CMC tools are optional; install the preclinical extra:
pip install "refua-mcp[preclinical]"
WetLab, benchmark, regulatory, and deployment tools are optional:
pip install "refua-mcp[wetlab,bench,regulatory,deploy]"
Install the full project tool surface with:
pip install "refua-mcp[ecosystem]"
OpenTelemetry spans/metrics are optional:
pip install "refua-mcp[observability]"
Boltz2 and BoltzGen require model/molecule assets. If you don't have them, refua can download them for you automatically:
python -c "from refua import download_assets; download_assets()"
- Boltz2: uses
~/.boltzby default. Override via toolboltz.cache_dirif needed. - BoltzGen: uses the bundled HF artifact by default. Override via tool
boltzgen.mol_dirif needed.
MCP Clients
Claude Code
Add the server to your Claude Code MCP config (macOS: ~/Library/Application Support/Claude/claude_code_config.json, Linux: ~/.config/claude/claude_code_config.json). This uses the default assets (~/.boltz for Boltz2 and the bundled BoltzGen artifact). Merge with any existing mcpServers entries:
{
"mcpServers": {
"refua-mcp": {
"command": "python3",
"args": ["-m", "refua_mcp.server"]
}
}
}
Codex
Register the server with the Codex CLI (uses default asset locations):
codex mcp add refua-mcp -- python3 -m refua_mcp.server
List configured servers with:
codex mcp list
If the server is slow to boot (for example on first import of heavy ML deps),
raise the startup timeout in your Codex config.toml:
[mcp_servers.refua-mcp]
startup_timeout_sec = 30
Transport And Security
Default transport is stdio. You can run HTTP transports with runtime env vars:
REFUA_MCP_TRANSPORT=streamable-http python -m refua_mcp.server
Supported transport modes:
REFUA_MCP_TRANSPORT=stdio|sse|streamable-httpREFUA_MCP_HOST/REFUA_MCP_PORTREFUA_MCP_MOUNT_PATH
Security/runtime controls:
REFUA_MCP_ENABLE_DNS_REBINDING_PROTECTION=true|falseREFUA_MCP_ALLOWED_HOSTS=host1,host2REFUA_MCP_ALLOWED_ORIGINS=https://origin1,https://origin2REFUA_MCP_AUTH_TOKENS=token1,token2(static bearer tokens for HTTP transports)REFUA_MCP_TASK_TIMEOUT_SECONDSREFUA_MCP_QUEUE_TIMEOUT_SECONDS
Tools
refua_validate_spec: validate and normalize a request without running folding/affinity.refua_fold: run fold/design workflows with typed entities and constraints.refua_affinity: run affinity-only predictions.refua_antibody_design: focused antibody entrypoint (antibody+ optionalcontext_entities).refua_protein_properties: compute sequence-based protein properties via Refua'sProteinPropertiesAPI.refua_data_list(optional): list datasets fromrefua-datacatalog.refua_data_fetch(optional): fetch one dataset into local cache.refua_data_materialize(optional): materialize one dataset into parquet parts.refua_data_query(optional): query filtered rows from materialized parquet data.refua_data_validate_sources(optional): validate catalog source URLs/API endpoints.refua_job: check status/results for background jobs.refua_admet_profile(optional): run model-based ADMET predictions for SMILES strings (requiresrefua[admet]).refua_clinical_simulator(optional): run therefua-clinicalsimulator and optional workup (requiresrefua-mcp[clinical]).refua_preclinical_templates(optional): fetch default study + sample templates and curated references (requiresrefua-mcp[preclinical]).refua_preclinical_plan(optional): generate GLP tox/pharmacology study planning payloads.refua_preclinical_schedule(optional): generate in vivo operational schedules.refua_preclinical_bioanalysis(optional): run bioanalytical ETL/QC and simple NCA summaries.refua_preclinical_workup(optional): generate integrated preclinical workups with optional bioanalysis.refua_preclinical_cmc_templates(optional): fetch CMC starter templates and references.refua_preclinical_cmc_plan(optional): generate formulation/process/QbD/validation CMC planning outputs.refua_preclinical_batch_record(optional): generate electronic batch record templates.refua_preclinical_stability_plan(optional): generate stability study schedules.refua_preclinical_stability_assess(optional): assess stability results against criteria.refua_preclinical_release_assess(optional): evaluate release decisions from batch/stability evidence.refua_wetlab_providers(optional): list wet-lab automation providers.refua_wetlab_validate_protocol(optional): validate canonical wet-lab protocol payloads.refua_wetlab_compile_protocol(optional): compile protocols for a provider.refua_wetlab_run_protocol(optional): create dry-run or queued wet-lab protocol runs.refua_wetlab_run_status(optional): list/fetch/cancel wet-lab runs and build run lineage.refua_wetlab_lms_get/refua_wetlab_lms_post(optional): access the WetLab LMS resource API.refua_bench_init,refua_bench_run,refua_bench_compare,refua_bench_gate,refua_bench_baseline(optional): benchmark and regression-gate workflows.refua_regulatory_bundle,refua_regulatory_verify,refua_regulatory_summary,refua_regulatory_checklist(optional): regulatory evidence bundle operations.refua_deploy_plan,refua_deploy_render(optional): deployment planning and artifact rendering.
All major tools expose strict JSON schemas, including discriminated entity unions by type and typed output schemas.
Output-format notes:
structure_output_format: canonical values areciforbcif;mmcifis accepted as a compatibility alias forcif.feature_output_format: usetorchornpzwhen writing feature files. Ifjsonis provided with a file output request, the server normalizes it tonpzand reports a warning.- If
feature_output_pathends with.json, the server normalizes it to.npzfor feature file export. - Fold/design responses include a
warningslist when compatibility normalization is applied.
Input-compatibility notes:
- For compatibility with some MCP clients,
entities,constraints,antibody, andcontext_entitiesalso accept JSON-encoded strings and will be normalized server-side.
Execution-policy notes:
refua_foldandrefua_antibody_designblock exploratory names by default (for examplesanity_*,*_probe,schema_*,smoke_*) to avoid costly preflight runs.- If an exploratory run is intentionally needed, set
allow_exploratory_run=true. - Asynchronous fold/affinity/design tools accept
queue_timeout_seconds(optional).
Error-contract notes:
- Tool errors return a structured payload with
error.code,error.message, optionalerror.hint, anderror.retryable.
Resources And Templates
refua://capabilities(resource): runtime feature flags, protocol revision, transport/security config summary.refua://recipes/index(resource): lists canonical recipe names.refua://recipes/{recipe_name}(resource template): returns concrete tool/args examples.refua://protein-properties/index(resource): lists available protein property names/groups.refua://protein-properties/group/{group_name}(resource template): lists property names in a group.refua://protein-properties/property/{property_name}(resource template): property metadata.
Completion support:
refua://recipes/{recipe_name}completions for recipe names.refua://protein-properties/group/{group_name}completions for group names.refua://protein-properties/property/{property_name}completions for property names.
Recipe names:
fold_protein_ligandaffinity_onlyantibody_designprotein_propertiesclinical_simulation(optional; available whenrefua-clinicalis installed)preclinical_plan(optional; available whenrefua-preclinicalis installed)preclinical_workup(optional; available whenrefua-preclinicalis installed)preclinical_cmc_plan(optional; available whenrefua-preclinicalis installed)preclinical_cmc_release(optional; available whenrefua-preclinicalis installed)data_validate_sources(optional; available whenrefua-datais installed)wetlab_protocol_run(optional; available whenrefua-wetlabis installed)bench_init(optional; available whenrefua-benchis installed)regulatory_verify(optional; available whenrefua-regulatoryis installed)deploy_plan(optional; available whenrefua-deployis installed)
Workflow
Recommended call sequence:
- Read
refua://recipes/indexand optionally a recipe template. - Read
refua://capabilitiesfor runtime support and limits. - For sequence-only property analysis, call
refua_protein_properties. - Call
refua_validate_specto catch schema/logic issues before expensive runs (deep_validate=truefor asset-backed construction checks). - Execute
refua_fold,refua_affinity,refua_antibody_design,refua_clinical_simulator(optional),refua_wetlab_*(optional), or therefua_preclinical_*tools (optional). - For long runs, set
async_mode=trueand pollrefua_job.
Examples
Fold protein + ligand with optional affinity:
{
"tool": "refua_fold",
"args": {
"name": "protein_ligand",
"entities": [
{"type": "protein", "id": "A", "sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ"},
{"type": "ligand", "id": "lig", "smiles": "CCO"}
],
"constraints": [
{"type": "pocket", "binder": "lig", "contacts": [["A", 5], ["A", 8]]}
],
"affinity": {"binder": "lig"},
"admet": true
}
}
Affinity-only:
{
"tool": "refua_affinity",
"args": {
"name": "protein_ligand_affinity",
"entities": [
{"type": "protein", "id": "A", "sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ"},
{"type": "ligand", "id": "lig", "smiles": "CCO"}
],
"binder": "lig"
}
}
Antibody-focused design:
{
"tool": "refua_antibody_design",
"args": {
"name": "ab_design",
"antibody": {
"type": "antibody",
"ids": ["H", "L"],
"heavy_cdr_lengths": [12, 10, 14],
"light_cdr_lengths": [10, 9, 9]
},
"context_entities": [
{"type": "protein", "id": "A", "sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ"}
]
}
}
Validate only (no run):
{
"tool": "refua_validate_spec",
"args": {
"action": "fold",
"entities": [
{"type": "protein", "id": "A", "sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ"},
{"type": "ligand", "id": "lig", "smiles": "CCO"}
]
}
}
ADMET predictions:
{
"tool": "refua_admet_profile",
"args": {
"smiles": "CCO",
"include_scoring": true
}
}
Protein properties:
{
"tool": "refua_protein_properties",
"args": {
"sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ",
"groups": ["basic"],
"include_catalog": true
}
}
Clinical simulation (optional):
{
"tool": "refua_clinical_simulator",
"args": {
"trial_id": "small_molecule_phase2",
"replicates": 80,
"include_workup": true,
"include_replicates": false
}
}
Preclinical workup (optional):
{
"tool": "refua_preclinical_workup",
"args": {
"seed": 7,
"lloq_ng_ml": 1.0,
"use_template_rows_when_missing": true,
"include_references": true
}
}
Preclinical CMC release assessment (optional):
{
"tool": "refua_preclinical_release_assess",
"args": {
"batch_results": {
"assay_percent": 99.0,
"content_uniformity_av": 9.8,
"dissolution_q30_percent": 92.0,
"total_impurities_percent": 0.7,
"water_content_percent": 1.5,
"appearance_score": 5.0
},
"include_references": true
}
}
Note: DNA/RNA entities are supported for Boltz2 folding only (BoltzGen does not accept DNA/RNA entities).
Long-Running Jobs
For runs that exceed the tool-call timeout, set async_mode=true and poll sparingly
(for example every 30-120 seconds) or follow recommended_poll_seconds from refua_job.
{
"tool": "refua_fold",
"args": {
"async_mode": true,
"entities": [...]
}
}
Then poll:
{
"tool": "refua_job",
"args": {
"job_id": "..."
}
}
For queued/running jobs, the response includes recommended_poll_seconds plus queue
and estimate metadata (queue_position, queue_depth, average_runtime_seconds,
estimated_start_seconds, estimated_remaining_seconds).
Set include_result=true once complete to fetch results.
Set cancel=true in refua_job to cancel queued/running jobs.
Long-poll support:
{
"tool": "refua_job",
"args": {
"job_id": "...",
"wait_for_terminal_seconds": 300,
"cancel": false,
"include_result": true
}
}
Experimental MCP Tasks
This server enables MCP experimental task support (tasks/get, tasks/result,
tasks/list, tasks/cancel) and advertises task execution support for
refua_validate_spec, refua_fold, refua_affinity, refua_antibody_design,
and refua_admet_profile. refua_clinical_simulator and
refua_preclinical_templates / refua_preclinical_plan /
refua_preclinical_schedule / refua_preclinical_bioanalysis /
refua_preclinical_workup / refua_preclinical_cmc_templates /
refua_preclinical_cmc_plan / refua_preclinical_batch_record /
refua_preclinical_stability_plan / refua_preclinical_stability_assess /
refua_preclinical_release_assess are also task-enabled when installed.
If your client supports task-augmented tool calls, prefer tasks for long-running
operations. Task cancellation (tasks/cancel) is wired to background job cancellation.
Otherwise, continue with async_mode=true + refua_job.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。