You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve query params in remote MCP server URLs (#4154)
* Preserve query params in remote MCP server URLs
When a remote MCP server is registered with query parameters in the URL
(e.g., ?toolsets=core,alerting,...), the transparent proxy was silently
dropping them before forwarding requests to the upstream server. The remote
server received only the base path and fell back to its default behavior,
returning fewer capabilities than configured with no error or warning.
Extract the raw query string alongside the path from the registration URL
and merge it into every outbound request via a new WithRemoteRawQuery proxy
option. Remote query params are prepended before any client-supplied params
so operator-configured values take precedence (first-value-wins semantics).
Raw string concatenation is used intentionally to preserve literal characters
like commas that url.Values.Encode() would percent-encode.
Also fix GenerateMCPServerURL to include query parameters in the URL
returned to clients for SSE and streamable transports.
Add a TransparentProxy.ListenerAddr() method to expose the bound address
after start, enabling cross-package tests to use port 0. Add unit tests
covering the proxy director merge logic, the HTTPTransport.Start()
extraction path, and URL generation. Add an E2E test using a local mock
upstream to cover the full CLI→proxy→upstream stack.
Closes#4153
Signed-off-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Update per PR feedback
---------
Signed-off-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
0 commit comments