OPTIMADE MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add optimade-mcp-server -- uvx optimade-mcp-server
README.md

Query OPTIMADE-compatible material databases via the Model Context Protocol

OPTIMADE MCP SERVER

A Model Context Protocol (MCP) tool for querying Optimade-compatible material databases, fully configurable custom filter presets and provider endpoints.


🎯 Overview

This tool enables structured data queries across multiple OPTIMADE databases (e.g., Materials Project, Materials Cloud, COD), via MCP protocol. Key capabilities include:

1..Easily deployable via uvx, cline

2.It is possible to interact with the client in natural language, enabling the large language model to generate the OPTIMADE query filter.

3.The JSON returned by OPTIMADE will be saved locally, and a summary will be generated during the interaction.

Note: The query requires two parameters. One is the optimade query filter, and the other is the database to be queried.


✨ Features

  • MCP Resources the model can read on demand:
    • optimade://docs/filters – Filter grammar & examples (Markdown)
    • optimade://spec/queryable_propsWhitelist of fields marked “Query: MUST be a queryable property …” (JSON)
    • optimade://docs/providers – Default provider URLs (JSON, generated from config)
    • optimade://docs/filter_presets – Named filter snippets (JSON)
    • optimade://prompts/ask_for_provider – System prompt to guide URL selection & linting (Text)
    • optimade://results/<uuid>Dynamic: full JSON of past queries
  • Tools
    • lint_filter(filter)"ok" / "warn: …" / "syntax error: …"
      (Warn = not in whitelist but allowed; Syntax error = blocked)
    • query_optimade(filter, baseUrls?) → preview (first 5) + link to full JSON resource
    • list_providers() → Discover global public OPTIMADE endpoints
  • Provider fallback
    1. user-provided baseUrls → 2) config defaults → 3) fallback single mirror (https://optimade.fly.dev)
  • Proxy-ready via .env (HTTP_PROXY, HTTPS_PROXY).

🧩 What the LLM can read (Resources)

URI Type Purpose
optimade://docs/filters text/markdown Full grammar & examples
optimade://spec/queryable_props application/json Whitelist: fields marked “MUST be queryable”
optimade://docs/providers application/json Default provider URLs from config
optimade://docs/filter_presets application/json Named filter snippets for inspiration
optimade://prompts/ask_for_provider text/plain System prompt to guide URL choice & linting
optimade://results/<uuid> application/json Dynamic: full JSON from previous queries

Important: Resources are not auto-injected. Your MCP client must call resources/read (or you configure startup/workflow to read them).


⚙️ Installation & Usage

✅ Recommended via uv

1.Install the tool:

uv pip install optimade-mcp-server

2.In cline or any MCP-compatible launcher, configure the tool as follows:

{
  "mcpServers": {
    "optimade_mcp_server": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "uvx",
      "args": [
        "optimade-mcp-server"
      ]
    }
  }
}

🌐 Proxy Support (Optional)

If you need to use a VPN or proxy, create a .env file in the project root:

HTTP_PROXY=http://127.0.0.1:<your-port>
HTTPS_PROXY=http://127.0.0.1:<your-port>

If you don't need a proxy, you can comment out or remove the proxy setup in the source code.


🪪 License

This project is licensed under the MIT License. See LICENSE for details.


🙋 FAQ

Q: Are resources auto‑injected into the model’s context?
A: No. The client must call resources/read (or configure a startup/workflow step). The server does apply provider fallback automatically if baseUrls are omitted.

Q: Can I use non‑whitelisted fields?
A: Yes. lint_filter returns warn: band_gap. The model should show a warning and ask you to confirm before querying.

Q: How do I export the full result?
A: The server always saves a full JSON under optimade://results/<uuid>.

Tools (3)

lint_filterValidates an OPTIMADE query filter for syntax errors or non-whitelisted properties.
query_optimadeExecutes a query against OPTIMADE databases and returns a preview of results.
list_providersDiscovers global public OPTIMADE database endpoints.

Environment Variables

HTTP_PROXYProxy URL for HTTP requests
HTTPS_PROXYProxy URL for HTTPS requests

Configuration

claude_desktop_config.json
{"mcpServers": {"optimade_mcp_server": {"disabled": false, "timeout": 60, "type": "stdio", "command": "uvx", "args": ["optimade-mcp-server"]}}}

Try it

List all available OPTIMADE database providers.
Check if the filter 'nelements > 3' is valid for querying material databases.
Find materials with a band gap greater than 2.0 eV using the Materials Project database.
Read the filter grammar documentation to help me construct a complex query.
Retrieve the full JSON results for my last material query.

Frequently Asked Questions

What are the key features of OPTIMADE MCP Server?

Natural language query generation for OPTIMADE databases. Built-in filter linting and validation against property whitelists. Access to structured documentation and filter presets as MCP resources. Automatic provider fallback and discovery. Local caching of full query results for later inspection.

What can I use OPTIMADE MCP Server for?

Researchers querying material properties across multiple databases like Materials Project or COD. Automating the discovery of material data using natural language prompts. Validating complex material search filters before executing expensive queries. Integrating material science data retrieval directly into LLM-based research workflows.

How do I install OPTIMADE MCP Server?

Install OPTIMADE MCP Server by running: uv pip install optimade-mcp-server

What MCP clients work with OPTIMADE MCP Server?

OPTIMADE MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep OPTIMADE MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare