Foundry includes an MCP (Model Context Protocol) server that enables AI assistants like Claude to discover and use materials science datasets.
MCP is a protocol that allows AI assistants to use external tools. With Foundry's MCP server, you can ask Claude:
"Find me a materials science dataset for band gap prediction"
"What fields are in the OQMD dataset?"
"Load the training data and show me the first few rows"
Install for Claude Code
This adds Foundry to your Claude Code configuration. Restart Claude Code to activate.
For custom integrations:
The MCP server provides these tools to AI agents:
search_datasets
Search for materials science datasets.
Parameters:
query (string, required) - Search terms
limit (integer, optional) - Maximum results (default: 10)
Returns: List of datasets with name, title, DOI, description
Example prompt: "Search for datasets about crystal structures"
get_dataset_schema
Get the schema of a dataset - what fields it contains.
Parameters:
doi (string, required) - The dataset DOI
Returns: Schema with splits, fields, data types, and descriptions
Example prompt: "What fields are in dataset 10.18126/abc123?"
Load a dataset and return its data with schema.
Parameters:
doi (string, required) - The dataset DOI
split (string, optional) - Which split to load (default: all)
Returns: Data with schema information and citation
Example prompt: "Load the training data from the band gap dataset"
list_all_datasets
List all available Foundry datasets.
Parameters:
limit (integer, optional) - Maximum results (default: 100)
Returns: Complete catalog of available datasets
Example prompt: "What datasets are available in Foundry?"
The foundry mcp install command adds this to your Claude Code config:
Custom Integration
For other MCP-compatible clients, the server uses stdio transport:
Example Conversations
Finding a Dataset
You: Find me a dataset for predicting band gaps of materials
Claude: I'll search for band gap datasets in Foundry.
Uses search_datasets tool
I found 5 datasets related to band gaps:
OQMD Band Gaps (10.18126/abc) - 50,000 materials
AFLOW Band Gaps (10.18126/def) - 30,000 materials ...
Understanding a Dataset
You: What's in the OQMD band gaps dataset?
Claude: Let me get the schema for that dataset.
Uses get_dataset_schema tool
The OQMD Band Gaps dataset contains:
Inputs: composition (chemical formula), structure (crystal structure)
Splits: train (80%), test (20%)
You: Load the training data and show me some examples
Claude: I'll load the training split.
Uses load_dataset tool
Here are the first 5 rows:
Troubleshooting
Server Not Starting
Ensure Foundry is installed correctly:
Restart Claude Code after installing:
Authentication Issues
For datasets requiring authentication, ensure you've authenticated:
Technical Details
The MCP server uses JSON-RPC 2.0 over stdio.
Each tool follows the MCP tool schema: