-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add tool search CLI #1839
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
Add tool search CLI #1839
Conversation
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 tool search functionality to enable searching through GitHub MCP Server tools by name and description. However, the implementation is incomplete and contains critical bugs that prevent it from functioning.
Changes:
- Added new
pkg/tooldiscoverypackage with search scoring algorithm - Added
SearchToolsandSearchfunctions for tool discovery - Referenced (but did not implement) new
tool-searchCLI command - Added dependencies:
lithammer/fuzzysearch,fatih/color
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tooldiscovery/search.go | Implements tool search and scoring algorithm with extensive commented-out parameter matching code |
| pkg/tooldiscovery/search_test.go | Minimal test coverage with only 2 basic test cases |
| cmd/github-mcp-server/main.go | References undefined toolSearchCmd variable (compilation error) and removes blank line |
| internal/ghmcp/server.go | Formatting-only changes (alignment fix) |
| go.mod | Adds fuzzysearch and color dependencies |
| go.sum | Adds transitive dependencies for new packages |
Comments suppressed due to low confidence (2)
pkg/tooldiscovery/search.go:25
- The constant
parameterMatchScoreis defined but never used in the actual code (the only usage is in commented-out code). This should be removed to avoid confusion, or the parameter matching functionality should be implemented if it's intended.
parameterMatchScore = 1
pkg/tooldiscovery/search.go:50
- The Search function passes nil as the tools parameter to SearchTools, which will result in iterating over a nil slice (lines 70-78 in SearchTools). This means Search will always return an empty result. This appears to be incomplete implementation - you should either load tools from a cache/inventory here or document this as a placeholder for future implementation.
func Search(query string, options ...SearchOptions) ([]SearchResult, error) {
return SearchTools(nil, query, options...)
12b69aa to
39dc861
Compare
a36b7cd to
8ab711a
Compare
SamMorrowDrums
left a comment
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.
Love it, one documentation bit about the fact most people have the docker version.
| The `github-mcp-server` binary includes a few CLI subcommands that are helpful for debugging and exploring the server. | ||
|
|
||
| - `github-mcp-server tool-search "<query>"` searches tools by name, description, and input parameter names. | ||
| - Use `--max-results` to return more matches. | ||
| - Output is colorized when writing to a TTY (and typically not colorized when piped). | ||
|
|
||
| Example: | ||
|
|
||
| ```bash | ||
| github-mcp-server tool-search "owner" --max-results 5 | ||
| ``` |
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.
I guess should maybe document the others in a follow-up. Also might be worth providing a docker run command? As most users don't have binary hanging around.
a438709 to
4128cb6
Compare
cd44d73 to
b504143
Compare
|
4921c4d to
cc342e2
Compare
Auto-generated by license-check workflow
Summary
What changed
MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs