docs: getting started notebook 7 - mcp client and server setup using NAT#1145
Conversation
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
WalkthroughAdds a new Jupyter notebook demonstrating end-to-end MCP client and server setup and integration with the NVIDIA NeMo Agent Toolkit, updates example READMEs to index the notebook, and clarifies transport configuration prose to mention both Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MCP_Server as MCP Server (NAT)
participant Transport as HTTP/SSE Transport
participant MCP_Client as MCP Client (mcp_client / mcp_tool_wrapper)
participant Workflow as NAT Workflow
rect rgb(235,243,255)
Note over MCP_Server,Transport: Server setup & publish
User->>MCP_Server: configure & start server
MCP_Server->>Transport: start/listen (HTTP or SSE)
MCP_Server->>MCP_Server: publish tools
end
rect rgb(235,255,235)
Note over MCP_Client,Transport: Client discovery
User->>MCP_Client: configure client (mcp_client or mcp_tool_wrapper)
MCP_Client->>Transport: connect & request tool list
Transport-->>MCP_Client: available tools
MCP_Client->>MCP_Client: auto-discover / wrap tools
end
rect rgb(255,245,240)
Note over Workflow,Transport: Execution flow
Workflow->>MCP_Client: invoke tool
MCP_Client->>Transport: send tool call
Transport->>MCP_Server: route call
MCP_Server-->>Transport: return result
Transport-->>Workflow: deliver result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/source/workflows/mcp/mcp-client.md(1 hunks)examples/README.md(1 hunks)examples/notebooks/7_mcp_setup_and_integration.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
{docs/source/**/*.md,**/README.@(md|ipynb)}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct
Files:
examples/notebooks/README.mddocs/source/workflows/mcp/mcp-client.mdexamples/README.md
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)
Files:
examples/notebooks/README.mddocs/source/workflows/mcp/mcp-client.mdexamples/notebooks/7_mcp_setup_and_integration.ipynbexamples/README.md
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/README.mddocs/source/workflows/mcp/mcp-client.mdexamples/notebooks/7_mcp_setup_and_integration.ipynbexamples/README.md
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/README.mdexamples/notebooks/7_mcp_setup_and_integration.ipynbexamples/README.md
docs/source/**/*.md
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed
Files:
docs/source/workflows/mcp/mcp-client.md
docs/source/**/*
⚙️ CodeRabbit configuration file
This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the
docs/source/_staticdirectory.
Files:
docs/source/workflows/mcp/mcp-client.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
🪛 Ruff (0.14.3)
examples/notebooks/7_mcp_setup_and_integration.ipynb
10-10: Undefined name install_example_code
(F821)
56-56: Shebang should contain python, pytest, or uv run
(EXE003)
56-56: Shebang is present but file is not executable
(EXE001)
56-56: Shebang should be at the beginning of the file
(EXE005)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: CI Pipeline / Check
🔇 Additional comments (1)
examples/notebooks/7_mcp_setup_and_integration.ipynb (1)
16-25: Remove “NAT” abbreviation and correct first-use naming.
Documentation must spell out “NVIDIA NeMo Agent toolkit” on first mention and must not introduce the “NAT” abbreviation anywhere. Please rewrite this introductory paragraph (and the rest of the notebook) to use the full product name initially and “NeMo Agent toolkit” thereafter, without adding “(NAT)”.⛔ Skipped due to learnings
Learnt from: CR Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-10-22T22:02:12.903Z Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)Learnt from: CR Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-10-22T22:02:12.903Z Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Never use “NAT”/“nat” abbreviations in documentationLearnt from: CR Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-10-22T22:02:12.903Z Learning: Applies to **/*.py : In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentationLearnt from: CR Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0 File: .cursor/rules/cursor-rules.mdc:0-0 Timestamp: 2025-08-22T20:18:28.041Z Learning: Applies to .cursor/rules/**/*.mdc : Use consistent project terminology in descriptions (e.g., NAT workflows, NAT CLI commands)Learnt from: saglave Repo: NVIDIA/NeMo-Agent-Toolkit PR: 726 File: examples/frameworks/adk_demo/src/nat_adk_demo/weather_update_tool.py:0-0 Timestamp: 2025-09-15T21:26:29.430Z Learning: In NAT's ADK integration, the docstring of registered functions serves as the tool description sent to the LLM, not standard Python function documentation. The docstring should describe the logical tool interface (parameters the LLM will provide) rather than the NAT framework wrapper parameters like tool_config and builder.
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 9
♻️ Duplicate comments (1)
examples/notebooks/7_mcp_setup_and_integration.ipynb (1)
1215-1221: Fix product name issues in conclusion.Remove the "NAT" abbreviation and correct the casing of "Toolkit" (capital T).
Based on learnings.
-MCP servers follow the MCP protocol, and therefore can be used by any MCP client, not only NAT MCP clients. As a follow-up exercise, try connecting an MCP server to your Agentic IDE like VS Code GitHub co-pilot, Cursor, Windsurf or Claude Code. +MCP servers follow the MCP protocol, and therefore can be used by any MCP client, not only NeMo Agent Toolkit clients. As a follow-up exercise, try connecting an MCP server to your Agentic IDE like VS Code GitHub Copilot, Cursor, Windsurf, or Claude Code. -Continue learning how to fully utilize the NVIDIA NeMo Agent toolkit by exploring the other documentation and advanced agents in the `examples` directory. +Continue learning how to fully utilize the NVIDIA NeMo Agent Toolkit by exploring the other documentation and advanced agents in the `examples` directory.Note: Also corrected "co-pilot" → "Copilot" (official capitalization) and added Oxford comma.
🧹 Nitpick comments (1)
examples/notebooks/7_mcp_setup_and_integration.ipynb (1)
960-970: Fix product name casing.Use "NeMo Agent Toolkit" (capital T) for consistency.
Based on learnings.
-Once an MCP server has been integrated with a NAT workflow, it is often useful to inspect the tools integrated from the client side to confirm that tool discovery worked as expected. +Once an MCP server has been integrated with a NeMo Agent Toolkit workflow, it is often useful to inspect the tools integrated from the client side to confirm that tool discovery worked as expected. -When you serve a workflow that includes an `mcp_client` function group, the NeMo Agent toolkit exposes an HTTP endpoint to inspect the tools configured on the client side and whether each tool is available on the connected server. We can inspect this workflow and as follows: +When you serve a workflow that includes an `mcp_client` function group, the NeMo Agent Toolkit exposes an HTTP endpoint to inspect the tools configured on the client side and whether each tool is available on the connected server. We can inspect this workflow as follows:Note: Also removed "and as follows" redundancy → "as follows".
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
examples/README.md(1 hunks)examples/notebooks/7_mcp_setup_and_integration.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- examples/notebooks/README.md
- examples/README.md
🧰 Additional context used
📓 Path-based instructions (3)
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
🧠 Learnings (5)
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-08-22T20:18:28.041Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/cursor-rules.mdc:0-0
Timestamp: 2025-08-22T20:18:28.041Z
Learning: Applies to .cursor/rules/**/*.mdc : Use consistent project terminology in descriptions (e.g., NAT workflows, NAT CLI commands)
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Never use “NAT”/“nat” abbreviations in documentation
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to **/*.py : In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
🪛 Ruff (0.14.3)
examples/notebooks/7_mcp_setup_and_integration.ipynb
10-10: Undefined name install_example_code
(F821)
56-56: Shebang should contain python, pytest, or uv run
(EXE003)
56-56: Shebang is present but file is not executable
(EXE001)
56-56: Shebang should be at the beginning of the file
(EXE005)
🔇 Additional comments (2)
examples/notebooks/7_mcp_setup_and_integration.ipynb (2)
214-234: Colab detection properly implemented.The previous issue with Colab environment detection has been correctly resolved. The
google.colabimport is now active, and the try/except/else structure properly handles both Colab and local environments.
546-553: Shell continuation properly fixed.The missing line continuation issue from the previous review has been resolved. All lines in this multi-line command now have proper trailing backslashes.
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (10)
examples/notebooks/7_mcp_setup_and_integration.ipynb (10)
1-10: Add required SPDX Apache-2.0 header.This notebook is missing the mandatory SPDX Apache-2.0 header with copyright year 2025. All source files, including Jupyter notebooks, must include this header.
Based on coding guidelines.
Add a markdown cell at the beginning with the Apache-2.0 license header. Reference other notebooks in the repository for the correct header template format.
16-24: Remove "NAT" abbreviation from documentation.The "NAT" abbreviation must not appear in documentation. Use "NVIDIA NeMo Agent Toolkit" on first mention, then "NeMo Agent toolkit" (lowercase t in body text) for subsequent references.
Based on learnings.
-In this notebook we will walk through client and server support for [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) in the NVIDIA NeMo Agent Toolkit (NAT). +In this notebook we will walk through client and server support for [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) in the NVIDIA NeMo Agent Toolkit. ... -Use NAT agents as an **MCP server** to publish tools using MCP to be used by any MCP client. -Use NAT agents as an **MCP client** to connect to and use tools served by remote MCP servers. +Use NeMo Agent toolkit agents as an **MCP server** to publish tools using MCP to be used by any MCP client. +Use NeMo Agent toolkit agents as an **MCP client** to connect to and use tools served by remote MCP servers.
126-152: Replace "NAT" with product name in installation section.Multiple instances of the "NAT" abbreviation appear in this section and must be replaced with "NeMo Agent toolkit".
Based on learnings.
-The recommended way to install NAT is through `pip` or `uv pip`. +The recommended way to install NeMo Agent toolkit is through `pip` or `uv pip`. ... -There are several optional subpackages available for NAT. For this example, we will rely on two subpackages: +There are several optional subpackages available for NeMo Agent toolkit. For this example, we will rely on two subpackages: ... -* The `nvidia-nat[mcp]` subpackage contains components for MCP clients and servers with NAT. +* The `nvidia-nat[mcp]` subpackage contains components for MCP clients and servers with NeMo Agent toolkit.
376-384: Remove "NAT" abbreviation from MCP server documentation.The section heading and prose use the prohibited "NAT" abbreviation.
Based on learnings.
-# 1.0) NAT as an MCP Server +# 1.0) NeMo Agent Toolkit as an MCP Server ... -Therefore, it's logical to start the tutorial of NAT support for MCP from the MCP server, where the new tools are hosted and called. +Therefore, it's logical to start the tutorial of NeMo Agent toolkit support for MCP from the MCP server, where the new tools are hosted and called. -The `nat mcp serve` command line utility can start an MCP server that publishes the functions from your workflow as MCP tools. In this section we are going to start up the `simple_calculator` server that we used to demonstrate the client-to-server connection in the first section, and dive deeper into hosting MCP servers with NAT. +The `nat mcp serve` command line utility can start an MCP server that publishes the functions from your workflow as MCP tools. In this section we are going to start up the `simple_calculator` server that we used to demonstrate the client-to-server connection in the first section, and dive deeper into hosting MCP servers with NeMo Agent toolkit.
790-797: Replace "NAT workflow" with full product name.Based on learnings.
-First we create a NAT workflow with the standard `nat workflow create` command line utility. +First we create a NeMo Agent toolkit workflow with the standard `nat workflow create` command line utility.
900-908: Remove "NAT" abbreviation from client documentation.Based on learnings.
-Use the `nat mcp client` commands to inspect and call tools available from an MCP server before running your workflow. This is useful for discovering available tools from one or more servers and understanding their input schemas before integration with NAT workflows. +Use the `nat mcp client` commands to inspect and call tools available from an MCP server before running your workflow. This is useful for discovering available tools from one or more servers and understanding their input schemas before integration with NeMo Agent Toolkit workflows.
1195-1208: Remove "NAT" abbreviation from summary section.Based on learnings.
-This section showed how to consume MCP servers by using NAT workflow command line utilities to deploy and manage MCP clients. With simple support for multiple transport types. +This section showed how to consume MCP servers by using NeMo Agent Toolkit workflow command line utilities to deploy and manage MCP clients, with simple support for multiple transport types. -NAT also supports [MCP Authentication](../../docs/source/workflows/mcp/mcp-auth.md). +NeMo Agent toolkit also supports [MCP Authentication](../../docs/source/workflows/mcp/mcp-auth.md).Note: Also fixed the sentence fragment in the first paragraph.
960-970: Replace "NAT workflow" in inspection section.Based on learnings.
-Once an MCP server has been integrated with a NAT workflow, it is often useful to inspect the tools integrated from the client side to confirm that tool discovery worked as expected. +Once an MCP server has been integrated with a NeMo Agent toolkit workflow, it is often useful to inspect the tools integrated from the client side to confirm that tool discovery worked as expected.
1215-1221: Remove "NAT" abbreviation from conclusion.Based on learnings.
-MCP servers follow the MCP protocol, and therefore can be used by any MCP client, not only NAT MCP clients. As a follow-up exercise, try connecting an MCP server to your Agentic IDE like VS Code GitHub co-pilot, Cursor, Windsurf or Claude Code. +MCP servers follow the MCP protocol, and therefore can be used by any MCP client, not only NeMo Agent toolkit clients. As a follow-up exercise, try connecting an MCP server to your Agentic IDE like VS Code GitHub co-pilot, Cursor, Windsurf or Claude Code.
689-698: Update MCP client section heading to remove "NAT" abbreviation.Based on learnings.
-# 2.0) NAT as an MCP client +# 2.0) NeMo Agent Toolkit as an MCP client -Using NAT to connect to MCP servers as a client is possible in two ways: +Using NeMo Agent toolkit to connect to MCP servers as a client is possible in two ways:
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
examples/notebooks/7_mcp_setup_and_integration.ipynb(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
🧠 Learnings (11)
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-08-22T20:18:28.041Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/cursor-rules.mdc:0-0
Timestamp: 2025-08-22T20:18:28.041Z
Learning: Applies to .cursor/rules/**/*.mdc : Use consistent project terminology in descriptions (e.g., NAT workflows, NAT CLI commands)
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {docs/source/**/*.md,**/README.@(md|ipynb)} : Never use “NAT”/“nat” abbreviations in documentation
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to **/*.py : In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-20T15:32:30.646Z
Learnt from: bbednarski9
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 1039
File: examples/notebooks/4_multi_agent_orchestration.ipynb:1046-1053
Timestamp: 2025-10-20T15:32:30.646Z
Learning: In Jupyter notebook files (.ipynb) within the examples/notebooks/ directory, Python code created via `%%writefile` commands does not require Apache-2.0 license headers. This is an exception to the general requirement that all Python files should contain Apache headers, because these are notebook demo examples.
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb} : All source files must include the SPDX Apache-2.0 header template (copy from an existing file)
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-10-22T22:02:12.903Z
Learnt from: CR
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-10-22T22:02:12.903Z
Learning: Applies to {**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb} : Every file must start with the standard SPDX Apache-2.0 header
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-09-15T21:26:29.430Z
Learnt from: saglave
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 726
File: examples/frameworks/adk_demo/src/nat_adk_demo/weather_update_tool.py:0-0
Timestamp: 2025-09-15T21:26:29.430Z
Learning: In NAT's ADK integration, the docstring of registered functions serves as the tool description sent to the LLM, not standard Python function documentation. The docstring should describe the logical tool interface (parameters the LLM will provide) rather than the NAT framework wrapper parameters like tool_config and builder.
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-08-22T20:29:13.433Z
Learnt from: AnuradhaKaruppiah
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 701
File: examples/evaluation_and_profiling/simple_calculator_eval/src/nat_simple_calculator_eval/configs/config-with-custom-post-process.yml:16-18
Timestamp: 2025-08-22T20:29:13.433Z
Learning: In the NeMo-Agent-Toolkit project, configuration consistency across example files is prioritized over removing unused config options, even when those options aren't currently implemented in the runtime.
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
📚 Learning: 2025-08-28T14:30:12.178Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Agent-Toolkit PR: 684
File: src/nat/data_models/function.py:39-45
Timestamp: 2025-08-28T14:30:12.178Z
Learning: In the NAT codebase, stricter validation of function names (like checking for empty/whitespace-only strings) in FunctionGroupBaseConfig.validate_expose is unnecessary because workflow parsing and validation already handle these validation concerns at a different layer in the system.
Applied to files:
examples/notebooks/7_mcp_setup_and_integration.ipynb
🪛 Ruff (0.14.3)
examples/notebooks/7_mcp_setup_and_integration.ipynb
10-10: Undefined name install_example_code
(F821)
56-56: Shebang should contain python, pytest, or uv run
(EXE003)
56-56: Shebang is present but file is not executable
(EXE001)
56-56: Shebang should be at the beginning of the file
(EXE005)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: CI Pipeline / Check
🔇 Additional comments (1)
examples/notebooks/7_mcp_setup_and_integration.ipynb (1)
214-369: LGTM - Utility function is well implemented.The
install_example_codefunction correctly handles both Colab and local environments. The Colab detection now uses proper try/except/else structure, and the function includes comprehensive error handling, clear user feedback, and supports multiple installation modes.
|
/merge |
Description
This PR brings in a net new getting started notebook for MCP client and server setup and deployment. The notebook supports being run both locally and on colab, and README.md for the examples have been updated accordingly
Closes
By Submitting this PR I confirm:
Summary by CodeRabbit
Documentation
New Features