Skip to content

Add CoolProp MCP tool - #1413

Closed
tamohannes wants to merge 9 commits into
NVIDIA-NeMo:mainfrom
tamohannes:feat/coolprop-mcp-tool
Closed

tamohannes wants to merge 9 commits into
NVIDIA-NeMo:mainfrom
tamohannes:feat/coolprop-mcp-tool

Conversation

@tamohannes

@tamohannes tamohannes commented May 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a built-in CoolProp MCP tool for thermophysical fluid property lookup.
  • Document the new built-in tool in the agentic inference tool-calling guide.
  • Add MCP client tests for tool configuration and stdio tool listing.

Test plan

  • python -m py_compile nemo_skills/mcp/servers/coolprop_tool.py
  • python -m pytest tests/test_mcp_clients.py::TestCoolPropTool -q --tb=short
  • python -m pytest tests/test_mcp_clients.py -q --tb=short

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added a CoolProp-backed tool to compute thermodynamic fluid properties and list available fluids (requires external CoolProp).
  • Documentation

    • Added a reference entry for the new CoolProp tool and noted the external dependency.
  • Tests

    • Added tests validating the tool’s configuration, discovery of offered operations, and proper shutdown cleanup.
  • Chores

    • CI workflow refined: conditional registry auth/cache, retrying builds, install extra tooling, tighter test selection, and a fork-safe MCP test path.

@coderabbitai

coderabbitai Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a CoolProp-backed MCP server and MCP client tool (CoolPropTool) exposing fluid-property and fluid-list tools, updates docs, adds tests for the client, and makes CI workflow conditional around GHCR and test execution.

Changes

Cohort / File(s) Summary
Documentation
docs/agentic_inference/tool_calling.md
Added reference entry for the new CoolPropTool built-in MCP tool and noted the external CoolProp dependency.
CoolProp MCP Server & Client
nemo_skills/mcp/servers/coolprop_tool.py
New FastMCP server registering fluid-property (validates temperature/pressure, calls CoolProp.CoolProp.PropsSI, formats result) and fluid-list (enumerates fluids). Adds CoolPropTool client class using MCPStdioClient and main() entrypoint for stdio transport.
Tests
tests/test_mcp_clients.py
Added tests asserting CoolPropTool config uses MCPStdioClient with the expected server module arg, that configure() works, list_tools() returns fluid-property and fluid-list, and that shutdown() is invoked in cleanup.
CI workflow
.github/workflows/tests.yml
Made GHCR login conditional on secrets.GHCR_PAT, conditionalized Buildx cache usage, installs .[dev,tools], updated pytest marker filter to exclude gpu and live, and added a fork-safe MCP-only test step when GHCR PAT is absent.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant MCPClient as MCPStdioClient
    participant MCPServer as coolprop_tool (FastMCP)
    participant CoolProp as CoolProp lib

    Client->>MCPClient: request "fluid-property"(fluid, prop, T, P)
    MCPClient->>MCPServer: forward request via stdio
    MCPServer->>CoolProp: PropsSI(prop, "T", T, "P", P, fluid)
    CoolProp-->>MCPServer: value or ValueError
    MCPServer-->>MCPClient: formatted result or error string
    MCPClient-->>Client: deliver response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the pull request: adding a CoolProp MCP tool. This is the primary change across the changeset, which includes the new tool implementation, documentation, tests, and CI updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/test_mcp_clients.py (1)

1015-1017: ⚡ Quick win

Strengthen config assertions to detect malformed stdio args earlier.

The current containment check can still pass with partially wrong args. Assert exact command and full args list for stricter regression detection.

Proposed test tightening
         tool = CoolPropTool()
         assert tool._config["client"] == "nemo_skills.mcp.clients.MCPStdioClient"
