Skip to main content
Glama
PyThermoCalcDB-NASA-MCP

PyThermoCalcDB-NASA-MCP

by sinagilassi

๐Ÿงช PyThermoCalcDB-NASA-MCP

PyPI Downloads PyPI Python Version License MCP

PyThermoCalcDB-NASA-MCP is a Model Context Protocol server for running selected pythermocalcdb-nasa thermodynamic calculations from agents and MCP-compatible clients.

๐ŸŒ Overview

The MCP package is an interface and orchestration layer. It validates structured requests, builds a ModelSource, calls deterministic pythermocalcdb-nasa functions, and returns JSON-safe results. It does not implement the scientific calculation itself.

The default source workflow uses the embedded NASA-9 SQLite database included by pythermocalcdb-nasa. If a component is unavailable locally, the MCP server returns a structured failure. External data search is not this MCP server's responsibility; another agent or caller should prepare complete pyThermoDB REFERENCE content and call the tool with source: "reference".

Use this package to:

  • Calculate H_T, S_T, G_T, and Cp_T for one component.

  • Calculate dH_rxn_STD, dS_rxn_STD, dG_rxn_STD, Keq, and Keq_vh_shortcut for reactions.

  • Validate externally prepared pyThermoDB YAML reference content.

Related MCP server: MoziChem-Hub MCP Server

๐Ÿ“ฆ Installation

pip install pythermocalcdb-nasa-mcp

For local development:

uv sync

โ–ถ๏ธ Running

STDIO is the default transport:

pythermocalcdb-nasa-mcp --mode stdio

HTTP transport is also supported:

pythermocalcdb-nasa-mcp --mode http --host 127.0.0.1 --port 8000 --path /mcp

From a local checkout:

uv run pythermocalcdb-nasa-mcp --mode stdio

๐Ÿ”Œ MCP Client Configuration

๐Ÿงต STDIO:

{
  "mcpServers": {
    "pythermocalcdb-nasa": {
      "command": "pythermocalcdb-nasa-mcp",
      "args": ["--mode", "stdio"]
    }
  }
}

๐ŸŒ HTTP:

