pypi cmxflowstdioMITupdated 8d ago
Build cheminformatics and computational chemistry pipelines with composable blocks. Tune end-to-end with Bayesian Optimization. Or ask an LLM agent to do it.
What can you do with cmxflow?
cmxflow π§ͺ
Build cheminformatics and computational chemistry pipelines with composable blocks. Tune end-to-end with Bayesian Optimization. Or ask an LLM agent to do it.
Quick examples
Prepare ligands for docking
from cmxflow import Workflow
from cmxflow.sources import MoleculeSourceBlock
from cmxflow.operators import (
MoleculeStandardizeBlock,
IonizeMoleculeBlock,
EnumerateStereoBlock,
ConformerGenerationBlock,
)
from cmxflow.sinks import MoleculeSinkBlock
# Standardize β ionize (pH 6.4β8.4) β enumerate stereo β generate 3D conformers
workflow = Workflow()
workflow.add(
MoleculeSourceBlock(),
MoleculeStandardizeBlock(),
IonizeMoleculeBlock(),
EnumerateStereoBlock(),
ConformerGenerationBlock(),
MoleculeSinkBlock(),
)
workflow("library.smi", "prepared.sdf")
Dock a congeneric series
Pure-Python docking. Free docking is the default (index_poses=False); scaffold-indexed mode caches poses by BemisβMurcko scaffold for ~3Γ faster throughput on congeneric series with consistent pose alignment.
from cmxflow import Workflow
from cmxflow.sources import MoleculeSourceBlock
from cmxflow.operators import ConformerGenerationBlock, MoleculeDockBlock
from cmxflow.sinks import MoleculeSinkBlock
from cmxflow.utils.parallel import make_parallel
workflow = Workflow()
workflow.add(
MoleculeSourceBlock(),
ConformerGenerationBlock(),
make_parallel(
MoleculeDockBlock(
receptor="receptor.pdb",
site_reference="crystal_ligand.sdf",
index_poses=True, # omit for free docking
)
),
MoleculeSinkBlock(),
)
workflow("library.smi", "docked.sdf")
Tune a ligand-based virtual screen
from cmxflow import Workflow
from cmxflow.sources import MoleculeSourceBlock
from cmxflow.operators import MoleculeSimilarityBlock
from cmxflow.scores import EnrichmentScoreBlock
from cmxflow.opt import Optimizer
# Rank a library by 2D similarity to a known active, then tune the
# fingerprint end-to-end to maximize enrichment AUC.
workflow = Workflow()
workflow.add(
MoleculeSourceBlock(),
MoleculeSimilarityBlock(queries="crystal_ligand.sdf"),
EnrichmentScoreBlock(target="active"),
)
opt = Optimizer(workflow, "benchmark.csv")
opt.optimize(n_trials=30, direction="maximize")
print(f"Best enrichment AUC: {opt.best_score:.3f}")
print(opt.best_params)
# Best enrichment AUC: 0.836
# {'fingerprint_type': 'morgan', 'similarity_metric': 'sokal', 'radius': 2, 'nbits': 2545}
The four fingerprint parameters above are searched automatically β every block exposes its mutable parameters to the optimizer.
Or build it conversationally via an LLM agent
claude mcp add cmxflow -- cmxflow-mcp
"How many of the molecules in library.csv pass Lipinski's rules?"
"I need to build a ligand-based virtual screening workflow. I'm not sure if 2D or 3D is better. Can you optimize two workflows?"
"Dock the molecules in hits.csv against receptor.pdb with crystal_ligand.sdf as a reference."
The agent can build, run, and optimize workflows. See Using with Claude for full transcripts.
What's in the box
- 15+ blocks for sourcing, transforming, filtering, clustering, scoring, and docking molecules
- Bayesian optimization of pipeline parameters via Optuna
- Parallel execution for compute-heavy blocks (conformer generation, docking)
- Workflow serialization for save / load / reuse
- An MCP server with five tools:
build_workflow,run_workflow,optimize_workflow,manage_workflows,view_structures
Install
pip install cmxflow
MCP server
claude mcp add cmxflow -- cmxflow-mcp
Optional: PyMOL
Required only for the view_structures MCP tool (3D visualization):
conda install -c conda-forge pymol-open-source
Documentation
- Docs site
- Block catalog
- Using with Claude β agent transcripts
examples/basic_usage.ipynbβ full tutorialexamples/docking/docking.ipynbβ docking walkthrough (ILS, scaffold-indexed, and template modes)
Project
MIT licensed. See CONTRIBUTING.md and RELEASING.md.
Install
Add cmxflow to your client. Pick the one you use.
claude mcp add cmxflow -- uvx cmxflowcodex mcp add cmxflow -- uvx cmxflowamp mcp add cmxflow -- uvx cmxflow{
"mcpServers": {
"cmxflow": {
"command": "uvx",
"args": [
"cmxflow"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"cmxflow": {
"command": "uvx",
"args": [
"cmxflow"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"cmxflow","command":"uvx","args":["cmxflow"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"cmxflow": {
"command": "uvx",
"args": [
"cmxflow"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"cmxflow": {
"command": "uvx",
"args": [
"cmxflow"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"cmxflow": {
"command": "uvx",
"args": [
"cmxflow"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"cmxflow": {
"type": "local",
"command": "uvx",
"args": [
"cmxflow"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"cmxflow": {
"command": {
"path": "uvx",
"args": [
"cmxflow"
]
}
}
}
}Add to your Zed `settings.json`.
uvx cmxflowRun `goose configure`, choose **Add Extension β Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation16/25
- Maintenance19/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
Version history
| Versions | Published |
|---|---|
| 0.4.0Latest | Jun 15, 2026 |
| 0.3.1 | May 16, 2026 |