PyThermoCalcDB-NASA-MCP

PyThermoCalcDB-NASA-MCP

Enables thermodynamic property calculations (H, S, G, Cp, reaction equilibrium) using NASA-9 polynomial data through natural language or MCP-compatible clients.

Category
访问服务器

README

🧪 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.

📦 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选