AtomisticSkills follows a modular, multi-environment architecture designed to isolate dependencies and expose functionality through the Model Context Protocol (MCP):
┌─────────────────────────────────────────────────────────┐
│ Antigravity Agent │
│ (Coding AI Copilot Interface) │
└────────────────────┬────────────────────────────────────┘
│ MCP Protocol
┌──────────┴──────────┬───────────┬─────────────┐
│ │ │ │
┌────▼────┐ ┌──────▼──┐ ┌───▼───┐ ┌─────▼─────┐
│ MACE │ │ MatGL │ │ Fair │ │Materials │
│ Server │ │ Server │ │ Chem │ │Tools │
│ │ │ │ │Server │ │Server │
└────┬────┘ └────┬────┘ └───┬───┘ └─────┬─────┘
│ │ │ │
┌────▼────────┐ ┌─────▼──────┐ ┌──▼─────┐ ┌────▼──────┐
│mace-agent │ │matgl-agent │ │fairchem│ │base-agent │
│environment │ │environment │ │-agent │ │environment│
└─────────────┘ └────────────┘ └────────┘ └───────────┘
Each MCP server is a standalone Python module that exposes tools via the FastMCP framework:
| Server | Environment | Primary Functionality |
|---|---|---|
| mace_server.py | mace-agent |
MACE model loading, prediction, relaxation, MD, fine-tuning |
| matgl_server.py | matgl-agent |
CHGNet/M3GNet/TensorNet operations, bandgap prediction |
| fairchem_server.py | fairchem-agent |
UMA/ESEN models |
| base_server.py | base-agent |
Materials Project queries, VASP I/O, research directory management |
| atomate2_server.py | atomate2-agent |
Query remote DFT databases, job status monitoring |
| smol_server.py | smol-agent |
Cluster expansion training and Monte Carlo simulations |
| drugdisc_server.py | drugdisc-agent |
Molecular descriptors, standardization, PDBQT conversion |
| mattergen_server.py | mattergen-agent |
MatterGen generative crystal design |
Supporting libraries shared across MCP servers:
| Module | Purpose |
|---|---|
mlips/ |
Unified MLIP wrappers (MACE, MatGL, FairChem, MatterGen) with common predict / relax / MD / fine-tune interface |
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:
.agents/skills/<skill-name>/
├── SKILL.md # Instructions and documentation
├── scripts/ # Python/Bash helper scripts
├── examples/ # Reference input/output files
└── resources/ # Configuration files, templates
How Skills Work:
- The agent reads
SKILL.mdto understand the task - Follows step-by-step instructions
- Executes scripts from the
scripts/directory in the appropriate environment - 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 by restarting the MCP server:
# Stop the server in Antigravity # Then restart it manually for debugging: export PYTHONPATH=/path/to/AtomisticSkills conda activate <appropriate-env> python -m src.mcp_server.<server_name>
- Create the skill directory:
.agents/skills/<skill-name>/ - Write
SKILL.mdfollowing the standards - Add helper scripts to
scripts/(specify required conda environment) - Provide examples and resources as needed
- Test the skill end-to-end with Antigravity
The project uses pytest with environment-specific test directories:
# Test a specific environment
conda activate mace-agent
pytest tests/mace/
# Run all tests (requires all environments)
pytest tests/Test organization:
tests/
├── base/ # General utilities (base-agent)
├── mace/ # MACE-specific tests (mace-agent)
├── matgl/ # MatGL-specific tests (matgl-agent)
├── fairchem/ # FairChem-specific tests (fairchem-agent)
└── integration/ # Cross-tool integration tests
- Each MCP server runs in a dedicated conda environment to avoid dependency conflicts
- The
PYTHONPATHmust point to the project root for all servers - When debugging, always activate the correct environment before importing modules
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 - Save all results (structures, plots, logs) to this directory
- Document findings in the research directory
- Check
mcp_config.jsonfor correct Python paths - Verify
PYTHONPATHpoints to project root - Restart Antigravity after configuration changes
- Ensure correct conda environment is activated
- Check that
PYTHONPATHincludes project root:export PYTHONPATH=/path/to/AtomisticSkills - Use absolute imports:
from src.utils.mlips.mace_wrapper import MACEWrapper
- 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/Å