AtomisticSkills follows a modular architecture designed to isolate dependencies across three uv projects (cpu, mlip, fairchem) and expose functionality through the Model Context Protocol (MCP) using the unified venv/run launcher:
┌─────────────────────────────────────────────────────────┐
│ AI Coding Agent │
│ (Antigravity, Claude Code, Cursor, Codex) │
└────────────────────┬────────────────────────────────────┘
│ MCP Protocol / CLI Fallback
┌──────────┴──────────┬───────────┬─────────────┐
│ │ │ │
┌────▼────┐ ┌──────▼──┐ ┌───▼───┐ ┌─────▼─────┐
│ MACE │ │ MatGL │ │ Fair │ │ Base │
│ Server │ │ Server │ │ Chem │ │ Server │
└────┬────┘ └────┬────┘ └───┬───┘ └─────┬─────┘
│ │ │ │
┌─────────▼───────────────────▼────────────▼─────────────▼────────┐
│ venv/run Launcher │
│ (Native uv execution with container image fallback) │
└─────────┬───────────────────┬──────────────────────────┬────────┘
│ │ │
┌────▼────────┐ ┌─────▼──────┐ ┌─────▼──────┐
│ venv/mlip │ │venv/fairchem│ │ venv/cpu │
│ (MACE,MatGL)│ │ (FairChem) │ │ (No Torch) │
└─────────────┘ └────────────┘ └────────────┘
Each MCP server is a standalone Python module that exposes tools via the FastMCP framework:
| Server | Runtime / venv | Primary Functionality |
|---|---|---|
| base_server.py | cpu |
Materials Project queries, structure utilities, literature |
| atomate2_server.py | cpu |
Remote DFT workflows, calculation status monitoring |
| drugdisc_server.py | cpu |
Molecular descriptors, standardization, PDBQT conversion |
| smol_server.py | cpu |
Cluster expansion training and Monte Carlo simulations |
| mace_server.py | mlip |
MACE foundation models (relax, MD, features) |
| matgl_server.py | mlip |
MatGL models (CHGNet, TensorNet), bandgap prediction |
| fairchem_server.py | fairchem |
FairChem models (UMA, eSEN) |
| mattergen_server.py | mattergen (aarch64: generative image) |
MatterGen generative crystal design |
| adit_server.py | adit (aarch64: generative image) |
ADiT all-atom diffusion transformer |
| diffcsp_server.py | diffcsp (aarch64: generative image) |
DiffCSP++ crystal structure generation |
Supporting libraries shared across MCP servers:
| Module | Purpose |
|---|---|
mlips/ |
Unified MLIP wrappers (MACE, MatGL, FairChem) with common predict / relax / MD / fine-tune interface |
generative_models/ |
Generative model wrappers (ADiT, DiffCSP++, MatterGen) for structure generation |
dft/ |
VASP input generation and output parsing via Pymatgen |
drugdisc_utils.py |
RDKit-based molecular descriptors, standardization, and PDBQT conversion |
structure_utils.py |
Convert between ASE Atoms, Pymatgen Structure, and dict formats |
structure_viz.py |
Crystal structure visualization and rendering |
disordered_material/ |
Order-disorder sampling for partial-occupancy structures |
mlips/md_utils.py |
MD monitors (explosion, volume, melting, equilibration detection) |
config_utils.py |
Global configuration and API key management |
Skills are modular, self-contained capabilities that combine multiple tools and scripts to accomplish complex research tasks. Each skill lives in its own directory with a standardized structure:
skills/<skill-name>/
├── SKILL.md # Instructions and documentation
├── scripts/ # Python helper scripts
├── examples/ # Reference input/output files with README.md
└── resources/ # Configuration files, templates, reference data
How Skills Work:
- The agent reads
SKILL.mdto understand the task - Follows step-by-step instructions
- Executes scripts via
venv/run <venv>in the declared environment (metadata.venv) - Uses resources and examples as templates
Tip
To create a new skill, follow the guidelines in skill-standards.md.
-
Choose the appropriate server based on dependencies
-
Define the tool function with type hints and docstrings:
@mcp.tool() def my_new_tool( structure_data: dict, parameter1: float = 1.0, parameter2: str = "default", ) -> dict: """ Brief description of what this tool does. Args: structure_data: Structure in dictionary format. parameter1: Description of parameter. parameter2: Another parameter. Returns: Dictionary with results. """ # Implementation logic return results
-
Test the tool:
# Test via the shell CLI fallback: venv/run cpu python -m src.mcp_server.cli base my_new_tool parameter1=2.0 # Or run the server over stdio for agent connection: venv/run --server base
- Create the skill directory:
skills/<skill-name>/ - Write
SKILL.mdfollowing skill-standards.md, declaringmetadata.venv: [cpu](ormlip,fairchem) - Add helper scripts to
scripts/ - Provide examples and resources as needed
- Test the skill commands through
venv/run
The project uses pytest executed through the launcher:
# Run core CPU test suites
venv/run cpu python -m pytest tests/test_launcher.py tests/test_skill_runtime.py tests/test_uv_projects.py tests/test_images_and_manifests.py tests/test_tool_cli.py -q
# Test server-specific suites in their respective environments
venv/run cpu python -m pytest tests/base/ tests/atomate2/ tests/drugdisc/ tests/smol/
venv/run mlip python -m pytest tests/mace/ tests/matgl/
venv/run fairchem python -m pytest tests/fairchem/- Three
uvprojects (cpu,mlip,fairchem) isolate incompatible dependencies (e.g.,e3nnversion pins in MACE vs FairChem). - The repository root is installed as an editable package into each virtualenv, ensuring
import srcworks uniformly. - Commands execute via
venv/run <venv>[+<extra>], which resolves the virtual environment automatically without manual activation.
All MCP servers use centralized output redirection (see src/utils/mcp_utils.py) to prevent:
- Print statements from polluting MCP responses
- Training logs from breaking the JSON protocol
- Debugging output from interfering with tool calls
For a complete guide on how AtomisticSkills mitigates this execution noise issue across heterogeneous infrastructures, see the MCP STDIO Redirection Guide.
Warning
Never use raw print() in MCP tool functions expecting the user to read them cleanly. Use proper logging. Legacy outputs are automatically routed to standard error by the server.
Every research task should:
- Call
create_research_dir(research_topic)to establish a timestamped directory underATOMISTIC_WORKSPACE - Save all results (structures, plots, logs) to this directory
- Document findings in the research directory
- Run
venv/run --doctorto verify runtime health and prerequisites. - For first-time server start, the environment may sync in the background; reconnect once ready.
- If using containers, ensure Docker/Podman/Apptainer is running.
- Execute scripts via
venv/run <venv>rather than a barepythoncommand. - Verify that
metadata.venvspecifies the appropriate project. - Use absolute imports:
from src.utils.mlips.loader import load_wrapper.
- Verify stress units are in eV/ų (see stress-units.md for details)
- Check training data format matches expected structure
- For small datasets (<500 structures), use
freeze_backbone=True
- Enable MD monitors:
monitor=True, monitor_type=["explosion", "volume"] - Reduce timestep (default: 1fs, try 0.5fs)
- Check initial structure is relaxed with
fmax < 0.05 eV/Å