Skip to main content

MCP server for Refua Boltz2 folding/affinity and BoltzGen design workflows.

Project description

Refua MCP Server

MCP server exposing Refua's unified Complex API for Boltz2 folding/affinity and BoltzGen design workflows.

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]

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 ~/.boltz by default. Override via tool boltz.cache_dir if needed.
  • BoltzGen: uses the bundled HF artifact by default. Override via tool boltzgen.mol_dir if 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

Tools

  • refua_complex: run a unified Complex spec with action="fold" (default) or action="affinity". Supports protein|dna|rna|binder|peptide|antibody|ligand|file entities. Optionally run ADMET for SMILES ligands via admet (auto by default when available).
  • refua_job: check status for background jobs and optionally return results.
  • refua_admet_profile (optional): run model-based ADMET predictions for SMILES strings (only available when refua[admet] is installed).

Example (fold a protein + ligand with optional affinity):

{
  "tool": "refua_complex",
  "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
  }
}

Example (ADMET predictions):

{
  "tool": "refua_admet_profile",
  "args": {
    "smiles": "CCO",
    "include_scoring": true
  }
}

Example (antibody helper + peptide helper):

{
  "tool": "refua_complex",
  "args": {
    "name": "design_helpers",
    "entities": [
      {"type": "protein", "id": "A", "sequence": "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ"},
      {"type": "antibody", "ids": ["H", "L"], "heavy_cdr_lengths": [12, 10, 14], "light_cdr_lengths": [10, 9, 9]},
      {"type": "peptide", "id": "P", "segment_lengths": [10, 6, 3], "disulfide": 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 the job. Folding (action="fold") can take minutes depending on inputs and hardware, so poll sparingly (for example, every 10-30 seconds with backoff) or follow recommended_poll_seconds from refua_job.

{
  "tool": "refua_complex",
  "args": {
    "async_mode": true,
    "entities": [...]
  }
}

Then poll with:

{
  "tool": "refua_job",
  "args": {
    "job_id": "..."
  }
}

For queued/running jobs, the response includes recommended_poll_seconds plus queue and estimate metadata (queue_position = jobs ahead, queue_depth = queued jobs, average_runtime_seconds, estimated_start_seconds, estimated_remaining_seconds) to help clients back off. Set include_result=true once the job is complete to fetch the output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refua_mcp-0.5.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refua_mcp-0.5.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file refua_mcp-0.5.0.tar.gz.

File metadata

  • Download URL: refua_mcp-0.5.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.2 Darwin/25.2.0

File hashes

Hashes for refua_mcp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 950f711b79039ccb3dea66036da861fabc562a734b9ef5a6b9f476107e629249
MD5 be68981a22393c30fb37b5f108387c2d
BLAKE2b-256 f129de7044dbbcc0d389582c3c03c7a30a89be660997d930ae4d70928d31ef27

See more details on using hashes here.

File details

Details for the file refua_mcp-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: refua_mcp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.2 Darwin/25.2.0

File hashes

Hashes for refua_mcp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a00a263816b4dbd7bf12e59accd59738954eff947befcf93dad26f628b9913d
MD5 e49ab56860f7471157392a93cce28c0f
BLAKE2b-256 128b4957775813699b52f595350cf622c8c3cc6d0e2d6918aac991d657371d95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page