Skip to content

Headless MCP OAuth credential sources for Kubernetes deployments #542

Description

@JAORMX

Parent: #518

Outcome

Make MCP OAuth credential custody an injected host-internal port with deployment-specific adapters. Local desktop deployments use the mutable encrypted store from #519; remote/headless deployments can bootstrap credentials from Kubernetes Secret-backed environment variables or mounted files without selecting local workstation storage.

Design requirements

  • Split the generic contract into an explicit read boundary and mutable CAS boundary. The MCP OAuth consumer depends on the narrowest interface it needs; concrete local, environment, file, or future Kubernetes implementations are selected only in composition.
  • Keep the contract host-internal rather than engine/port: the engine does not consume OAuth credentials and OAuth types must not cross into the importable core.
  • Add a read-only environment credential source suitable for Kubernetes Secret env/envFrom injection. Secret values are opaque versioned OAuth credential envelopes; names are operator-configured and never derived from project or model input.
  • Optionally support a mounted-secret-file reader using the same envelope and strict size/permission/symlink validation. It may be preferable when kubelet-driven updates are required.
  • Read-only sources never claim CAS or durable refresh rotation. A process may continue using a refreshed/rotated token in memory, but restart durability is explicitly unavailable unless an external controller updates the Secret. Expiry/invalid-grant returns typed login-required/unavailable rather than silently falling back to browser interaction.
  • The local encrypted backend remains one mutable adapter, not the default contract.
  • Reserve a future writable Kubernetes Secret adapter using resourceVersion conditional updates, least-privilege RBAC, namespace/name scoping, and refresh ownership. Do not implement it in this issue unless durable multi-replica rotation is required by the MVP.
  • Never log/project environment values, mounted file contents, tokens, client secrets, or full credential identities. Ensure agent-facing Bash secret scrubbing still denies the selected env names.

Acceptance criteria

  • Compile-time composition can substitute memory, encrypted local mutable storage, and read-only environment storage without changes to MCP OAuth protocol/controller code.
  • Environment source reads Kubernetes Secret-backed values with strict bounds/schema validation and typed not-found/unavailable errors.
  • OAuth-off/default performs no environment or file lookup.
  • Read-only behavior is explicit in capabilities and tests: refresh works in memory for the process where supported, rotation is not persisted, and restart behavior is documented/tested.
  • Headless mode never opens a browser or loopback listener because a read-only source is missing/expired.
  • Secret canaries are absent from diagnostics, errors, config projections, ACP, and model-visible output.
  • Documentation includes Kubernetes examples and clearly distinguishes env/file bootstrap from a writable CAS backend.

Security constraints

Operator-tier configuration only. No project-controlled env names or paths. Bound decoded values; reject malformed/trailing data. Never pass secret values through command arguments. Environment support is accepted as a Kubernetes bootstrap mechanism, not represented as encrypted at rest by mecatl or dynamically updateable.

Dependencies and sizing

Depends on #519's contract and #521's credential envelope. It should land before #523 finalizes headless composition policy.

Size: M. Complexity: medium/security-sensitive. Execution: single dev-pipeline pass after interfaces settle.

Activity

  1. self-assigned this
    on Aug 14, 2026
  2. added
    enhancement
    config
    on Aug 14, 2026
  3. JAORMX commented on Aug 14, 2026

    @JAORMX
    ContributorAuthor

    Implementation is complete on feat/issue-542-k8s-credential-source, stacked on #521. The host-internal credential port now distinguishes read-only Reader from mutable CAS Store; Kubernetes Secret-backed environment credentials use an explicit bounded base64 Reader, require the shell-scrubbed MECATL_ namespace, and never claim refresh persistence. OAuth defaults fail closed for read-only refresh, with an explicit current-process-only opt-in; mutable mode accepts one Store so reader/writer versions cannot diverge. ADR 0111 and Kubernetes deployment docs are included. Security review repair waves are clean; lint, race/full tests, docs/site build, and demo pass. Branch pushed; PR waits on the stacked prerequisites for a clean diff.

  4. added a commit that references this issue on Aug 15, 2026
    95c1089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

configenhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions