nvidia-nat-mcp 1.4.0a20260107__py3-none-any.whl → 1.4.0a20260128__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nat/plugins/mcp/cli/commands.py +9 -5
- nat/plugins/mcp/server/front_end_plugin_worker.py +5 -1
- nat/plugins/mcp/server/tool_converter.py +8 -4
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/METADATA +3 -3
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/RECORD +10 -10
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/WHEEL +1 -1
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/entry_points.txt +0 -0
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/top_level.txt +0 -0
nat/plugins/mcp/cli/commands.py
CHANGED
|
@@ -24,6 +24,7 @@ from typing import cast
|
|
|
24
24
|
import click
|
|
25
25
|
from pydantic import BaseModel
|
|
26
26
|
|
|
27
|
+
from nat.builder.function import FunctionGroup
|
|
27
28
|
from nat.cli.commands.start import start_command
|
|
28
29
|
|
|
29
30
|
logger = logging.getLogger(__name__)
|
|
@@ -310,8 +311,9 @@ async def list_tools_via_function_group(
|
|
|
310
311
|
fns = await group.get_accessible_functions()
|
|
311
312
|
|
|
312
313
|
def to_tool_entry(full_name: str, fn_obj) -> dict[str, str | None]:
|
|
313
|
-
# full_name like "
|
|
314
|
-
|
|
314
|
+
# full_name like "mcp_client__<tool>"
|
|
315
|
+
sep = FunctionGroup.SEPARATOR
|
|
316
|
+
name = full_name.split(sep, 1)[1] if sep in full_name else full_name
|
|
315
317
|
schema = getattr(fn_obj, 'input_schema', None)
|
|
316
318
|
if schema is None:
|
|
317
319
|
schema_str = None
|
|
@@ -327,10 +329,12 @@ async def list_tools_via_function_group(
|
|
|
327
329
|
return {"name": name, "description": getattr(fn_obj, 'description', ''), "input_schema": schema_str}
|
|
328
330
|
|
|
329
331
|
if tool_name:
|
|
330
|
-
full = f"mcp_client.{tool_name}"
|
|
332
|
+
full = f"mcp_client{FunctionGroup.SEPARATOR}{tool_name}"
|
|
331
333
|
fn = fns.get(full)
|
|
332
334
|
if fn is not None:
|
|
333
335
|
tools.append(to_tool_entry(full, fn))
|
|
336
|
+
else:
|
|
337
|
+
logger.debug(f"Tool '{tool_name}' not found. Available: {list(fns.keys())}")
|
|
334
338
|
else:
|
|
335
339
|
for full, fn in fns.items():
|
|
336
340
|
tools.append(to_tool_entry(full, fn))
|
|
@@ -908,10 +912,10 @@ async def call_tool_and_print(command: str | None,
|
|
|
908
912
|
|
|
909
913
|
group = await builder.add_function_group("mcp_client", group_cfg)
|
|
910
914
|
fns = await group.get_accessible_functions()
|
|
911
|
-
full = f"mcp_client.{tool_name}"
|
|
915
|
+
full = f"mcp_client{FunctionGroup.SEPARATOR}{tool_name}"
|
|
912
916
|
fn = fns.get(full)
|
|
913
917
|
if fn is None:
|
|
914
|
-
raise RuntimeError(f"Tool '{tool_name}' not found")
|
|
918
|
+
raise RuntimeError(f"Tool '{tool_name}' not found. Available: {list(fns.keys())}")
|
|
915
919
|
# The group exposes a Function that we can invoke with kwargs
|
|
916
920
|
result = await fn.acall_invoke(**(tool_args or {}))
|
|
917
921
|
# Ensure string output for terminal
|
|
@@ -184,7 +184,11 @@ class MCPFrontEndPluginWorkerBase(ABC):
|
|
|
184
184
|
|
|
185
185
|
# Register each function with MCP, passing SessionManager for observability
|
|
186
186
|
for function_name, session_manager in session_managers.items():
|
|
187
|
-
register_function_with_mcp(mcp,
|
|
187
|
+
register_function_with_mcp(mcp,
|
|
188
|
+
function_name,
|
|
189
|
+
session_manager,
|
|
190
|
+
self.memory_profiler,
|
|
191
|
+
function=functions.get(function_name))
|
|
188
192
|
|
|
189
193
|
# Add a simple fallback function if no functions were found
|
|
190
194
|
if not session_managers:
|
|
@@ -257,7 +257,8 @@ def get_function_description(function: FunctionBase) -> str:
|
|
|
257
257
|
def register_function_with_mcp(mcp: FastMCP,
|
|
258
258
|
function_name: str,
|
|
259
259
|
session_manager: 'SessionManager',
|
|
260
|
-
memory_profiler: 'MemoryProfiler | None' = None
|
|
260
|
+
memory_profiler: 'MemoryProfiler | None' = None,
|
|
261
|
+
function: FunctionBase | None = None) -> None:
|
|
261
262
|
"""Register a NAT Function as an MCP tool using SessionManager.
|
|
262
263
|
|
|
263
264
|
Each function is wrapped in a SessionManager
|
|
@@ -274,12 +275,15 @@ def register_function_with_mcp(mcp: FastMCP,
|
|
|
274
275
|
# Get the workflow from the session manager
|
|
275
276
|
workflow = session_manager.workflow
|
|
276
277
|
|
|
277
|
-
#
|
|
278
|
-
|
|
278
|
+
# Prefer the function's schema/description when available, fall back to workflow
|
|
279
|
+
target_function = function or workflow
|
|
280
|
+
|
|
281
|
+
# Get the input schema from the most specific object available
|
|
282
|
+
input_schema = getattr(target_function, "input_schema", workflow.input_schema)
|
|
279
283
|
logger.info("Function %s has input schema: %s", function_name, input_schema)
|
|
280
284
|
|
|
281
285
|
# Get function description
|
|
282
|
-
function_description = get_function_description(
|
|
286
|
+
function_description = get_function_description(target_function)
|
|
283
287
|
|
|
284
288
|
# Create and register the wrapper function with MCP
|
|
285
289
|
wrapper_func = create_function_wrapper(function_name, session_manager, input_schema, memory_profiler)
|
{nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvidia-nat-mcp
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.0a20260128
|
|
4
4
|
Summary: Subpackage for MCP client integration in NeMo Agent toolkit
|
|
5
5
|
Author: NVIDIA Corporation
|
|
6
6
|
Maintainer: NVIDIA Corporation
|
|
@@ -16,8 +16,8 @@ Requires-Python: <3.14,>=3.11
|
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE-3rd-party.txt
|
|
18
18
|
License-File: LICENSE.md
|
|
19
|
-
Requires-Dist: nvidia-nat==v1.4.
|
|
20
|
-
Requires-Dist: aiorwlock~=1.5
|
|
19
|
+
Requires-Dist: nvidia-nat==v1.4.0a20260128
|
|
20
|
+
Requires-Dist: aiorwlock~=1.5
|
|
21
21
|
Requires-Dist: mcp~=1.25
|
|
22
22
|
Dynamic: license-file
|
|
23
23
|
|
|
@@ -15,7 +15,7 @@ nat/plugins/mcp/auth/service_account/provider.py,sha256=Gsb44cy-5Ap_1BcG3Ny9fc94
|
|
|
15
15
|
nat/plugins/mcp/auth/service_account/provider_config.py,sha256=rrzHAo1qmK1yI5CNaadNTVsmh5qtYF1UrYz2Q1nLF2E,5332
|
|
16
16
|
nat/plugins/mcp/auth/service_account/token_client.py,sha256=bGAjq_vG8oo8ZoQfRJjEgigGmF0hgF0umaUOWv0_ZOY,5986
|
|
17
17
|
nat/plugins/mcp/cli/__init__.py,sha256=GLpBQw8r1Nj38vIOluSHsTlLINI24tZ_JJbcWWksBJE,709
|
|
18
|
-
nat/plugins/mcp/cli/commands.py,sha256=
|
|
18
|
+
nat/plugins/mcp/cli/commands.py,sha256=1ukbLA9V3tMenFKJ5PksEnaPKuJkyITnH9SfuFr7sLE,46882
|
|
19
19
|
nat/plugins/mcp/client/__init__.py,sha256=SFdgClH-7zCAAcujmdvtfiqSz3Xe1KVRX7fviW-45Zg,714
|
|
20
20
|
nat/plugins/mcp/client/client_base.py,sha256=jWNwb20qWIUuIJg7Ldp_WgiJlQmYin4YvVSJ9_ECP5c,26831
|
|
21
21
|
nat/plugins/mcp/client/client_config.py,sha256=qrBjXCKHpMoS2A5i9DoXkN7hdYnGy77FBcZDGZlyb4w,7179
|
|
@@ -23,15 +23,15 @@ nat/plugins/mcp/client/client_impl.py,sha256=dygcLnhnWnMh7u45aLvYbGEP1uv02uSb886
|
|
|
23
23
|
nat/plugins/mcp/server/__init__.py,sha256=Ioza5tZX7qlOicklSVbhcXO3r7EjRLENvV5AtBSusAQ,723
|
|
24
24
|
nat/plugins/mcp/server/front_end_config.py,sha256=yFmEMKcz_ANJnef4Zu4dwGtnfNZ0uzVdc_dYYCLmgCg,5749
|
|
25
25
|
nat/plugins/mcp/server/front_end_plugin.py,sha256=WAqgYFHAswUK1WKk_PIUo6Lyf0pvJLelT3esHhmIHFM,6896
|
|
26
|
-
nat/plugins/mcp/server/front_end_plugin_worker.py,sha256=
|
|
26
|
+
nat/plugins/mcp/server/front_end_plugin_worker.py,sha256=2_PQ938IbYKFKDsmDw6rcgBWHZdbxZetUopU4Ik1FDQ,18187
|
|
27
27
|
nat/plugins/mcp/server/introspection_token_verifier.py,sha256=oyhZkCTo6u3w7m469DicF57BNmhTPLcMYtWuHvcCsRg,2840
|
|
28
28
|
nat/plugins/mcp/server/memory_profiler.py,sha256=KjJw4ARSmEFult2MorFySiucog0bD8ClI9ZbkJhIwns,12816
|
|
29
29
|
nat/plugins/mcp/server/register_frontend.py,sha256=gfHfQaQ4NhkZkDSrFur1bxbG93kbAGBtumm4eKYOzKE,1178
|
|
30
|
-
nat/plugins/mcp/server/tool_converter.py,sha256=
|
|
31
|
-
nvidia_nat_mcp-1.4.
|
|
32
|
-
nvidia_nat_mcp-1.4.
|
|
33
|
-
nvidia_nat_mcp-1.4.
|
|
34
|
-
nvidia_nat_mcp-1.4.
|
|
35
|
-
nvidia_nat_mcp-1.4.
|
|
36
|
-
nvidia_nat_mcp-1.4.
|
|
37
|
-
nvidia_nat_mcp-1.4.
|
|
30
|
+
nat/plugins/mcp/server/tool_converter.py,sha256=v35IILT5S2jE7ZTYQzm8-4CMu5Xa21BACeRP1MS1vzA,11608
|
|
31
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
|
|
32
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
33
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/METADATA,sha256=dxVfJTfdSV1FteEA8baIBUjx70l7Da7WSv1H9Oi6tuY,2324
|
|
34
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
35
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/entry_points.txt,sha256=t5HYRfXR-dyZf6BWRz1u1TqPprKpCWt-WLHKQXfiLLU,231
|
|
36
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
|
|
37
|
+
nvidia_nat_mcp-1.4.0a20260128.dist-info/RECORD,,
|
{nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nvidia_nat_mcp-1.4.0a20260107.dist-info → nvidia_nat_mcp-1.4.0a20260128.dist-info}/top_level.txt
RENAMED
|
File without changes
|