Fix HTTP MCP Host header rejection for lunch-money-mcp #24
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/lunch-money-k8s#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The live lunch-money MCP is broken after the deploy workflow self-triggered on coilyco-bridge/deploy@ace09843ff.
Observed:
deploy-lunch-money-mcp.yml, commitace09843ff8b3702c1b4a79d4d10460c6a7c3dd1, failed in ~2s.services/lunch-money-mcp/values.envhasIMAGE_TAG=sha-a0b5197.a0b51979a635c961f0ac8cb41bed2e392cb7b496andbuild-publish.ymlsucceeded for that exact commit, so the deploy pin matches the intended source image tag.https://lunch-money.coilysiren.me/.well-known/oauth-protected-resourcereturns 200.https://lunch-money.coilysiren.me/mcpreturns HTTP 500 without a bearer token, where the other gated MCPs normally fail as 401/302-ish auth gates rather than backend errors.http://kai-server.tail09a41b.ts.net:30080/mcpreturnsHTTP/1.1 421 Misdirected Requestwith bodyInvalid Host headerfrom uvicorn.Likely root cause: MCP Python SDK / FastMCP DNS rebinding protection.
lunch_money_mcp/server.pyconstructsmcp = FastMCP("lunch-money")at import time, then later mutatesmcp.settings.host/mcp.settings.portinmain(). Recent MCP SDK versions decide transport security / allowed hosts duringFastMCP(...)construction, so late host mutation leaves a localhost-only allowed-host policy and rejects real deployment hosts.Please fix the source server so HTTP mode accepts the deployed hosts intentionally, without disabling the safety boundary blindly. Expected hosts for this deployment:
lunch-money.coilysiren.mekai-server:30080kai-server.tail09a41b.ts.net:30080localhost:30080or equivalent local test host if usefulPrefer env-driven configuration so deploy can own hostnames without source edits, for example
LUNCH_MONEY_MCP_ALLOWED_HOSTS/LUNCH_MONEY_MCP_ALLOWED_ORIGINSparsed by the server and passed into FastMCP transport security at construction time, or pass the HTTP host/port toFastMCP(...)early enough that the SDK configures itself correctly. Add focused tests for the HTTP configuration path.After the source fix lands and the image publishes, update
coilyco-bridge/deploy(granted repo) to pin the newsha-<short>image tag inservices/lunch-money-mcp/values.envand roll it. Verify both:curl -sI https://lunch-money.coilysiren.me/mcpno longer returns backend 500 for a plain unauthenticated request.curl -sI http://kai-server.tail09a41b.ts.net:30080/mcpno longer returns421 Invalid Host header.🔒 Reserved by
ward agent --harness codex— containerengineer-codex-lunch-money-k8s-24on hostkais-macbook-pro-2.localis carrying this issue (reserved 2026-07-08T16:17:03Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
run seed context — what this run is carrying (ward#609)
coilyco-flight-deck/lunch-money-k8s#24· branchissue-24· harnesscodex· workflowdirect-mainengineer-codex-lunch-money-k8s-24· wardv0.444.0· dispatched2026-07-08T16:17:03ZIssue body as seeded:
… (truncated to 2000 chars; full body is on this issue)
Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.444.0).
— Codex, via
ward agentAdditional fleet probe from the deploy director on 2026-07-08:
http://kai-server.tail09a41b.ts.net:30080/mcpreturns 421Invalid Host header.So lunch-money is the only non-Playwright MCP failing this fleet probe, and its failure still matches the FastMCP Host-header diagnosis in this issue.