Skip to content

mcp: per-server operator opt-in for plain-http token-bearing --mcp-server endpoints #358

Description

@JAORMX

Part of the dark-factory epic (stacklok/stacklok-epics#297). Pairs with titlani#40 (the kubernetes arm of the run contract), the way #341 paired with titlani#38.

Gap. #347 (CWE-319) made MCPServerList.Set reject any token-bearing --mcp-server URL that is not https or loopback. Correct default — but in-cluster schedulers (titlani) point agents at plain-http MCP Services inside a NetworkPolicy-scoped namespace, where the same short-TTL bearer already crosses the identical wire from the scheduler's own client. A pod-local proxy sidecar was considered and rejected: it satisfies the gate without changing wire security (the sidecar→service hop stays cleartext) while adding a container to every run pod.

What. An explicit, named, off-by-default operator opt-in that acknowledges the cleartext hop per server:

  • --mcp-server-insecure-http <name> (repeatable): relaxes ONLY the scheme check, ONLY for that server name, ONLY for the http scheme (https validation and everything else unchanged; a name with no matching --mcp-server registration is rejected at flag-parse).
  • Lives in the shared internal/cliconfig helper so mecated/mecatequi/mecak8s stay uniform.
  • Flag help + docs state the acknowledgment plainly: cleartext on the network path; the operator is relying on network-layer controls (NetworkPolicy/namespace trust) + short-lived tokens.
  • ADR (or an amendment to ADR 0082) recording the decision and the rejected sidecar alternative.

Security invariants preserved: default posture unchanged; no global escape hatch; per-name scope only; token still env-only; the name-charset/collision validation from #347 unchanged.

Contract addition (from titlani#40's devils-advocate pass): the scheme gate currently fires inside MCPServerList.Set — i.e. at flag-parse time, in argv order — so a relaxation flag parsed after its --mcp-server would arrive too late. The opt-in MUST be order-independent: collect --mcp-server-insecure-http names during parse and defer the scheme validation to a post-parse finalize step (or validate relaxations first). Argv ordering must not be part of the caller's contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions