Repository navigation
app/: MCP answers on VISUALCI_MCP_URL's host (production 403 after cutover) - #115
Open
ndbroadbent wants to merge 1 commit into
Open
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
…e every configured host Production MCP answered 403 "Host header is not allowed": rmcp's DNS-rebinding guard was given localhost and APP_URL, never the MCP host. tests/mcp_hosts.rs posts initialize with Host: mcp.visualci.test.
ndbroadbent
force-pushed
the
app-mcp-allowed-hosts
branch
from
December 3, 2026 07:19
4b35fd9 to
b7b71e2
Compare
This branch has not been deployed
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.
After cutover, production MCP refused every request:
POST https://mcp.visualci.com/mcpanswered 403 "Host header is not allowed". That's rmcp's DNS-rebinding guard.service()inapp/src/mcp/mod.rsgave it localhost,app_url()andAPP_URL, but neverVISUALCI_MCP_URL's host, which is where MCP clients connect. Production is running onVISUALCI_MCP_HOSTS=mcp.visualci.comfor now.Fix: rmcp's allowed hosts now include every configured host:
VISUALCI_MCP_URL,VISUALCI_API_URL,VISUALCI_APP_URLandVISUALCI_SITE_URL, plus the existing localhost, app address andVISUALCI_MCP_HOSTSextras.route_by_hoststill decides which host serves/mcp. Once this is live, theVISUALCI_MCP_HOSTSoverride can go.Test:
app/tests/mcp_hosts.rsis a file of its own, because the MCP service is built once per process. With all four host URLs set:POST /mcpwithHost: mcp.visualci.testand a personal token gets 200initializewithserverInfo;Without the fix, the test fails with production's error ("Forbidden: Host header is not allowed"). The old tests never set the host URLs, which is how this was missed.
Checks: on agents-build-1,
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsand the fullcargo test --lockedpass. One run hit the flaky invite_member golden that #112 fixes.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.