Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
hungran wants to merge4 commits intogithub:main
base:main
Choose a base branch
Loading
fromhungran:hungran/tool-prefix

Conversation

hungran
Copy link

@hungranhungran commentedJul 10, 2025
edited
Loading

Closes:#333

introduce arg flagtool-prefix

so client able to add prefix name of tools, avoid conflict tool name with another mcp server

@CopilotCopilotAI review requested due to automatic review settingsJuly 10, 2025 12:21
@hungranhungran requested a review froma team as acode ownerJuly 10, 2025 12:21
Copilot

This comment was marked as outdated.

@hungranhungran requested a review fromCopilotJuly 11, 2025 06:11
Copy link
Contributor

@CopilotCopilotAI left a 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 atool-prefix CLI flag and bind it via Viper.
  • ExtendMCPServerConfig andStdioServerConfig to includeToolPrefix and propagate it into server registration.
  • UpdateToolset.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.

FileDescription
pkg/toolsets/toolsets.goAddedcreateToolWithPrefixedName and updatedRegisterTools to apply the prefix when registering tools.
internal/ghmcp/server.goAddedToolPrefix toMCPServerConfig/StdioServerConfig and passed it intoRegisterAll and dynamic toolset registration.
cmd/github-mcp-server/main.goDefined 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 inRegisterTools. 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 nametool 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) {

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>
Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Suggestion for MCP Function Naming Convention
1 participant
@hungran

[8]ページ先頭

©2009-2025 Movatter.jp