-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add support for safe tool renaming #1563
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
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 introduces a deprecation alias mechanism to enable safe, non-breaking tool renaming. When tools are renamed, old tool names can be mapped to their new canonical names, allowing existing configurations to continue working while issuing deprecation warnings.
Key changes:
- Added infrastructure for mapping deprecated tool names to canonical names
- Implemented alias resolution with user warnings when deprecated names are used
- Empty alias map ready for future tool renames
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/deprecated_tool_aliases.go | New file defining DeprecatedToolAliases map for maintaining backward compatibility when tools are renamed |
| pkg/toolsets/toolsets.go | Added deprecatedAliases field to ToolsetGroup, implemented AddDeprecatedToolAliases and ResolveToolAliases methods |
| pkg/toolsets/toolsets_test.go | Comprehensive test coverage for alias functionality including mockTool helper and tests for adding, resolving aliases, and registering specific tools |
| pkg/github/tools.go | Integration point where aliases are added to the default toolset group |
| internal/ghmcp/server.go | Resolves tool aliases after cleaning tool names and before registering specific tools |
Co-authored-by: Copilot <[email protected]>
…ub-mcp-server into tommy/safe-tool-rename-logic
|
LGTM if we stick to removing these mappings again and not carry them with us all the time. |
|
@tonytrg Fully agree! DMing you about this |
This PR introduces logic to allow non-breaking tool renaming. It does so by introducing Deprecation Aliases, i.e. mappings that map "old"/deprecated tool names (e.g.
get_issue) to their new equivalent (e.g.issue_read) to gracefully handle cases where users have a server configuration that references old tool names.Overview of changes:
DeprecatedToolAliasesindeprecated_tool_aliases.goto have a single source of truth for tool names when renaming toolsDemo

You can see that mapping "test_1" to "get_me" enables "get_me"