Repository navigation
[feat][MCP] Make public routing mode explicit - #391
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues remain. Reviews (2) · Last reviewed commit: "Clarify MCP routing setup guidance" · Reviewed by Greptile |
arnold-retool
added this pull request to stack #393
September 30, 2026 21:47
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
from
September 30, 2026 21:50
2f75531 to
01dbcdf
Compare
Comment on lines
+1
to
+2
| {{- /* Run mode and migration validation even when neither public route is enabled. */ -}} | ||
| {{- $mode := include "retool.mcp.routingMode" . -}} |
Collaborator
There was a problem hiding this comment.
wait why do we still need to run the validation helper if neither the ingress nor httproute are enabled?
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
from
September 30, 2026 23:08
01dbcdf to
d2ab40d
Compare
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
from
October 16, 2026 20:15
5fab6ff to
1369953
Compare
ryanartecona
approved these changes
Oct 20, 2026
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
2 times, most recently
from
October 20, 2026 20:51
6853746 to
9f1f24d
Compare
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
from
October 20, 2026 23:32
9f1f24d to
0ac6245
Compare
arnold-retool
force-pushed
the
arnold/mcp-routing-mode
branch
from
October 21, 2026 21:47
0ac6245 to
358d14c
Compare
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Stacked on #390 (
arnold/mcp-helm-public-url-test). Review this PR against that branch; it contains only the routing change and its tests.Summary
Adds public MCP routing choices for older Retool versions (
direct) and Retool 4.0.7+ (backendRelay).For recent versions,
backendRelaylets MCP and OAuth discovery requests use the main Retool Service instead of dedicated public MCP routes. The public route must cover those URLs; the backend then relays/mcpto the MCP Service.In more detail:
mcp.routing.modewithdirectas the compatibility default. This preserves the dedicated routes used by older Retool servers and also works with the tested recent server image.backendRelayto route MCP and OAuth discovery requests through the main Retool Service; its backend relays/mcpto the MCP Service usingMCP_SERVICE_INGRESS_DOMAIN.directtarget/.well-known/oauth-authorization-server(ImplementationSpecific Ingress; Exact HTTPRoute)/.well-known/oauth-protected-resource(ImplementationSpecific Ingress; Exact HTTPRoute)/mcp(prefix)/(ImplementationSpecific Ingress default; PathPrefix HTTPRoute)In
backendRelay, the chart renders no dedicated MCP Ingress or HTTPRoute rules; a public/route must match the MCP URLs and target the main Retool Service. The chart does not parseimage.tagto choose a mode. Unknown modes and non-boolean legacy enable flags fail rendering when a chart-managed Ingress or HTTPRoute renders. The alternateingress.hostNamebranch renders an explicit/main path. No server code changed.Migration
direct. It remains the default and also works on newer versions. On Retool 4.0.7+, opt intobackendRelaywithmcp.routing.mode: backendRelay.backendRelay, remove any oldmcp.ingress.enabled: trueormcp.httpRoute.enabled: trueoverrides, or set them tofalse. These flags now default tonull, which adds dedicated routes only indirectmode when MCP is enabled. If MCP is enabled and the chart renders an Ingress or HTTPRoute, an explicittrueconflicts withbackendRelayand fails rendering./mcpand both OAuth discovery URLs to the main Retool Service on port 3000. The default HTTPRoute rule and an Ingress usingingress.hostNameprovide a/route. Check eachingress.hosts[*].pathsentry, customhttpRoute.rules, and externally managed routes separately. An Ingress path withpathType: Exactandpath: /does not cover/mcp. External operators can use the direct-mode routing table above.helm upgrade --reset-then-reuse-valuesto load the new defaults while retaining saved overrides. Plain--reuse-valuescan leavemcp.routing.modeabsent. If MCP is enabled and the chart renders its Ingress or HTTPRoute, that produces a migration error. If your Helm version lacks the flag, pass your custom values file with-fand omit--reuse-values.mcp.test.publicUrlto your Retool origin and runhelm test. The test pod must be able to reach that host.Implementation notes
ingress-nginx with strict path validation rejects dots in
ExactandPrefixpaths, so direct Ingress discovery paths useImplementationSpecific. Check path matching with your Ingress controller; Gateway API discovery rules remainExact.Routing and migration guidance sits above
mcp.routing.modein both synchronized values files. This stacked PR targets chart version 6.12.5; #390 targets 6.12.4, following the currentmainrelease at 6.12.3.Validation
python3 .github/test_mcp_routing.py: 15 render checks passed for both modes, Ingress and HTTPRoute, MCP disabled, explicit overrides, conflicts, and invalid modes.python3 .github/test_mcp_helm_test.py: 16 checks passed.helm lintwith CI installation and MCP values: passed..github/kubeconform.shagainst Kubernetes v1.31.6 across its CI value combinations: passed.git diff --check: passed.onprem-4.0.7-f08359fthroughonprem-4.47.0-92b3baeretain the MCP/mcp, MCP protected-resource discovery, and backend authorization-server discovery route definitions targeted bydirect.pr-4.68.0-15a4b64image, direct requests to the MCP and backend API Services with the public Host and forwarded HTTPS scheme passed:/mcpreturned a 401 Bearer challenge with publicresource_metadata; protected-resource discovery returned valid public resource JSON; authorization-server discovery returned valid public OAuth JSON.direct, all four deployments are ready, andhelm test retoolpassed. The sandbox disables chart-managed Ingress and HTTPRoute, so its external ALB normally keeps a catch-all main-Service route.direct:/mcpand protected-resource discovery to the MCP pod on 4010, authorization-server discovery to backend API pods on 3001, with ALB-only security-group access. Both the public probe and in-clusterhelm testpassed through those direct rules. Removed the temporary rules, target groups, and access afterward; independently verified the original catch-all rule and port-3000-only access remained, and the public probe still passed.