Materials Project MCP
Allows interaction with GitHub repositories, specifically accessing the Materials Project MCP repository for cloning and development purposes.
Supports testing of the Materials Project MCP codebase through pytest integration for verification of functionality.
Enables programmatic interaction with the Materials Project database through Python, allowing custom scripts to retrieve and process materials data.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Materials Project MCPfind materials containing silicon and oxygen with band gap less than 2 eV"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Materials Project MCP
A fastmcp-based tool for writing prompts against data in the Materials Project database.
Installation
You can install the package from source:
pip install -e .Or using uv:
uv pip install -e .Related MCP server: MCP Materials Server
Usage
You can use the CLI:
mp-mcpOr import in your Python code:
from materials_project_mcp.main import create_mcp
mcp = create_mcp()
mcp.run()API Key Setup
The Materials Project API requires an API key. You can set up your API key in several ways:
Pass it directly to the MPRester:
from mp_api.client import MPRester with MPRester("your_api_key_here") as mpr: # do stuff with mprSet it as an environment variable:
export MP_API_KEY="your_api_key_here"
Example
Here's a simple example that demonstrates how to use the MCP tools directly:
import os
import json
from materials_project_mcp.tools import (
get_materials_with_elements,
get_material_details,
find_materials_by_formula
)
# Set your API key
os.environ["MP_API_KEY"] = "your_api_key_here"
# Or load it from a file
# with open("~/materials_project_api.key", "r") as f:
# os.environ["MP_API_KEY"] = f.read().strip()
# Function to print JSON data in a readable format
def print_json(data):
print(json.dumps(data, indent=2))
# Find materials containing Fe and O
print("\n=== Finding materials containing Fe and O ===")
materials = get_materials_with_elements(
elements=["Fe", "O"],
max_records=3
)
print_json(materials)
# Get details for a specific material
if materials:
material_id = materials[0]["material_id"]
print(f"\n=== Getting details for material {material_id} ===")
details = get_material_details(material_id)
print_json(details)
# Find materials with a specific formula
print("\n=== Finding materials with formula Fe2O3 ===")
formula_materials = find_materials_by_formula(
formula="Fe2O3",
max_records=3
)
print_json(formula_materials)Development
Local Setup
# Clone the repository
git clone https://github.com/justaddcoffee/materials-project-mcp.git
cd materials-project-mcp
# Install development dependencies
uv pip install -e ".[dev]"Running Tests
pytestMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceThe Materials Project MCP Server is server that provides programmatic access to the Materials Project database. It enables LLMs, to search, analyze, and retrieve up to date materials science data.Last updated12MIT
- AlicenseAqualityDmaintenanceProvides 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.Last updated101MIT
- Alicense-qualityFmaintenanceEnables natural language querying of OPTIMADE-compatible material databases like Materials Project and Materials Cloud via the Model Context Protocol. It provides tools for linting query filters, discovering database providers, and accessing full structured data results as MCP resources.Last updated2MIT
- Alicense-qualityCmaintenanceProvides computed (DFT) materials structures and thermodynamic properties through the Pipeworx MCP gateway, enabling AI agents to query materials data via natural language or tool calls.Last updated25MIT
Related MCP Connectors
Materials MCP — computed (DFT) materials structures & thermodynamic properties.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fair2wise/materials_project_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server