Skip to main content
Glama

Crystal Energy

Deterministic lattice energies, relaxed-structure validation and pair energy decompositions of molecular crystals (including hydrates and salts) from CIF files, using machine-learned interatomic potentials (UMA, MACE) through one Python API and one MCP server for agent hosts. Numbers come only from deterministic kernels; the agent orchestrates.

Status: M1 — structure layer. This preview publishes the contracts in spec/ and implements:

  • crystal_energy.api.load_cif, build_crystal and enumerate_pairs: CIF reading, symmetry expansion into whole molecules, components with formal charges, Z and Z', and symmetry-unique molecule pairs within a nearest-atom cutoff;

  • list_model_cards, get_backend and single_point with the analytic toy backend (spec/toy_backend.md) on the CPU;

  • the MCP tools crystal_status and crystal_help (crystal_inspect, crystal_plan, crystal_run and crystal_job return NOT_IMPLEMENTED);

  • the CLI commands crystal-energy status and crystal-energy help.

The only energy backend is toy; the UMA and MACE backends are placeholders, and real models and GPU execution follow in M2. No GPU, model-weight, host or delivery acceptance exists yet. Do not use this release for scientific results.

Development setup

Requires uv and Python 3.12 or later.

uv sync --locked
uv run crystal-energy status
uv run crystal-energy-mcp   # MCP server on stdio

The structure layer (gemmi, networkx) is part of the required dependencies. Optional extras: gpu, uma, mace (uma and mace cannot be installed in the same environment because of conflicting e3nn pins).

Related MCP server: scientific-skills-hub

Checks

uv run ruff check .
uv run ruff format --check .
uv run pytest -q
uv run python scripts/check_contracts.py
uv run python scripts/smoke_mcp.py
uv run python scripts/check_release.py
uv run python scripts/path_guard.py main..HEAD

Layout

Path

Contents

Owner

spec/

Public API stub, error codes, units, toy backend, JSON Schemas

Maintainer (signed commits)

benchmarks/

Benchmark data, tolerances and MANIFEST.sha256

Maintainer (signed commits)

tests/

Contract, invariance, physics and agent tests

Tester role

src/crystal_energy/

Layered implementation; api.py is the only public surface

Implementer role

adapters/

Codex and Claude plugin manifests and the workflow skill

Implementer role

scripts/

Contract, smoke, release and path-guard checks

Implementer role

See AGENTS.md for the layering and role rules and RUNTIME_LIFECYCLE.md for process lifecycles.

Licence

MIT, see LICENSE. Third-party packages and model weights keep their own terms; see THIRD_PARTY_NOTICES.md.

Available Tools

6 tools
crystal_helpB
Read-onlyIdempotent

Short guidance for one topic (overview, validate, lattice_energy, pairs, series, workflow, errors); topic workflow attaches the workflow JSON Schema.

Inputs: topic. Returns: ok, text, error, topic, +1 more

crystal_inspectB
Read-onlyIdempotent

Read a CIF: components with formal charges, atom count, warnings and per-model applicability. Read-only.

Inputs: cif_path (required). Returns: ok, error, n_atoms, warnings, +2 more

crystal_jobB
Read-onlyIdempotent

Job state, new events after after_event_seq, up to 50 summary rows, result file paths and the provenance file. Read-only.

Inputs: job_id (required), after_event_seq. Returns: ok, error, state, events, +6 more

crystal_planB
Idempotent

Build and resolve a workflow for one task over one or more CIFs, write it to disk (idempotent) and estimate its size. Every default becomes explicit.

Inputs: task (required), cif_paths (required), model, options. Returns: ok, error, estimate, resolved, +2 more

crystal_runA
Idempotent

Start a resolved workflow as a job. Reusing an idempotency_key returns the same job_id instead of starting another job.

Inputs: workflow_path (required), idempotency_key (required). Returns: ok, error, job_id

crystal_statusB
Read-onlyIdempotent

Version, device and available models with their element coverage, charge support and weight licence. Read-only; call first.

Inputs: no named parameters. Returns: ok, error, device, version, +1 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct role: status for environment, help for guidance, inspect for CIF parsing, plan for workflow construction, run for job submission, and job for monitoring. The read-only annotations and task-specific verbs make misselection unlikely.

    Naming Consistency5/5

    All tools use the same `crystal_` prefix and lower snake_case suffix, with no casing or delimiter inconsistencies. Although suffixes mix nouns and verbs, the convention is uniform and predictable.

    Tool Count5/5

    Six tools is well-scoped for a workflow-oriented MCP server. Each tool covers a necessary stage without redundancy or bloat.

    Completeness4/5

    The surface covers the core lifecycle: environment check, help, CIF inspection, workflow planning, job submission, and job monitoring/results. It lacks explicit job cancellation/listing and a standalone validation tool, but these are minor gaps for the main workflow.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for deconstructing and analyzing Metal-Organic Framework (MOF) structures, including SBU and ligand identification, guest removal, and COF stacking analysis. It enables AI agents to perform automated chemical informatics and structural characterization on crystal structures via CIF files.
      1
      -
    • A
      license
      B
      quality
      B
      maintenance
      Provides offline search and retrieval of curated scientific computing Agent Skills for modeling, computational chemistry, DFT, molecular dynamics, and visualization. It exposes tools for skill cards, compatibility checks, content/bundle retrieval, version diffs, health checks, and issue reporting via HTTP or stdio MCP.
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to run materials computation workflows through tools for loading structures, relaxing potentials, screening doped variants, analyzing phonons and elasticity, sampling candidates, and replaying trajectories. It exposes these capabilities over stdio or streamable HTTP, adapting available engines and structure sources to the environment.
      MIT