materials-mp-constraint-search
БесплатноЗапускает вложенные скриптыНе проверенQuery Materials Project for crystals satisfying a multi-objective performance constraint set (bandgap / formation_energy / ehull + banned elements), with…
от pdl-openair★ 16 звёзд на GitHubОб этом скилле
MP Constraint Search
Input
- 约束集:bandgap / formation_energy / ehull 上下界、元素数范围、禁用元素列表
- 多样性参数:每个 chemsys 保留前 N 个、排序键(auto / stability / cl_score)
- 是否启用 crystal-property-prediction MCP 验证(
--verify-cppred):决定是否对 cl_score / f_max / exfoliation_energy 做交叉验证 - MP_API_KEY:从项目根
.env读取(如/home/george/code/DEMO/.env;申请见 https://next-gen.materialsproject.org/api)
Default Constraint Set
Aligned with DEMO/Evoloop.py my_constraints:
| Constraint | Threshold | Filtered where |
|---|---|---|
bandgap_eV |
∈ [0.2, 3.5] | MP server-side |
formation_energy_eV |
≤ 0 | MP server-side |
ehull_eV |
≤ 1.0 | MP server-side |
num_elements |
== 3 | MP server-side |
element_set banned |
Hg, Tl, Na, K, F | MP server-side (exclude_elements) |
sg_number |
≠ 1 | Client-side |
cl_score |
≥ 0.50 | crystal-property-prediction MCP only (optional --verify-cppred) |
f_max_eV_A |
≤ 2.0 | crystal-property-prediction MCP only (optional --verify-cppred) |
exfoliation_energy_meV |
∈ [-5, 350] | crystal-property-prediction MCP only (optional --verify-cppred) |
Important: MP does not compute cl_score / f_max / exfoliation_energy.
For full constraint satisfaction you must enable --verify-cppred (each candidate
costs ~10–30s against the crystal-property-prediction MCP at mcp.example.internal:22222).
Steps
推荐端到端流水线(产出 mp_candidates_diverse_v2/,命中率 60%、chemsys 多样性 100%、约 7 分钟):
Step 1: MP server-side query
num_elements=3, bandgap ∈ [0.2,3.5], formation_energy ≤ 0,
ehull ≤ 1.0, exclude Hg/Tl/Na/K/F
↓ (~20s)
Step 2: Client-side filter
sg ≠ 1, ban 22 rare elements (Ac/Th/U/.../Tc/Pm/Po/At/Rn/Fr/Ra)
↓
Step 3: Diversity filter
group by chemsys, keep top-1 per group (rank_by=stability)
↓
Step 4: Crystal-property-prediction MCP verification
per candidate (~10–30s each): cl_score / f_max / exfoliation
↓
Step 5: Constraint check + write passing_candidates.json
filter to candidates passing ALL 9 constraints
emit cif_base64 list ready for evolution seeds
Quick Start
# 1. Fast survey — only uses MP server-side fields (≈20s for 30 candidates)
python3 .claude/skills/materials-mp-constraint-search/scripts/search_mp_candidates.py \
--max-results 30
# 2. Recommended full pipeline — diverse, rare-excluded, cppred-verified
python3 .claude/skills/materials-mp-constraint-search/scripts/search_mp_candidates.py \
--verify-cppred \
--max-results 15 \
--max-per-chemsys 1 \
--output-dir ./seeds_v1
# → produces passing_candidates.json (clean structured output)
# 3. Customize the constraint set
python3 .claude/skills/materials-mp-constraint-search/scripts/search_mp_candidates.py \
--bandgap 1.0 2.0 \
--ehull-max 0.5 \
--num-elements 2 4 \
--banned-elements Hg Tl Cd Pb
Output
Layout:
mp_candidates_<timestamp>/
├── candidates.json # 所有候选,含 MP 字段 + cppred 验证字段(结构化 JSON)
├── cifs/ # 每个候选的 CIF 结构文件
│ ├── mp-1234_MoS2.cif
│ └── ...
├── summary.json # 完整原始数据 + 查询元信息
├── report.md # 人类可读 Markdown 报告
└── passing_candidates.json # ⭐ 通过全部约束的候选 + base64 CIF
# (仅 --verify-cppred 时生成)
passing_candidates.json schema
{
"metadata": {
"generated_at": "2026-06-15T20:50:00",
"constraint_set": { /* DEFAULT_CONSTRAINTS snapshot */ },
"query_params": { /* all CLI args as passed */ }
},
"summary": {
"total_candidates": 6,
"cppred_verified_ok": 5,
"passing_all_constraints": 3,
"unique_chemsys": 3,
"hit_rate": 0.60
},
"passing_candidates": [
{
"mp_id": "mp-1197575",
"formula": "Ag2AsS2",
"chemsys": "Ag-As-S",
"element_set": ["Ag", "As", "S"],
"properties": {
"bandgap_eV": 0.538, "formation_energy_eV": -0.146,
"ehull_eV": 0.003, "cl_score": 0.809,
"f_max_eV_A": 0.170, "exfoliation_energy_meV": 28.8,
"sg_number": 7, "sg_symbol": "Pc",
"cppred_bandgap_ev": 0.848, "cppred_hull_ev": 1.091
},
"passes_constraints": {
"bandgap_eV": true, "formation_energy_eV": true,
"ehull_eV": true, "num_elements": true,
"sg_number": true, "cl_score": true,
"f_max_eV_A": true, "exfoliation_energy_meV": true,
"element_set_banned": true
},
"cif_path": "cifs/mp-1197575_Ag2AsS2.cif",
"cif_base64": "IyBnZW5lcmF0ZWQg..." // inline CIF
}
],
"seed_cif_files": [ // ⭐ 直接喂给 mattergen MCP
{"name": "mp-1197575_Ag2AsS2.cif", "cif_base64": "..."},
{"name": "mp-567334_Ag(BCl)6.cif", "cif_base64": "..."},
{"name": "mp-568392_Ag10Te4Br3.cif","cif_base64": "..."}
]
}
CLI Reference
Query parameters:
--max-results N 最终返回数上限(默认 200)
--bandgap MIN MAX 带隙范围 eV(默认 0.2 3.5)
--formation-energy-max F 形成能上限 eV/atom(默认 0)
--ehu
Установить materials-mp-constraint-search в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл materials-mp-constraint-search?
Query Materials Project for crystals satisfying a multi-objective performance constraint set (bandgap / formation_energy / ehull + banned elements), with optional crystal-property-prediction MCP cross-validation of cl_score / f_max / exfoliation_energy. Use when the user wants real DFT-verified seed candidates for DEMO evolution, or wants to know which existing materials meet a property constraint set. Common phrasings: '找满足约束的种子材料', '查 MP 看哪些三元硫族化合物带隙在 0.5–2 eV', '给我一批高合成可行性的演化种子'. Do NOT use when: (a) just looking up one material like MoS2's bandgap → use pymatgen/scripts/mp_query.py info; (b) generating NEW crystals → use materials-new-crystal-generation; (c) computing properties for an existing CIF → use crystal-property-prediction MCP directly or materials-crystal-property-evaluation.
Как установить скилл materials-mp-constraint-search?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл materials-mp-constraint-search запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic