Repository navigation
fix(mcp): Serve compute-mcp over TLS so the assistant can call it - #636
Merged
Merged
Conversation
compute-mcp only served plain http, and the assistant now refuses to send a caller's bearer token to an http endpoint, so its tools stopped loading. With --tls-cert-file and --tls-key-file it serves https and reloads the certificate when the files are renewed. With neither it serves http as before, and with only one it refuses to start.
The deployment served plain http and the capability documents advertised http URLs, which the assistant will not send a bearer token to. The pod now mounts a certificate from the datum-control-plane issuer and serves https on the same port, with https probes. Every compute-mcp URL in the capability documents is https.
ecv
approved these changes
Nov 11, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
compute-mcp serves https from a CSI cert whose SANs cover compute-mcp.compute-system.svc.cluster.local, and all three assistant configs (v1, v2, exec v3) now point at https on that host.
- SANs: the CSI
dns-namesarecompute-mcp,.compute-system.svcand.compute-system.svc.cluster.local, the host in the/mcp,/llms-full.txtand runbook URLs of all three config files. compute-mcp is deployed unprefixed incompute-systemper infra's identity-forwarding list. - Trust: the assistant trusts the
datum-control-planeCA throughSSL_CERT_FILEanddatum-control-plane-system-bundle(infra#8826, merged). The compute manager already mounts a CSI cert from the same issuer (apps/compute-system/deployment-control-plane/base/manager.yaml), so the driver exists there. - Probes are HTTPS on the unchanged named port; infra's
networkpolicy-compute-mcp.yamlselects by port number and label, and the staging exec-relay egress policy is unaffected because the CSI mount is node-side. Pod runs as 65532 andfs-groupmatches. serve.go:certwatcherwithGetCertificate, failed re-reads keep the old cert, half-configured flags fail at startup inmainand inserve, and the shutdown path uses its own 20s timeout since the parent context is already cancelled. Tests cover https, plain http, rotation, unreadable cert and clean shutdown.
Follow-ups:
- No test ties the SANs to the URLs in the three config files; a drift check would catch a future rename.
- Three implementations of the same TLS serve logic now exist (here, dns-operator, NSO
internal/mcpserver) with slightly different shutdown handling; consider a shared helper later.
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.
Problem
Since milo-os/assistant#169 the assistant refuses to send a user's token over plain http. compute-mcp only served http on port 8080, so on staging the assistant drops every compute tool and logs
credential_plaintext_refusedfor compute-mcp.Solution
compute-mcp serves https when given
--tls-cert-fileand--tls-key-file, and reloads the certificate when cert-manager rotates it. Without the flags it still serves http for local dev and e2e, and setting only one fails at startup. The deployment mounts a certificate from thedatum-control-planeClusterIssuer through the cert-manager CSI driver and probes over HTTPS, and all 29 compute-mcp URLs in the capability documents now use https. The assistant already trusts that CA (datum-cloud/infra#8826). Production pins compute at v0.16.0, so it picks this up after a release and a pin bump.Refs milo-os/assistant#169