Skip to content

feat(cliconfig): per-server --mcp-server-insecure-http opt-in, order-independent - #360

Merged
JAORMX merged 2 commits into
mainfrom
mcp-insecure-http-optin
Aug 4, 2026
Merged

JAORMX merged 2 commits into
mainfrom
mcp-insecure-http-optin

Conversation

@JAORMX

@JAORMX JAORMX commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes #358. Part of the dark-factory epic (stacklok/stacklok-epics#297); the cross-repo dependency of titlani#40 (the kubernetes arm of the run contract), the way #341 was for titlani#38.

What: an explicit, named, off-by-default operator opt-in for token-bearing plain-http --mcp-server endpoints — for in-cluster schedulers pointing agents at NetworkPolicy-scoped Services 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 (satisfies the gate without changing wire security).

  • --mcp-server-insecure-http <name> (repeatable), registered by the same shared RegisterMCPServerFlag all three mains use.
  • Order-independent by construction: Set collects; a new post-parse Finalize() resolves relaxations and runs the CWE-319 scheme gate — both argv orders pinned end-to-end in all three mains.
  • Fail-closed: Servers() panics before a successful Finalize — a future main cannot silently reopen CWE-319 by forgetting the call.
  • Scope: per-name only (plant-verified: relaxing tequitl leaves a token-bearing http vmcp failing, error names vmcp); http-scheme only; unregistered/https/loopback/non-http relaxations are loud Finalize errors. Nuance (ADR'd): a relaxation on a tokenless off-host http server is accepted — the acknowledgment matches the wire shape, and schedulers inject tokens in some runs and not others.
  • Default posture unchanged and re-pinned; token stays env-only; feat: factory MCP wiring — --mcp-server on mecatequi/mecak8s + compact summary #347's name-charset/collision validation untouched.
  • ADR 0090 records the decision, the rejected sidecar and global-escape-hatch alternatives, and the order-independence contract; operator docs + factory invocation profile updated.

Gates: task build / test / lint / api:check / docs all green (engine untouched, no api:update). One pre-existing env flake noted, not touched: cmd/mecatui TestLocalProviderCheckRuns fails when the ambient shell exports OPENROUTER_API_KEY.

🤖 Generated with Claude Code

JAORMX and others added 2 commits August 4, 2026 18:00
…independent (#358)

MCPServerList.Set no longer runs the token-bearing scheme gate inline:
entries are collected during parse and the CWE-319 gate runs in a new
post-parse Finalize step the three mains (mecated, mecatequi, mecak8s)
call right after flag.Parse — so the new repeatable
--mcp-server-insecure-http <name> relaxation composes with --mcp-server
regardless of argv order (the titlani#40 contract addition).

The relaxation applies ONLY to the named server (same ^[A-Za-z0-9_]+$
name grammar as #347), ONLY to the http scheme; an unknown name, or a
name whose URL is https/loopback/non-http, is a loud error (a stale
acknowledgment is never silently inert). Default posture unchanged: a
token-bearing http non-loopback URL without the relaxation still fails.
Servers() panics fail-closed before a successful Finalize.

Co-Authored-By: Claude Fable 5 <[email protected]>
New ADR 0090 records the per-server plain-http opt-in decision, the
rejected proxy-sidecar alternative (satisfies the gate without changing
wire security), the rejected global escape hatch, and the
order-independence requirement from titlani#40. Factory invocation
profile (docs/usage/mecatequi-ci.md), the mecated/mecak8s flag tables,
and the user-docs MCP pages state the acknowledgment plainly: cleartext
on the network path; network-layer controls + short-lived tokens are
the operator's mitigations. llms.txt regenerated.

Co-Authored-By: Claude Fable 5 <[email protected]>
@JAORMX JAORMX added the e2e-live Run the live e2e suite on this PR label Aug 4, 2026
@JAORMX
JAORMX merged commit b5b328d into main Aug 4, 2026
17 checks passed
@JAORMX
JAORMX deleted the mcp-insecure-http-optin branch August 4, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-live Run the live e2e suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant