Architecture

Table of contents

  1. Two layers
  2. Package structure
  3. Registries
  4. Runtime types
  5. MCP server pattern
  6. Centralised cache
  7. Status caching
  8. Workflow skills
  9. Chain conventions
  10. Auto-creation pipeline

Two layers

  1. MCP servers (tool-mcps/) — 28 individual computational tools, each wrapping a scientific package (RFdiffusion, ProteinMPNN, Rosetta, AlphaFold, Boltz, Gnina, …) as a FastMCP server with its own environment
  2. Workflow skills (workflow-skills/) — Markdown protocols that orchestrate several MCP servers into a complete design pipeline, registered with Claude Code as slash commands

Package structure

src/
  mcp_cli.py            # cpmcp entry point (Click CLI)
  skill_cli.py          # cpskill entry point (Click CLI)
  utils.py              # shared utilities
  cycpep_mcp/
    mcp.py              # MCP data model
    mcp_manager.py      # registry operations, YAML loading
    install_mcp.py      # install / uninstall / register with Claude Code
    create_mcp.py       # auto-create an MCP from a GitHub repo (8-step pipeline)
    mcp_creator.py      # Claude-powered generation helpers
    status_cache.py     # cached status checks (5-minute TTL, file-locked)
    configs/
      mcps.yaml         # local MCP registry (28 entries)
      public_mcps.yaml  # public MCP registry (10 entries)
  skill/
    skill.py            # Skill data model
    skill_manager.py    # install / uninstall skills
    create_skill.py     # interactive skill creation
    configs.yaml        # skill registry

setup.py maps package_dir={"cycpepmcp": "src"} and declares two entry points:

  • cpmcp → cycpepmcp.mcp_cli:main
  • cpskill → cycpepmcp.skill_cli:main

Registries

Two YAML registries, loaded by MCPManager:

Registry File Purpose
Local tool-MCPs src/cycpep_mcp/configs/mcps.yaml 28 in-house MCPs
Public MCPs src/cycpep_mcp/configs/public_mcps.yaml 10 community servers, cloned into tool-mcps/public/

Each entry declares its runtime, path, server command and arguments, setup script, Docker image and arguments, and cache subpaths. cpmcp install reads this and then registers the server in Claude Code’s ~/.claude.json.

Runtime types

Runtime Use case Example MCPs
docker GPU, complex dependencies afcycdesign, rfpeptides, boltz, alphafold3, gnina
uv Lightweight CPU cyclicchamp, haddock3, multicycgt, pharmpapp
python Conda-based adcp, cyc_builder, cyclicpeptide, cycpeptmp

Docker MCPs are registered with --gpus all --ipc=host and a bind-mount of the working directory, so absolute paths resolve identically inside and outside the container. Skills therefore instruct Claude to convert relative paths to absolute ones before any tool call.

MCP server pattern

Every GPU-intensive server shares one structure:

tool-mcps/<name>/
  src/server.py         # FastMCP server with the tool definitions
  src/jobs/manager.py   # FIFO job queue, thread-safe, file-locked metadata.json
  quick_setup.sh        # environment setup
  Dockerfile            # docker MCPs only

Job lifecycle:

submit_*()  ->  job_id
get_job_status(job_id)
get_job_result(job_id)

Jobs live on the filesystem with metadata.json, stdout/stderr logs and output files. One GPU job runs at a time per server, so a long job blocks the queue behind it.

Parallel resubmits can race on metadata.json.tmp and fail with [Errno 2]. Submit resubmissions sequentially.

Centralised cache

Model weights and databases live under one root, MACROMNEX_CACHE (default ~/.macromnex/cache):

$MACROMNEX_CACHE/
├── data/      # databases and reference data
└── model/     # ML model weights
    ├── boltz/
    ├── alphafold2/params/
    ├── alphafold3/
    └── ...

Each MCP declares cache_data and cache_model as {subpath, mount}. Docker MCPs get these mounted as volumes; uv and python MCPs receive the MACROMNEX_CACHE environment variable. Directories are created during cpmcp install, and cpmcp cache prints the resolved layout.

Status caching

src/cycpep_mcp/status_cache.py caches MCP status for five minutes in tool-mcps/mcp.status, a JSON file guarded with fcntl locking. This avoids repeated docker image inspect calls and filesystem walks during parallel installs. cpmcp status --refresh bypasses it.

Workflow skills

Skills are Markdown files in workflow-skills/. On install they are copied to:

  • .claude/commands/ — slash commands, e.g. /binder-design-rfpeptides
  • .claude/skills/ — Claude Code skills

Required MCPs are declared per skill in src/skill/configs.yaml, which is what cpskill install reads to pull the dependencies in.

Chain conventions

Different tools assign chains differently. Getting this wrong silently scores the wrong molecule:

Tool Binder (peptide) Target (protein)
RFpeptides output Chain A Chain B
ProteinMPNN design chains="A" fixed
Rosetta interface metrics peptide_chain="A" —
AfCycDesign binder design Chain B (output) Chain A

Auto-creation pipeline

cpmcp create -g <github_url> -d tool-mcps/<name> runs eight Claude-powered steps: set up the directory, clone the repository with submodules, create the environment and scan use cases, execute them with automated debugging, write reusable function scripts, extract the tools into a FastMCP server, test the Claude and Gemini integrations, and write a README plus quick_setup.sh. Marker files in .pipeline/ checkpoint each step so a run can resume.


Copyright © 2026 Charles XU. Distributed under the MIT License.