Query the Materials Project database using the mp_api client. Requires an MP_API_KEY environment variable.
A Model Context Protocol (MCP) server for querying the Materials Project database using the mp_api client.
Install Docker Desktop:
Pull the Docker image:
docker pull benedict2002/materials-project-mcp
Test the installation:
docker run --rm -i -e MP_API_KEY="your-api-key" benedict2002/materials-project-mcp
Install Docker Desktop and make sure it's running
Clone the repository:
git clone <repository-url>
cd materials-project-mcp
Create a .env
file:
echo "MP_API_KEY=your-materials-project-api-key" > .env
Test the setup:
docker-compose up
For background running:
docker-compose up -d
Stop the service:
docker-compose down
Install uv (if not already installed):
curl -Ls https://astral.sh/uv/install.sh | sh
Clone the repository:
git clone <repository-url>
cd materials-project-mcp
Create and activate virtual environment:
uv venv
source .venv/bin/activate # Linux/macOS
# or
.venv\Scripts\activate # Windows
Install dependencies:
uv pip install -r requirements.txt
Set your API key:
export MP_API_KEY="your-api-key" # Linux/macOS
# or
set MP_API_KEY=your-api-key # Windows
Test the installation:
python server.py
Locate your Claude configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Choose your configuration method:
Using Docker Run
{
"mcpServers": {
"Materials Project MCP": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "MP_API_KEY=your-materials-project-api-key",
"benedict2002/materials-project-mcp"
]
}
}
}
Replace your-materials-project-api-key
with your actual API key
Ensure Docker Desktop is running
Restart Claude Desktop
Verify installation:
Open VS Code Settings:
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(macOS)Add MCP configuration:
{
"mcp": {
"inputs": [],
"servers": {
"Materials Project MCP": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "MP_API_KEY=your-api-key",
"benedict2002/materials-project-mcp"
]
}
}
},
"chat.mcp.discovery.enabled": true,
"workbench.secondarySideBar.showLabels": false
}
Alternative: Local Python setup for VS Code:
{
"mcp": {
"inputs": [],
"servers": {
"Materials Project MCP": {
"command": "/usr/local/bin/uv",
"args": [
"run",
"--with",
"mcp[cli],aiohttp,pydantic,mp_api,pymatgen,emmet-core",
"/path/to/your/server.py"
],
"env": {
"MP_API_KEY": "your-api-key"
}
}
}
},
"chat.mcp.discovery.enabled": true
}
Replace placeholders:
your-api-key
with your Materials Project API key/path/to/your/server.py
with the actual path to server.pyEnsure Docker Desktop is running (for Docker configurations)
Restart VS Code
Test in VS Code:
mcp dev server.py
Look for the line "🔗 Open inspector with token pre-filled:" and use that URLCreate a feature branch:
git checkout -b feature-name
Make your changes and test:
# Local testing with MCP Inspector
mcp dev server.py
# Use the inspector URL to test your changes interactively
# Docker testing
docker build -t materials-project-mcp-local .
docker run --rm -i -e MP_API_KEY="your-api-key" materials-project-mcp-local
# Docker Compose testing
docker-compose up --build
Commit and push:
git add .
git commit -m "Add feature description"
git push origin feature-name
Open a pull request
"Invalid API key" error:
"Docker not found" or "Cannot connect to Docker daemon":
docker --version
to verify Docker is accessiblesudo systemctl start docker
Container startup issues:
Docker Compose issues:
docker-compose --version
.env
file exists and has the correct API keyMCP server not recognized in Claude:
mcp dev server.py
for interactive testing and debugging.Yin, Xiangyu. 2025. "Building an MCP Server for the Materials Project." March 23, 2025. https://xiangyu-yin.com/content/post_mp_mcp.html.
Allows Claude AI to interact directly with MySQL databases.
Interact with the microCMS headless CMS API, enabling AI assistants to manage content.
Open source MCP server specializing in easy, fast, and secure tools for Databases.
An MCP server for Firebird SQL databases, enabling LLMs to securely access, analyze, and manipulate database content.
Provides AI assistants with a secure and structured way to explore and analyze data in GreptimeDB.
An MCP server for querying data from the Kollect tool's API endpoints, such as /api/data, /api/snapshots, and /api/costs.
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
Immutable ledger database with live synchronization
Perform database actions on Amazon Redshift via its Data API.
A lightweight server to connect AI assistants with Kintone applications and data.