Labsco
benedictdebrah logo

Materials Project MCP

โ˜… 10

from benedictdebrah

Query the Materials Project database using the mp_api client. Requires an MP_API_KEY environment variable.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Materials Project MCP

A Model Context Protocol (MCP) server for querying the Materials Project database using the mp_api client.

Testing & Development (developers)

Testing Your Installation

  1. Test MCP server locally:
    mcp dev server.py
    Look for the line "๐Ÿ”— Open inspector with token pre-filled:" and use that URL

Development Workflow

  1. Create a feature branch:

    git checkout -b feature-name
  2. 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
  3. Commit and push:

    git add .
    git commit -m "Add feature description"
    git push origin feature-name
  4. Open a pull request

Available Tools & Features

  • search_materials - Search by elements, band gap range, stability
  • get_structure_by_id - Get crystal structures and lattice parameters
  • get_electronic_bandstructure - Plot electronic band structures
  • get_electronic_dos_by_id - Get electronic density of states
  • get_phonon_bandstructure - Plot phonon band structures
  • get_phonon_dos_by_id - Get phonon density of states
  • get_ion_reference_data_for_chemsys - Download aqueous ion reference data for Pourbaix diagrams
  • get_cohesive_energy - Calculate cohesive energies
  • get_atom_reference_data - Retrieve reference energies of isolated neutral atoms
  • get_magnetic_data_by_id - Magnetic properties and ordering
  • get_charge_density_by_id - Charge density data
  • get_dielectric_data_by_id - Dielectric constants and properties
  • get_diffraction_patterns - X-ray and neutron diffraction
  • get_xRay_absorption_spectra - XAFS, XANES, EXAFS spectra
  • get_elastic_constants - Mechanical properties
  • get_suggested_substrates - Find substrates for thin films
  • get_thermo_stability - Thermodynamic stability analysis
  • get_surface_properties - Surface energies, work functions, and Wulff shapes
  • get_grain_boundaries - Computed grain boundaries for a material
  • get_insertion_electrodes - Insertion electrode and battery data
  • get_oxidation_states - Element oxidation states, formula, and structure info