Skip to main content
Glama
ibtisamkhan96

materials-project-mcp-from-scratch

Materials Project MCP, from scratch

A small, heavily commented build of a Materials Project MCP server, made to understand how MCP actually works rather than to replace the official one. You go from a bare Materials Project API call, to the same call wrapped as an MCP tool, to an agent that discovers and calls those tools on its own.

If you just want to use Materials Project from an AI client in real work, use the official server (it ships in the mp_api client, v0.46+, with ~23 tools). This repo is for learning the mechanics from the inside.

What is here

  • mp_mcp_from_scratch.ipynb — the annotated, teach-along notebook. Every cell is explained: the bare API call, the FastMCP server, the low-level MCP client (including the auto-generated tool schema), and an agent driving the tools.

  • mp_mcp_server.py — the standalone MCP server the notebook writes, four real tools over the live Materials Project API:

    • search_system(chemsys) — search a chemical system (e.g. "Li-Fe-O")

    • get_summary(material_id) — full property summary for an mp-id

    • find_semiconductors(min_gap, max_gap) — stable materials in a band-gap window

    • get_structure(material_id) — key crystal-structure facts

Related MCP server: MOF Tools MCP Server

Run it

pip install -r requirements.txt
export MP_API_KEY=...        # free key from materialsproject.org

Then either open the notebook (select a Python that has mp-api), or run the server standalone:

python mp_mcp_server.py      # starts an MCP server on stdio; register it in an MCP client

The agent step in the notebook also uses a Groq key (free tier).

The point (in one line)

A tool is just a typed Python function; MCP is the standard envelope that makes it discoverable; the model does the tool selection. Once that clicks, every other server is the same recipe with different tools.

The wider MCP + Materials Project landscape

This was built alongside a survey of what already exists, all worth a look:

Thanks

Built while learning MCP with atomcamp's Agentic AI cohort. Full write-up on Materials Decoded.

About

Ibtisam Ahmed Khan, a materials engineer working in data and AI. materialsdecoded.com · GitHub · LinkedIn

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    -
    quality
    C
    maintenance
    The 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.
    13
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A specialized MCP server for Metal-Organic Framework research that provides tools for database searching, structural optimization, and energy calculations via ASE. It enables scientific workflows by allowing users to interact with MOF data and perform chemical simulations through a standard SSE interface.
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    An MCP server for deconstructing and analyzing Metal-Organic Framework (MOF) structures, including SBU and ligand identification, guest removal, and COF stacking analysis. It enables AI agents to perform automated chemical informatics and structural characterization on crystal structures via CIF files.
    1
  • F
    license
    -
    quality
    C
    maintenance
    A Model Context Protocol (MCP) server that provides programmatic access to Catalysis Hub's GraphQL API, enabling querying of catalytic reactions, material systems, publications, and surface reaction data.
    2

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/ibtisamkhan96/materials-project-mcp-from-scratch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server