Repository navigation
Add CoolProp MCP tool - #1413
tamohannes wants to merge 9 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a CoolProp-backed MCP server and MCP client tool (CoolPropTool) exposing Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_mcp_clients.py (1)
1015-1017: ⚡ Quick winStrengthen config assertions to detect malformed stdio args earlier.
The current containment check can still pass with partially wrong args. Assert exact
commandand fullargslist 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
📒 Files selected for processing (3)
docs/agentic_inference/tool_calling.mdnemo_skills/mcp/servers/coolprop_tool.pytests/test_mcp_clients.py
gwarmstrong
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | 🟠 MajorFix the GHCR login gate to use an allowed context.
The
secretscontext is not permitted in a step-levelif:expression and will cause workflow validation to fail. MoveGHCR_PATto a job-levelenvvariable and checkenv.GHCR_PATinstead.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
📒 Files selected for processing (1)
.github/workflows/tests.yml
Signed-off-by: tamohannes <[email protected]>
c061745 to
fa9a06d
Compare
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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 | 🟠 MajorUse a valid context in the GHCR guard.
Line 27 uses
secretsinside a step-levelifcondition, which GitHub Actions rejects with "Unrecognized named-value: 'secrets'". MoveGHCR_PATto a job-levelenvand gate the login step onenv.GHCR_PATinstead.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
📒 Files selected for processing (4)
.github/workflows/tests.ymldocs/agentic_inference/tool_calling.mdnemo_skills/mcp/servers/coolprop_tool.pytests/test_mcp_clients.py
✅ Files skipped from review due to trivial changes (1)
- docs/agentic_inference/tool_calling.md
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Signed-off-by: tamohannes <[email protected]>
|
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 |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
|
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 |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
Signed-off-by: tamohannes <[email protected]>
|
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 |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
…tool Signed-off-by: tamohannes <[email protected]>
|
Closing in favor of #1420, reopened from an internal NVIDIA-NeMo/Skills branch so CI can access repository secrets. |
Summary
Test plan
Made with Cursor
Summary by CodeRabbit
New Features
Documentation
Tests
Chores