MCP Materials Server
Provides AI assistants with access to materials science databases, enabling search and analysis of material properties, crystal structures, phase diagrams, and elastic properties through the Materials Project API.
README
MCP Materials Server
A Model Context Protocol (MCP) server that provides AI assistants with access to materials science databases, starting with the Materials Project API.
Built with the MCP Python SDK using FastMCP.
Features
Tools (10)
| Tool | Description |
|---|---|
search_materials |
Search materials by chemical formula (e.g., "Fe2O3", "LiFePO4") |
get_structure |
Retrieve crystal structure in CIF, POSCAR, or JSON format |
get_properties |
Get comprehensive material properties (band gap, formation energy, etc.) |
compare_materials |
Side-by-side comparison of multiple materials |
search_by_elements |
Find materials containing/excluding specific elements |
search_by_band_gap |
Search by electronic band gap range (eV) |
get_similar_structures |
Find materials with similar crystal structures |
get_phase_diagram |
Phase stability analysis for chemical systems |
get_elastic_properties |
Mechanical properties (bulk/shear modulus, Debye temperature) |
search_by_elastic_properties |
Find materials by mechanical property ranges |
Resources (2)
| Resource | URI | Description |
|---|---|---|
| Periodic Table | materials://periodic-table |
Element data with atomic numbers and masses |
| Crystal Systems | materials://crystal-systems |
The 7 crystal systems with symmetry constraints |
Prompts (3)
| Prompt | Description |
|---|---|
analyze_material |
Comprehensive analysis workflow for a material ID |
find_battery_materials |
Search for battery electrode candidates |
compare_alloy_compositions |
Compare phases in an alloy system |
Installation
Prerequisites
- Python 3.11 or higher
- Materials Project API key (get one free)
Setup
# Clone or navigate to the project
cd mcp-materials-server
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
# Install the package
pip install -e ".[dev]"
Set API Key
# On Windows (PowerShell):
$env:MP_API_KEY = "your_api_key_here"
# On Windows (CMD):
set MP_API_KEY=your_api_key_here
# On macOS/Linux:
export MP_API_KEY="your_api_key_here"
Usage
Run the Server
# Using the installed command
mcp-materials
# Or run directly
python -m mcp_materials.server
Claude Desktop Integration
Add to your Claude Desktop configuration file:
Location:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Configuration:
{
"mcpServers": {
"materials": {
"command": "python",
"args": ["-m", "mcp_materials.server"],
"cwd": "D:\\path\\to\\mcp-materials-server",
"env": {
"MP_API_KEY": "your_api_key_here"
}
}
}
}
After adding the configuration, restart Claude Desktop.
Example Queries
Once connected to Claude, you can ask:
Basic Searches
- "Search for lithium cobalt oxide materials"
- "Find materials with formula Fe2O3"
- "Search for materials containing Li, Fe, and O"
Property Lookups
- "Get the properties of mp-149 (Silicon)"
- "What is the band gap of mp-19017?"
- "Get the crystal structure of mp-149 in CIF format"
Advanced Analysis
- "Find materials with band gap between 1.5 and 2.5 eV"
- "Get the elastic properties of silicon (mp-149)"
- "Generate a phase diagram for the Li-Fe-O system"
- "Compare the properties of LiCoO2 and LiFePO4"
- "Find stiff materials with bulk modulus > 200 GPa"
Research Workflows
- "Analyze material mp-149 comprehensively"
- "Find potential Li-ion battery cathode materials"
- "Compare phases in the Fe-Cr-Ni alloy system"
Development
Run Tests
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run specific test class
pytest tests/test_server.py::TestToolFunctions -v
Lint Code
# Check for issues
ruff check src/
# Auto-format
ruff format src/
Project Structure
mcp-materials-server/
├── src/
│ └── mcp_materials/
│ ├── __init__.py # Package version
│ └── server.py # MCP server (10 tools, 2 resources, 3 prompts)
├── tests/
│ ├── __init__.py
│ ├── conftest.py # Pytest configuration
│ └── test_server.py # Comprehensive test suite
├── pyproject.toml # Project configuration
├── claude_desktop_config.example.json
├── .gitignore
└── README.md
API Reference
Tool Details
search_materials(formula, max_results=10)
Search by chemical formula. Returns material IDs, band gaps, formation energies, and stability.
get_structure(material_id, format="cif")
Get crystal structure. Formats: cif, poscar, json.
get_properties(material_id)
Full property set: composition, symmetry, electronic, thermodynamic properties.
compare_materials(material_ids)
Compare list of materials side-by-side.
search_by_elements(elements, exclude_elements=None, max_results=10)
Find materials by element composition.
search_by_band_gap(min_gap=0, max_gap=10, direct_gap_only=False, max_results=10)
Search by band gap range in eV.
get_similar_structures(material_id, max_results=5)
Find materials with same space group.
get_phase_diagram(elements)
Build phase diagram for chemical system. Returns stable/unstable phases with decomposition products.
get_elastic_properties(material_id)
Mechanical properties: bulk modulus, shear modulus (Voigt/Reuss/VRH), Poisson ratio, Debye temperature.
search_by_elastic_properties(min_bulk_modulus=None, max_bulk_modulus=None, min_shear_modulus=None, max_shear_modulus=None, max_results=10)
Filter materials by mechanical properties.
Roadmap
- [ ] Add AFLOW database integration
- [ ] Add OQMD database support
- [ ] Add electronic structure (DOS, band structure) tools
- [ ] Add XRD pattern simulation
- [ ] Add synthesis route suggestions
- [ ] Add surface/interface properties
License
MIT
References
Author
Hesham Salama
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。