-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Add non-interactive MCP server listing commands #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
technicalpickles
wants to merge
5
commits into
wong2:main
Choose a base branch
from
technicalpickles:add-list-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
f8fe988 to
ed968aa
Compare
Add comprehensive CLI commands for listing MCP server capabilities without interactive mode:
- list-tools: List all available tools with descriptions
- list-resources: List static resources and resource templates
- list-prompts: List available prompts with arguments
- list-all: Comprehensive overview of all server capabilities
Features:
- Multiple server types: config stdio, remote HTTP/SSE, URL servers in config
- Dual output formats: human-readable with colors + JSON (--json flag)
- OAuth authentication support for remote servers
- Consistent data structure across all commands
- Performance optimized with concurrent Promise.all API calls
Architecture:
- Type-specific formatters (formatListTools, formatListPrompts, formatListResources)
- Compositional design with formatListAll reusing existing formatters
- Single unified data format: {capabilities, tools, prompts, resources, resourceTemplates}
- Zero code duplication with helper functions like shouldInclude
- Clean separation of data fetching, filtering, and formatting
Maintains full backward compatibility - no breaking changes to existing CLI interface.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
99d3b12 to
0157b13
Compare
Add comprehensive documentation for the new non-interactive list commands: - list-tools, list-resources, list-prompts, list-all - Examples for config-based, stdio, and remote servers - JSON output flag usage for scripting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fix regression in interactive mode where no primitives were shown after connecting to server. The filtering logic in listPrimitives was incorrectly excluding all primitive types when filter=null (interactive mode). Refactored to use existing shouldInclude() helper function which properly handles null filters for interactive mode while maintaining compatibility with filtered list commands. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fix ERR_INVALID_ARG_TYPE error when using HTTP/SSE MCP servers from config in interactive mode. The runWithConfig function was incorrectly trying to use StdioClientTransport for all servers regardless of transport type. Now properly detects URL-based servers and uses connectRemoteServer with HTTP transport, while maintaining stdio support for command-based servers. Matches the logic already implemented in runListCommand for consistency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fix regression where selecting primitives in interactive mode would not execute them. The choices array structure was changed during list commands refactoring but the selection handler still expected the old format with type and value properties. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
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.
Summary
Adds non-interactive CLI commands for listing MCP server capabilities, allowing users to inspect tools, resources, and prompts without entering interactive mode.
New Commands
mcp-cli list-tools <server>- List available tools with descriptionsmcp-cli list-resources <server>- List static resources and resource templatesmcp-cli list-prompts <server>- List available prompts with argumentsmcp-cli list-all <server>- Show overview of all server capabilitiesFeatures
--jsonflagUsage Examples
Implementation Notes
listPrimitivesfunction used by interactive modeBackward Compatibility
🤖 Generated with Claude Code