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
pytestAvailable Tools
3 toolsfind_materials_by_formulaB
Find materials with a specific chemical formula.
Args:
formula: Chemical formula to search for (e.g., "Fe2O3").
max_records: Maximum number of records to return (default: 10).
Returns:
List of materials matching the specified formula.
| Name | Required | Description | Default |
|---|---|---|---|
| formula | Yes | ||
| max_records | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool returns a list of materials but lacks details on permissions, rate limits, error handling, or whether the search is exact or fuzzy. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with the purpose, followed by clear sections for Args and Returns. Every sentence earns its place, with no redundant information, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and parameters but lacks behavioral details and usage guidelines. Without annotations or output schema, more context on return format or errors would be beneficial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'formula' is a chemical formula with an example ('Fe2O3') and clarifies 'max_records' as the maximum number to return with a default value. This compensates well for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Find materials with a specific chemical formula.' It specifies the verb ('Find') and resource ('materials'), making the action explicit. However, it doesn't differentiate from sibling tools like 'get_materials_with_elements' which might have overlapping functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'get_materials_with_elements' or 'get_material_details.' The description only states what the tool does without indicating appropriate contexts, prerequisites, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_material_detailsA
Get detailed information about a specific material by its Materials Project ID.
Args:
material_id: The Materials Project ID (e.g., "mp-149").
Returns:
Dictionary containing detailed information about the material.
| Name | Required | Description | Default |
|---|---|---|---|
| material_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or what specific information is included in the 'detailed information.' This is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with a clear purpose statement followed by concise sections for Args and Returns. Every sentence adds value without redundancy, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (single parameter, no output schema, no annotations), the description is adequate but has clear gaps. It explains the parameter well and states the return type, but without annotations or output schema, it lacks details on behavioral aspects like error cases or the structure of the returned dictionary, leaving room for improvement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds substantial meaning beyond the input schema, which has 0% coverage. It explains that material_id is a 'Materials Project ID' and provides an example ('mp-149'), clarifying the parameter's purpose and format, which compensates fully for the schema's lack of description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get detailed information') and resource ('about a specific material by its Materials Project ID'), distinguishing it from sibling tools like find_materials_by_formula and get_materials_with_elements, which search by formula or elements rather than retrieving details by ID.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying 'by its Materials Project ID,' suggesting this tool is for retrieving details when you have a specific ID. However, it does not explicitly state when not to use it or name alternatives, such as using sibling tools for search instead.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_materials_with_elementsB
Find materials containing specific elements.
Args:
elements: List of elements that must be present in the material (e.g., ["Fe", "O"]).
exclude_elements: Optional list of elements that must not be present.
max_records: Maximum number of records to return (default: 10).
Returns:
List of materials containing the specified elements.
| Name | Required | Description | Default |
|---|---|---|---|
| elements | Yes | ||
| exclude_elements | No | ||
| max_records | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does (finds materials) and describes parameters, but lacks critical behavioral information: it doesn't mention whether this is a read-only operation, what data source it queries, potential rate limits, authentication requirements, or error conditions. The description is functional but incomplete for behavioral understanding.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and appropriately sized. It begins with a clear purpose statement, then lists parameters with brief explanations and examples, and concludes with return information. Every sentence adds value, though the 'Returns' section could be slightly more detailed given the lack of output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, no annotations, no output schema), the description is adequate but has gaps. It covers parameters well and states the return type, but lacks behavioral context (e.g., data source, performance characteristics) and doesn't explain the format of returned materials. For a search tool with no structured metadata, more completeness would be beneficial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant value beyond the input schema, which has 0% description coverage. It explains the meaning of all three parameters: 'elements' must be present, 'exclude_elements' must not be present, and 'max_records' limits results with a default. The examples (e.g., ["Fe", "O"]) and clarification of optionality are particularly helpful. Since schema coverage is low, the description effectively compensates.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Find materials containing specific elements.' This is a specific verb+resource combination that distinguishes it from sibling tools like 'find_materials_by_formula' (which presumably searches by chemical formula) and 'get_material_details' (which retrieves details for specific materials). However, it doesn't explicitly contrast with siblings beyond the inherent difference in function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools, suggest scenarios where this tool is appropriate, or warn against misuse. The only contextual information is the parameter descriptions, which don't constitute usage guidelines.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: find_materials_by_formula searches by chemical formula, get_material_details retrieves detailed information by ID, and get_materials_with_elements searches by element composition. There is no overlap in functionality, making tool selection unambiguous for an agent.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., find_materials_by_formula, get_material_details, get_materials_with_elements). The naming is predictable and readable throughout the set.
With only 3 tools, the set feels thin for a materials science domain, which might involve more operations like filtering by properties, comparing materials, or updating data. While the tools cover basic search and retrieval, the count is borderline for comprehensive coverage.
The tools provide essential search and retrieval functions (by formula, ID, and elements), but there are notable gaps. For a materials database, operations like filtering by material properties (e.g., band gap, stability), sorting, or pagination are missing, which could limit agent workflows in more complex tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Turn any LLM into your lab assistant: search samples, track experiments, analyze data with AI.
Materials MCP — computed (DFT) materials structures & thermodynamic properties.
OQMD (Open Quantum Materials Database) MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThe 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.13MIT
- 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.101MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.3MIT
- AlicenseNot gradedqualityCmaintenanceProvides 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.8MIT
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