Repository navigation
fix(cliclient): path-escape server and tool names in per-server URLs - #1751
Merged
Dumbris merged 1 commit intoOct 26, 2026
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Dumbris
approved these changes
Oct 26, 2026
Dumbris
left a comment
Member
There was a problem hiding this comment.
Verified: the PR test fails on main for the reason described and passes on this branch merged with main; race tests for the touched packages and CI lint (bare and server tags) are clean. Also built and tested together with the rest of this batch, independently reviewed, and cross-reviewed with a second model.
Member
|
Merged. Thank you, @rudycelekli! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Official-registry server ids are
namespace/name(io.github.owner/repo,com.pulsemcp/google-flights). The daemon handles them on/api/v1/servers/{id}/*by decoding a%2F-encoded{id}(decodeServerIDParam, MCP-1118), andGetServerLogsalready sendsurl.PathEscape(serverName). Every other per-server method ininternal/cliclientsplices the raw name into the URL withfmt.Sprintf, so the slash splits the name across path segments and the request lands on a different route (usually a 404):Affected:
ServerAction(enable/disable/restart),GetServerTools,SetToolEnabled,SetAllToolsEnabled,TriggerOAuthLoginWithResult,TriggerOAuthLogout,PatchServer,RemoveServer,GetToolApprovals,GetToolDiff,ApproveTools,BlockTools. Most of these declare a localurlvariable that shadowsnet/url, which is probably how the escape was missed.ServerAction'svar url stringis renamed toreqURL; theurl := fmt.Sprintf(..., url.PathEscape(...))sites are fine as written because the new variable's scope starts after the statement.Tool names in
SetToolEnabledandGetToolDiffare escaped too. For a/in a tool name, the daemon also has to decode{tool}; that is #1750.Testing
TestPerServerRequests_EscapeServerAndToolNames(internal/cliclient/server_path_escape_test.go) calls 12 methods against anhttptestserver and checksr.URL.EscapedPath().