/atomistic-skills:mat-db-mpfrom Atomistic Skills
Queries the Materials Project database for crystal structures, computed properties, elastic/magnetic data, and structurally similar materials via the MP API.
Ships in Atomistic Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
[!NOTE] Steps written
server.toolare MCP tool calls:base.search_materials_project_by_formulais thesearch_materials_project_by_formulatool of thebaseserver (mcp__base__search_materials_project_by_formula, ormcp__plugin_atomistic-skills_base__search_materials_project_by_formulawhen installed as a plugin). Without a connected server, run the same tools from the shell. Tools named in one command share a process, so a model loaded byload_modelstays loaded:${CLAUDE_SKILL_DIR}/../../venv/run cpu python -m src.mcp_server.cli base search_materials_project_by_formula key=value search_materials_project_by_chemsys key=value
To retrieve crystal structures and computed properties from the Materials Project database, enabling efficient materials discovery and property analysis. This skill provides access to:
Note: For quick structure retrieval by formula or chemical system, MCP tools are also available (see MCP Tools section).
Use query_mp.py to search for materials by chemical system, formula, or elements with property filtering.
Basic Query (Summary Endpoint):
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/query_mp.py \
--chemsys "Li-S" \
--properties energy_above_hull formation_energy_per_atom band_gap \
--e_above_hull_max 0.05 \
--limit 10 \
--endpoint summary \
--output stable_li_s_materials.json
Detailed Thermodynamic Data (Thermo Endpoint):
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/query_mp.py \
--chemsys "Li-O" \
--endpoint thermo \
--limit 20 \
--output li_o_thermo.json
Key Parameters:
--chemsys: Chemical system (e.g., "Li-S", "Si-O")--formula: Specific chemical formula (e.g., "LiFePO4")--elements: List of elements that must be present--properties: Properties to retrieve (default: energy_above_hull, formation_energy_per_atom)--e_above_hull_max: Maximum energy above hull for stability filtering (eV/atom)--endpoint: Choose summary (includes structures) or thermo (detailed thermodynamics, no structures)--limit: Maximum number of results to retrieveOutput: JSON file containing material IDs, formulas, CIF strings (summary endpoint), and requested properties.
Use get_elasticity.py to retrieve bulk modulus, shear modulus, and elastic tensor data.
Query Specific Material:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_elasticity.py \
--material_id mp-149 \
--output si_elasticity.json
Filter by Bulk Modulus Range:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_elasticity.py \
--bulk_modulus_min 200 \
--bulk_modulus_max 400 \
--output high_bulk_modulus.json
Key Parameters:
--material_id: Specific MP ID(s) to query--bulk_modulus_min/max: Bulk modulus (VRH) range in GPa--shear_modulus_min/max: Shear modulus (VRH) range in GPaOutput: JSON file with bulk modulus, shear modulus (Voigt, Reuss, VRH averages), and full elastic tensor.
Use get_magnetism.py to retrieve magnetic ordering, magnetization, and site-specific magnetic moments.
Query Specific Material:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_magnetism.py \
--material_id mp-19770 \
--output fe2o3_magnetism.json
Filter by Magnetic Ordering and Magnetization:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_magnetism.py \
--ordering FM \
--total_magnetization_min 10.0 \
--output ferromagnetic_materials.json
Key Parameters:
--material_id: Specific MP ID(s) to query--ordering: Magnetic ordering type (FM, AFM, FiM, NM)--total_magnetization_min/max: Total magnetization range in μBOutput: JSON file with magnetic ordering, total magnetization, and per-site magnetic moments.
Use get_structure_by_id.py to retrieve crystal structures directly by their Materials Project ID.
Single Structure Retrieval:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_structure_by_id.py mp-149 \
--output Si_diamond.cif
Batch Retrieval:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/get_structure_by_id.py \
mp-149 mp-19017 mp-1143 \
--output_dir structures/
Key Parameters:
material_ids: One or more MP IDs to retrieve--output: Output path for single material ID (CIF format)--output_dir: Output directory for batch retrieval--api_key: Optional API key (uses MP_API_KEY env var by default)Output: CIF file(s) containing the crystal structure(s).
Use find_similar_structures.py to find materials with similar crystal structures based on CrystalNN fingerprinting.
Find Similar to MP Material:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/find_similar_structures.py \
--material_id mp-149 \
--top 15 \
--output similar_to_si.json
Find Similar to Custom Structure:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/find_similar_structures.py \
--structure my_structure.cif \
--top 20 \
--output similar_structures.json
Filter by Chemical System:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/find_similar_structures.py \
--material_id mp-149 \
--top 20 \
--chemsys "C" \
--output carbon_structures_like_si.json
Key Parameters:
--material_id: MP ID to use as query structure--structure: Path to custom structure file (CIF, POSCAR, etc.)--top: Number of most similar structures to return (default: 50)--chemsys: Optional post-filter by exact chemical system matchSimilarity Algorithm: Uses CrystalNN to compute local coordination fingerprints, aggregates them into structure fingerprints, and ranks by Euclidean distance in fingerprint space. Dissimilarity score: 100 * (1 - exp(-distance)), where 0% = identical and 100% = maximally different.
Output: JSON file with similar material IDs, formulas, and dissimilarity scores (0-100%).
See the examples/ directory for complete working examples:
Basic Queries (examples/query_mp/):
cd skills/mat-db-mp
bash examples/query_mp/li_s_stability.sh
# Output: Retrieves 2 stable Li-S materials (E_hull < 0.05 eV/atom)
Elastic Properties (examples/elasticity/):
cd skills/mat-db-mp
bash examples/elasticity/elasticity_query.sh
# Output: Si elastic data + 1387 materials with K=200-400 GPa
Magnetic Properties (examples/magnetism/):
cd skills/mat-db-mp
bash examples/magnetism/magnetism_query.sh
# Output: Fe2O3 magnetic data + 23,121 ferromagnetic materials
Structure Similarity (examples/similarity/):
cd skills/mat-db-mp
bash examples/similarity/similarity_search.sh
# Output: 15 structures similar to Si (mp-149)
Structure Retrieval (examples/get_structure/):
cd skills/mat-db-mp
bash examples/get_structure/structure_retrieval.sh
# Output: CIF files for Si, LiFePO4, and Fe2O3
For simple structure retrieval tasks, MCP tools provide a convenient alternative to running scripts:
base.search_materials_project_by_formula(
formula="LiFePO4", # Chemical formula
save_to_file="lifepo4.cif" # Optional: save path (default: auto-generated)
)
Returns only the single most stable structure (lowest energy above hull) matching the formula. If multiple polymorphs exist, only ONE is returned.
base.search_materials_project_by_chemsys(
chemsys="Li-O", # Chemical system
save_to_file="LiO_structures" # Optional: directory path (default: {chemsys}_structures)
)
Returns all stable structures on the convex hull (E_hull = 0) in the specified chemical system. Structures are saved to individual CIF files in a directory.
Output: Directory containing CIF files for each hull structure, named {mp-id}_{formula}.cif. Each structure includes metadata (material_id, formula, energy_above_hull) in the atoms.info dict.
Example Output:
Found 3 structures on convex hull for Li-O
Saved to directory: /path/to/LiO_structures
Structures:
- mp-1960: Li2O (E_hull=0.000000 eV/atom)
- mp-12958: Li2O2 (E_hull=0.000000 eV/atom)
- mp-841: LiO2 (E_hull=0.000000 eV/atom)
Use MCP Tools when:
get_structure_by_id.py saves them without complaintUse Scripts when:
MP_API_KEY environment variablecpu environmentfind_similar methodcpu environment uses Python 3.12summary endpoint includes crystal structures (CIF format)thermo endpoint provides detailed thermodynamic data but no structures--chemsys parameter in similarity search performs post-filtering for exact element matches, not compositional similaritympr.materials.summary): General material data with structuresmpr.materials.thermo): Detailed thermodynamic propertiesmpr.materials.elasticity): Elastic modulus and tensor datampr.materials.magnetism): Magnetic ordering and momentsmpr.materials.similarity): CrystalNN-based structure matchingAuthor: Bowen Deng Contact: GitHub @learningmatter-mit
examples/README.md (opens in a new tab)examples/elasticity/elasticity_query.sh (opens in a new tab)examples/elasticity/high_bulk_modulus.json (opens in a new tab)examples/elasticity/si_elasticity.json (opens in a new tab)examples/get_structure/mp-1143.cif (opens in a new tab)examples/get_structure/mp-149.cif (opens in a new tab)examples/get_structure/mp-149_Si.cif (opens in a new tab)examples/get_structure/mp-19017.cif (opens in a new tab)examples/get_structure/structure_retrieval.sh (opens in a new tab)examples/magnetism/fe2o3_magnetism.json (opens in a new tab)examples/magnetism/ferromagnetic_materials.json (opens in a new tab)examples/magnetism/magnetism_query.sh (opens in a new tab)examples/query_mp/li_s_stability.sh (opens in a new tab)examples/query_mp/li_s_stable.json (opens in a new tab)examples/similarity/similar_si_carbon_only.json (opens in a new tab)examples/similarity/similar_to_si.json (opens in a new tab)examples/similarity/similarity_search.sh (opens in a new tab)scripts/find_similar_structures.py (opens in a new tab)scripts/get_elasticity.py (opens in a new tab)scripts/get_magnetism.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub learningmatter-mit/atomisticskills --plugin atomistic-skills133 skills in this plugin
/chem-bond-dissociationCalculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation./chem-conformer-searchGenerate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting./chem-db-mofQuery multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al. via Materials Cloud) and download CIF structures with optional element or identifier filters.Other plugins' skills for the same job