{
  "mcpServers": {
    "pythermocalcdb-nasa": {
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

๐Ÿ•ต๏ธ MCP Inspector

You can test the server with the official MCP Inspector.

For direct STDIO testing from a local checkout:

npx @modelcontextprotocol/inspector uv run pythermocalcdb-nasa-mcp --mode stdio

For HTTP testing, start the server first:

uv run pythermocalcdb-nasa-mcp --mode http --host 127.0.0.1 --port 8000 --path /mcp

Then connect Inspector to:

http://127.0.0.1:8000/mcp

๐Ÿ“š MCP Resources

  • pythermocalcdb-nasa://references/nasa-requirements

    • Source policy, NASA symbols, units, temperature ranges, and agent boundaries.

  • pythermocalcdb-nasa://workflows/species-properties

    • Workflow for H_T, S_T, G_T, and Cp_T.

  • pythermocalcdb-nasa://workflows/reaction-properties

    • Workflow for dH_rxn_STD, dS_rxn_STD, dG_rxn_STD, Keq, and Keq_vh_shortcut.

  • pythermocalcdb-nasa://guidance/agent-checklist

    • Checklist for reliable database-first and reference-backed calls.

๐Ÿงฐ MCP Tools

๐Ÿ”ฅ Species tools:

  • calc_H_T

  • calc_S_T

  • calc_G_T

  • calc_Cp_T

โš—๏ธ Reaction tools:

  • calc_dH_rxn_STD

  • calc_dS_rxn_STD

  • calc_dG_rxn_STD

  • calc_Keq

  • calc_Keq_vh_shortcut

๐Ÿ› ๏ธ Utility tool:

  • check_yaml_reference

๐Ÿ“ Input Model Notes

Calculation tools receive one Pydantic argument named request. They use shared domain models from pythermodb_settings, including Component, Temperature, and ComponentKey.

๐Ÿ—„๏ธ Database-backed species request:

{
  "request": {
    "component": {
      "name": "carbon dioxide",
      "formula": "CO2",
      "state": "g"
    },
    "temperature": {
      "value": 300.0,
      "unit": "K"
    },
    "source": "database",
    "component_key": "Name-Formula",
    "nasa_type": "nasa9",
    "basis": "molar"
  }
}

๐Ÿ“„ Reference-backed species request:

{
  "request": {
    "component": {
      "name": "component name from prepared reference",
      "formula": "Formula",
      "state": "g"
    },
    "temperature": {
      "value": 300.0,
      "unit": "K"
    },
    "source": "reference",
    "reference_content": "REFERENCES:\n  ...",
    "component_key": "Name-Formula",
    "nasa_type": "nasa9",
    "basis": "molar"
  }
}

๐Ÿ—„๏ธ Database-backed reaction request:

{
  "request": {
    "name": "Water-Gas Shift Reaction",
    "reaction": "CO(g) + H2O(g) => CO2(g) + H2(g)",
    "components": [
      {"name": "carbon monoxide", "formula": "CO", "state": "g"},
      {"name": "dihydrogen monoxide", "formula": "H2O", "state": "g"},
      {"name": "carbon dioxide", "formula": "CO2", "state": "g"},
      {"name": "dihydrogen", "formula": "H2", "state": "g"}
    ],
    "temperature": {
      "value": 398.15,
      "unit": "K"
    },
    "source": "database",
    "component_key": "Name-Formula",
    "nasa_type": "nasa9"
  }
}

Use the same reaction request shape with calc_Keq_vh_shortcut when a van't Hoff shortcut estimate is requested. It returns a dimensionless equilibrium constant.

Responses follow this contract:

{
  "success": true,
  "message": "H_T completed successfully.",
  "results": {
    "operation": "H_T",
    "value": 0.0,
    "unit": "J/mol"
  },
  "analysis": {
    "source": "database"
  },
  "warnings": []
}

โœ… Best Practices

  • Use source: "database" first for NASA-9 data in supported g, l, and s phases.

  • Use source: "reference" only with complete externally prepared reference_content.

  • Do not ask this MCP server to search external scientific data.

  • Keep temperature inputs in Kelvin.

  • Make sure every reaction species appears in both the reaction equation and components.

  • Use nasa_type: "nasa9" with the database source.

  • Check success, message, and warnings before reporting results.

๐Ÿงช Development Quick Check

python -m py_compile pythermocalcdb_nasa_mcp/server.py
python -m py_compile pythermocalcdb_nasa_mcp/interface/core.py
python -m py_compile pythermocalcdb_nasa_mcp/models/nasa.py
python -m unittest discover tests

๐Ÿš€ Examples

Example payload shapes are available in examples/request_payloads.py.

๐Ÿ“„ License

This project is licensed under the Apache License 2.0. See LICENSE.

๐Ÿ‘ค Author

Available Tools

10 tools
calc_Cp_TC

Calculate component heat capacity Cp_T using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_dG_rxn_STDB

Calculate standard Gibbs free energy change of reaction using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_dH_rxn_STDA

Calculate standard enthalpy change of reaction using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_dS_rxn_STDB

Calculate standard entropy change of reaction using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_G_TA

Calculate component Gibbs free energy G_T using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_H_TC

Calculate component enthalpy H_T using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_KeqB

Calculate reaction equilibrium constant Keq using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_Keq_vh_shortcutB

Calculate reaction equilibrium constant Keq_vh_shortcut using the van't Hoff shortcut and the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

calc_S_TA

Calculate component entropy S_T using the embedded NASA-9 database by default, or caller-supplied reference_content when source='reference'.

Inputs: request (required). Returns: object

check_yaml_referenceB

Validate pythermodb YAML reference content for use with pyThermoDB.

Inputs: yaml_content (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct thermodynamic quantity (H, S, G, Cp, reaction changes, Keq), with clear naming and no overlap. The 'calc_' prefix immediately distinguishes calculation tools from the validation tool, and the specific property is uniquely identified in each name.

    Naming Consistency5/5

    All calculation tools follow a perfect 'calc_[property]' pattern, with consistent underscore separation and standard thermodynamic abbreviations (H_T, S_T, G_T, Cp_T, dH_rxn_STD, etc.). The one validation tool uses 'check_' instead of 'calc_', which is appropriate and maintains the pattern.

    Tool Count5/5

    10 tools is ideal for a thermodynamics calculation server. It covers the essential single-component properties, reaction thermodynamics, and equilibrium without being bloated. Each tool serves a distinct and necessary purpose, earning its place.

    Completeness5/5

    The tool set comprehensively covers NASA-9 polynomial applications: all four fundamental thermodynamic functions (H, S, G, Cp) for single components, their reaction analogues (dH, dS, dG), plus equilibrium constants. The inclusion of check_yaml_reference and calc_Keq_vh_shortcut shows thoughtful coverage for both standard and practical calculations. No obvious gaps exist for the stated domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers