-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add list-tools command for standalone tool discovery #1
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
Conversation
Add standalone list-tools command that connects to MCP servers to discover available tools without starting proxy mode. Supports tool filtering via --enabled-tools and --disabled-tools flags. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add comprehensive CI workflow with testing, linting, and building - Fix typecheck script from "bun --bun tsc" to "bun tsc" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new list-tools
command that enables standalone tool discovery without starting a proxy server. This allows users to inspect available tools from MCP servers before deciding how to configure the proxy.
Key changes:
- Add
list-tools
subcommand with tool filtering capabilities via--enabled-tools
and--disabled-tools
options - Extend CLI argument parsing to handle the new operation mode
- Add comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/cli.ts |
Implements core list-tools functionality including argument parsing, server communication, and tool filtering |
src/types.ts |
Extends ProxyConfig type with optional mode field to distinguish operation modes |
tests/list-tools.test.ts |
Comprehensive test suite covering all list-tools functionality and edge cases |
package.json |
Minor script update for typecheck command |
.github/workflows/ci.yml |
New CI workflow configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
let tools = response.result.tools || []; | ||
|
||
if (config.enabledTools) { | ||
tools = tools.filter((tool: Tool) => config.enabledTools!.includes(tool.name)); |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using non-null assertion operator (!) is risky here. Consider using optional chaining or a proper null check since the condition already verifies enabledTools exists.
tools = tools.filter((tool: Tool) => config.enabledTools!.includes(tool.name)); | |
tools = tools.filter((tool: Tool) => config.enabledTools.includes(tool.name)); |
Copilot uses AI. Check for mistakes.
if (config.enabledTools) { | ||
tools = tools.filter((tool: Tool) => config.enabledTools!.includes(tool.name)); | ||
} else if (config.disabledTools) { | ||
tools = tools.filter((tool: Tool) => !config.disabledTools!.includes(tool.name)); |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using non-null assertion operator (!) is risky here. Consider using optional chaining or a proper null check since the condition already verifies disabledTools exists.
tools = tools.filter((tool: Tool) => !config.disabledTools!.includes(tool.name)); | |
tools = tools.filter((tool: Tool) => !config.disabledTools.includes(tool.name)); |
Copilot uses AI. Check for mistakes.
return; // Exit successfully | ||
} | ||
} catch { | ||
// Continue reading if this line wasn't valid JSON |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty catch block silently ignores all parsing errors. Consider adding a comment explaining why this is intentional or log the error for debugging purposes.
// Continue reading if this line wasn't valid JSON | |
} catch (err) { | |
// Continue reading if this line wasn't valid JSON | |
process.stderr.write(`Warning: Could not parse line as JSON: ${err instanceof Error ? err.message : String(err)}\n`); |
Copilot uses AI. Check for mistakes.
Summary
list-tools
command that enables standalone tool discovery without starting a proxy serverChanges
Core Functionality
Modified
src/cli.ts
: Added comprehensive list-tools command functionality including:parseListToolsArguments()
function for handling list-tools specific argument parsinglistTools()
function that connects to target MCP servers, retrieves available tools, and applies filteringlist-tools
as a subcommand--enabled-tools
and--disabled-tools
filtering options in list-tools modeModified
src/types.ts
: ExtendedProxyConfig
type with optionalmode
field to distinguish between proxy and list-tools operationsTest Coverage
tests/list-tools.test.ts
: Complete test suite covering:--enabled-tools
and--disabled-tools
optionsUsage Examples
Test Plan
🤖 Generated with Claude Code