-        assert "nemo_skills.mcp.servers.coolprop_tool" in tool._config["client_params"]["args"]
+        assert tool._config["client_params"]["command"] == "python"
+        assert tool._config["client_params"]["args"] == ["-m", "nemo_skills.mcp.servers.coolprop_tool"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_mcp_clients.py` around lines 1015 - 1017, The test currently only
checks containment and may miss malformed stdio args; update the assertions on
tool._config in tests/test_mcp_clients.py to assert exact values: check
tool._config["client"] equals "nemo_skills.mcp.clients.MCPStdioClient", then
assert the stdio command and entire args list match the expected values by
asserting equality on tool._config["client_params"]["args"] (or the specific
args element's "command" and its full "args" list) instead of using an "in"
containment check so any partial/malformed argument lists fail the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/test_mcp_clients.py`:
- Around line 1015-1017: The test currently only checks containment and may miss
malformed stdio args; update the assertions on tool._config in
tests/test_mcp_clients.py to assert exact values: check tool._config["client"]
equals "nemo_skills.mcp.clients.MCPStdioClient", then assert the stdio command
and entire args list match the expected values by asserting equality on
tool._config["client_params"]["args"] (or the specific args element's "command"
and its full "args" list) instead of using an "in" containment check so any
partial/malformed argument lists fail the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 087dda25-a381-4396-8dfb-c3f9df379549

📥 Commits

Reviewing files that changed from the base of the PR and between 7dcb0a6 and 94b6273.

📒 Files selected for processing (3)
  • docs/agentic_inference/tool_calling.md
  • nemo_skills/mcp/servers/coolprop_tool.py
  • tests/test_mcp_clients.py

@gwarmstrong gwarmstrong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tamohannes , Thank you for the contributions! I would encourage you to please switch to a tool path that avoids the MCP protocol (we have found it to cause real latency and stability issues during RL) in favor of a direct tool approach. The changes should be fairly minimal--please see the DirectPythonTool for an example.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/tests.yml (1)

26-32: ⚠️ Potential issue | 🟠 Major

Fix the GHCR login gate to use an allowed context.

The secrets context is not permitted in a step-level if: expression and will cause workflow validation to fail. Move GHCR_PAT to a job-level env variable and check env.GHCR_PAT instead.

Suggested adjustment
 jobs:
   unit-tests:
     runs-on: ubuntu-latest
+    env:
+      GHCR_PAT: ${{ secrets.GHCR_PAT }}
     steps:
     - name: Login to GHCR
-      if: ${{ secrets.GHCR_PAT != '' }}
+      if: ${{ env.GHCR_PAT != '' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml around lines 26 - 32, The step "Login to GHCR"
uses a step-level if: with secrets.GHCR_PAT which is disallowed; move GHCR_PAT
into the job-level env (e.g., add GHCR_PAT: ${{ secrets.GHCR_PAT }} under the
job's env) and change the step-level conditional to check env.GHCR_PAT (if:
env.GHCR_PAT != '') so the docker/login-action@v3 step uses the job env variable
for password instead of referencing secrets in the if expression.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/tests.yml:
- Around line 26-32: The step "Login to GHCR" uses a step-level if: with
secrets.GHCR_PAT which is disallowed; move GHCR_PAT into the job-level env
(e.g., add GHCR_PAT: ${{ secrets.GHCR_PAT }} under the job's env) and change the
step-level conditional to check env.GHCR_PAT (if: env.GHCR_PAT != '') so the
docker/login-action@v3 step uses the job env variable for password instead of
referencing secrets in the if expression.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6974ea74-dc87-4128-a5e3-3134d9177b32

📥 Commits

Reviewing files that changed from the base of the PR and between 94b6273 and c061745.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

Signed-off-by: tamohannes <[email protected]>
@tamohannes
tamohannes force-pushed the feat/coolprop-mcp-tool branch from c061745 to fa9a06d Compare May 1, 2026 19:03
@tamohannes

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/tests.yml (1)

26-32: ⚠️ Potential issue | 🟠 Major

Use a valid context in the GHCR guard.

Line 27 uses secrets inside a step-level if condition, which GitHub Actions rejects with "Unrecognized named-value: 'secrets'". Move GHCR_PAT to a job-level env and gate the login step on env.GHCR_PAT instead.

Suggested fix
 jobs:
   unit-tests:
     runs-on: ubuntu-latest
+    env:
+      GHCR_PAT: ${{ secrets.GHCR_PAT }}
     steps:
@@
     - name: Login to GHCR
-      if: ${{ secrets.GHCR_PAT != '' }}
+      if: ${{ env.GHCR_PAT != '' }}
       uses: docker/login-action@v3
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml around lines 26 - 32, The step "Login to GHCR"
uses a step-level if referencing secrets (causing "Unrecognized named-value:
'secrets'"); move GHCR_PAT into the job-level env (e.g., add GHCR_PAT: ${{
secrets.GHCR_PAT }} under the job's env) and change the step guard to check
env.GHCR_PAT (if: env.GHCR_PAT != '') and update the docker/login-action step to
use the env variable for password (password: ${{ env.GHCR_PAT }}), leaving
registry and username as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/tests.yml:
- Around line 26-32: The step "Login to GHCR" uses a step-level if referencing
secrets (causing "Unrecognized named-value: 'secrets'"); move GHCR_PAT into the
job-level env (e.g., add GHCR_PAT: ${{ secrets.GHCR_PAT }} under the job's env)
and change the step guard to check env.GHCR_PAT (if: env.GHCR_PAT != '') and
update the docker/login-action step to use the env variable for password
(password: ${{ env.GHCR_PAT }}), leaving registry and username as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ea8c2e5c-1f73-494f-9150-b42c124300b4

📥 Commits

Reviewing files that changed from the base of the PR and between c061745 and fa9a06d.

📒 Files selected for processing (4)
  • .github/workflows/tests.yml
  • docs/agentic_inference/tool_calling.md
  • nemo_skills/mcp/servers/coolprop_tool.py
  • tests/test_mcp_clients.py
✅ Files skipped from review due to trivial changes (1)
  • docs/agentic_inference/tool_calling.md

@tamohannes

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tamohannes

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tamohannes

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tamohannes

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tamohannes

Copy link
Copy Markdown
Collaborator Author

Updated this PR to use the direct \ path instead of launching a stdio MCP server. The PR diff is now limited to the tool implementation, docs reference, and focused tests; workflow/pyproject changes were removed. @coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@tamohannes Thanks for the update! I'll review the revised PR, which now focuses on the CoolProp tool implementation, the docs reference, and the targeted tests — with the workflow and pyproject changes removed.

[review]

@tamohannes

Copy link
Copy Markdown
Collaborator Author

Updated this PR to use the direct Tool path instead of launching a stdio MCP server. The PR diff is now limited to the tool implementation, docs reference, and focused tests; workflow/pyproject changes were removed. @coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@tamohannes Thanks for the update! I'll kick off a fresh review of the revised PR, which now focuses on:

  • The direct CoolPropTool implementation (no stdio MCP server launch)
  • The docs reference update
  • The targeted tests

[review]

@tamohannes

Copy link
Copy Markdown
Collaborator Author

Updated to the direct Tool implementation path (no stdio MCP server/client). The final diff is scoped to the tool file, docs reference, and focused tests only. @coderabbitai review

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@tamohannes Thanks for the update! I'll kick off a fresh review of the revised PR, which is now scoped to:

  • The direct CoolPropTool implementation (no stdio MCP server/client)
  • The docs reference update
  • The focused tests

[review]

@tamohannes

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #1420, reopened from an internal NVIDIA-NeMo/Skills branch so CI can access repository secrets.

@tamohannes tamohannes closed this May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants