Skip to content

Commit 3e0ceb3

Browse files
committed
update docs
1 parent afe34d8 commit 3e0ceb3

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ These are one time installations required to be able to test your changes locall
3939
- Run linter: `script/lint`
4040
- Update snapshots and run tests: `UPDATE_TOOLSNAPS=true go test ./...`
4141
- Update readme documentation: `script/generate-docs`
42+
- If renaming a tool, add a deprecation alias (see [Tool Renaming Guide](docs/tool-renaming.md))
4243
6. Push to your fork and [submit a pull request][pr] targeting the `main` branch
4344
7. Pat yourself on the back and wait for your pull request to be reviewed and merged.
4445

docs/tool-renaming.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Tool Renaming Guide
2+
3+
How to safely rename MCP tools without breaking existing user configurations.
4+
5+
## Overview
6+
7+
When tools are renamed, users who have the old tool name in their MCP configuration (e.g., in `X-MCP-Tools` headers for the remote MCP server or `--tools` flags for the local MCP server) would normally get errors. The deprecation alias system allows us to maintain backward compatibility by silently resolving old tool names to their new canonical names.
8+
9+
This allows us to rename tools safely, without introducing breaking changes for users that have a hard reference to those tools in their server configuration.
10+
11+
## Quick Steps
12+
13+
1. **Rename the tool** in your code (as usual, this will imply a range of changes like updating the tool registration, the tests and the toolsnaps).
14+
2. **Add a deprecation alias** in [pkg/github/deprecated_tool_aliases.go](../pkg/github/deprecated_tool_aliases.go):
15+
```go
16+
var DeprecatedToolAliases = map[string]string{
17+
"old_tool_name": "new_tool_name",
18+
}
19+
```
20+
3. **Update documentation** (README, etc.) to reference the new canonical name
21+
22+
That's it. The server will silently resolve old names to new ones. This will work across both local and remote MCP servers.
23+
24+
## Example
25+
26+
If renaming `get_issue` to `issue_read`:
27+
28+
```go
29+
var DeprecatedToolAliases = map[string]string{
30+
"get_issue": "issue_read",
31+
}
32+
```
33+
34+
A user with this configuration:
35+
```json
36+
{
37+
"--tools": "get_issue,get_file_contents"
38+
}
39+
```
40+
41+
Will get `issue_read` and `get_file_contents` tools registered, with no errors.

0 commit comments

Comments
 (0)