- Notifications
You must be signed in to change notification settings - Fork1.4k
feat: tool prefix name#657
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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
Adds support for an optionaltool-prefix
flag to disambiguate tool names by prepending a user-specified string.
- Introduce a
tool-prefix
CLI flag and bind it via Viper. - Extend
MCPServerConfig
andStdioServerConfig
to includeToolPrefix
and propagate it into server registration. - Update
Toolset.RegisterTools
andToolsetGroup.RegisterAll
to accept a prefix and register tools with prefixed names.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pkg/toolsets/toolsets.go | AddedcreateToolWithPrefixedName and updatedRegisterTools to apply the prefix when registering tools. |
internal/ghmcp/server.go | AddedToolPrefix toMCPServerConfig /StdioServerConfig and passed it intoRegisterAll and dynamic toolset registration. |
cmd/github-mcp-server/main.go | Defined thetool-prefix flag in Cobra, bound it to Viper, and populated the CLI config. |
Comments suppressed due to low confidence (2)
pkg/toolsets/toolsets.go:106
- No unit tests were added to verify the new prefix logic in
RegisterTools
. Adding tests to confirm that tools are registered with the correct prefixed names would help prevent regressions.
func (t *Toolset) RegisterTools(s *server.MCPServer, prefix string) {
pkg/toolsets/toolsets.go:110
- [nitpick] The parameter name
tool
shadows the outer loop variable and may be confusing. Consider renaming it (e.g., tosrvTool
) to make the code clearer.
registerToolWithPrefix := func(tool server.ServerTool) {
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Closes:#333
introduce arg flag
tool-prefix
so client able to add prefix name of tools, avoid conflict tool name with another mcp server