一键导入
mat-db-mp
Query Materials Project database for crystal structures, computed properties, elastic/magnetic data, and structurally similar materials using the MP API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query Materials Project database for crystal structures, computed properties, elastic/magnetic data, and structurally similar materials using the MP API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Quantify prediction uncertainty of MACE MLIPs using committee (ensemble) models; flag high-uncertainty structures for DFT verification.
Compute phonon-limited carrier mobility and mode-resolved electron-phonon coupling in 2D materials from first principles with Quantum ESPRESSO and EPW.
GPU-accelerated batched inference for MACE, MatGL (TensorNet/M3GNet/CHGNet), and FairChem MLIPs using NValchemi, enabling parallel static, relax, and MD workflows across multiple structures simultaneously.
Extract structured synthesis procedures from a folder of PDFs using the LeMat-Synth GeneralSynthesisOntology schema, producing one JSON file per paper with per-material synthesis records.
Predict LC-MS/MS (MS2, tandem mass spectra) from SMILES via ICEBERG, a two-stage deep neural network. Outputs predicted m/z vs intensity spectrum, fragment ion SMILES, and a spectrum plot.
Match an experimental spectrum (1H NMR, 13C NMR, IR) against predicted or database reference spectra for candidate ranking and structure confirmation. Supports local catalog lookup, public database fallback, and pluggable similarity metrics.
| name | mat-db-mp |
| description | Query Materials Project database for crystal structures, computed properties, elastic/magnetic data, and structurally similar materials using the MP API. |
| category | ["materials"] |
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):
# Env: base-agent
python .agents/skills/mat-db-mp/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):
# Env: base-agent
python .agents/skills/mat-db-mp/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:
# Env: base-agent
python .agents/skills/mat-db-mp/scripts/get_elasticity.py \
--material_id mp-149 \
--output si_elasticity.json
Filter by Bulk Modulus Range:
# Env: base-agent
python .agents/skills/mat-db-mp/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:
# Env: base-agent
python .agents/skills/mat-db-mp/scripts/get_magnetism.py \
--material_id mp-19770 \
--output fe2o3_magnetism.json
Filter by Magnetic Ordering and Magnetization:
# Env: base-agent
python .agents/skills/mat-db-mp/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:
# Env: base-agent
python .agents/skills/mat-db-mp/scripts/get_structure_by_id.py mp-149 \
--output Si_diamond.cif
Batch Retrieval:
# Env: base-agent
python .agents/skills/mat-db-mp/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:
# Env: base-agent
python .agents/skills/mat-db-mp/scripts/find_similar_structures.py \
--material_id mp-149 \
--top 15 \
--output similar_to_si.json
Find Similar to Custom Structure:
# Env: base-agent
python .agents/skills/mat-db-mp/scripts/find_similar_structures.py \
--structure my_structure.cif \
--top 20 \
--output similar_structures.json
Filter by Chemical System:
# Env: base-agent
python .agents/skills/mat-db-mp/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 .agents/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 .agents/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 .agents/skills/mat-db-mp
bash examples/magnetism/magnetism_query.sh
# Output: Fe2O3 magnetic data + 23,121 ferromagnetic materials
Structure Similarity (examples/similarity/):
cd .agents/skills/mat-db-mp
bash examples/similarity/similarity_search.sh
# Output: 15 structures similar to Si (mp-149)
Structure Retrieval (examples/get_structure/):
cd .agents/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:
mcp_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.
mcp_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:
Use Scripts when:
MP_API_KEY environment variablebase-agent conda environmentfind_similar methodsummary 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