Add a CLI command to list all tools available via the MCP server#221
Merged
rapids-bot[bot] merged 12 commits intoNVIDIA:developfrom May 7, 2025
Merged
Add a CLI command to list all tools available via the MCP server#221rapids-bot[bot] merged 12 commits intoNVIDIA:developfrom
rapids-bot[bot] merged 12 commits intoNVIDIA:developfrom
Conversation
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Show both server and client usage Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This to disambiguate with config-mcp-math configuration file Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new CLI command to list available MCP tools and updates related configuration files and documentation for the MCP server.
- Introduces the "aiq info mcp" command to query tool information from the MCP server.
- Adds MCP configuration files for math and date tools in the simple_calculator example.
- Updates documentation to reflect new usage patterns and sample configurations.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/aiq/cli/commands/info/list_mcp.py | Implements a new command for listing MCP tools using both direct and builder-based protocols. |
| src/aiq/cli/commands/info/info.py | Registers the new "mcp" command within the existing info command group. |
| examples/simple_calculator/src/aiq_simple_calculator/configs/config-mcp-math.yml | Provides a configuration file for MCP math tools. |
| examples/simple_calculator/src/aiq_simple_calculator/configs/config-mcp-date.yml | Provides a configuration file for MCP date tools. |
| examples/simple_calculator/README.md | Updates example usage instructions to reference the new MCP configuration file. |
| docs/source/guides/mcp-server.md | Revises and clarifies sample usage and documentation for starting and using the MCP server. |
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
…ange Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Copilot review comments: [ [nitpick] Using asyncio.run directly in a CLI command might conflict with environments that already have an active event loop; consider adding a conditional check or using an async-compatible click command to ensure broader compatibility. ] Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new CLI command for querying MCP tool information and updates documentation and configuration examples to support the new MCP endpoints.
- Adds a new CLI command (list_mcp) with options for tool details, JSON output, and direct protocol usage.
- Updates tests to cover the new command functionality.
- Revises the docs and configuration samples to demonstrate end-to-end MCP usage.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/aiq/cli/commands/info/test_list_mcp.py | Adds tests for the new MCP info command |
| src/aiq/cli/commands/info/list_mcp.py | Implements the CLI command to list and show tool details |
| src/aiq/cli/commands/info/info.py | Registers the new MCP command with the info group |
| examples/simple_calculator/.../config-mcp-math.yml | Provides a config sample for MCP math tools |
| examples/simple_calculator/.../config-mcp-date.yml | Provides a config sample for MCP date tools |
| examples/simple_calculator/README.md | Updates usage instructions to reference the new MCP config |
| docs/source/guides/mcp-server.md | Updates the MCP server guide with revised sample usage |
Comments suppressed due to low confidence (1)
src/aiq/cli/commands/info/list_mcp.py:32
- [nitpick] Consider standardizing the input schema attribute name across the codebase instead of checking for both 'input_schema' and 'inputSchema' to reduce ambiguity.
input_schema = getattr(tool, 'input_schema', None) or getattr(tool, 'inputSchema', None)
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
mpenn
approved these changes
May 7, 2025
Contributor
Author
|
/merge |
yczhang-nv
pushed a commit
to yczhang-nv/NeMo-Agent-Toolkit
that referenced
this pull request
May 8, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221 Signed-off-by: Yuchen Zhang <134643420+yczhang-nv@users.noreply.github.com>
yczhang-nv
pushed a commit
to yczhang-nv/NeMo-Agent-Toolkit
that referenced
this pull request
May 9, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221 Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
yczhang-nv
pushed a commit
to yczhang-nv/NeMo-Agent-Toolkit
that referenced
this pull request
May 9, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221 Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
ericevans-nv
pushed a commit
to ericevans-nv/agent-iq
that referenced
this pull request
Jun 3, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
ericevans-nv
pushed a commit
to ericevans-nv/agent-iq
that referenced
this pull request
Jun 3, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221 Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
AnuradhaKaruppiah
added a commit
to AnuradhaKaruppiah/oss-agentiq
that referenced
this pull request
Aug 4, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221
scheckerNV
pushed a commit
to scheckerNV/aiq-factory-reset
that referenced
this pull request
Aug 22, 2025
…DIA#221) This PR: 1. Adds a CLI command for querying MCP tool info 2. Updates the MCP guide to show an end-to-end MCP example using simple-calculator's tools. Sample Usage: 1. Start an mcp server: ``` aiq mcp --config_file examples/simple_calculator/configs/config.yml ``` 4. Get a list of tools supported by the server: ``` (.venv) $ aiq info mcp calculator_multiply calculator_inequality current_datetime calculator_divide calculator_subtract react_agent ``` 5. Get tool details: ``` (.venv) devcontainers@DESKTOP-S84PU86:~/dev/forks/agentiq$ aiq info mcp --tool calculator_multiply Tool: calculator_multiply Description: This is a mathematical tool used to multiply two numbers together. It takes 2 numbers as an input and computes their numeric product as the output. Input Schema: { "properties": { "text": { "description": "", "title": "Text", "type": "string" } }, "required": [ "text" ], "title": "CalculatorMultiplyInputSchema", "type": "object" } ------------------------------------------------------------ ``` 4, For all options: ``` (.venv) $ aiq info mcp --help Usage: aiq info mcp [OPTIONS] COMMAND [ARGS]... List tool names (default), or show details with --detail or --tool. Options: --direct Bypass MCPBuilder and use direct MCP protocol --url TEXT MCP server URL [default: http://localhost:9901/sse] --tool TEXT Get details for a specific tool by name --detail Show full details for all tools --json-output Output tool metadata in JSON format --help Show this message and exit. Commands: list ``` ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/AIQToolkit/blob/develop/docs/source/advanced/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah) Approvers: - Matthew Penn (https://github.com/mpenn) URL: NVIDIA#221
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR:
Sample Usage:
4, For all options:
By Submitting this PR I confirm: