Skip to content

Configure MCP OAuth modes and enforce headless policy #523

Description

@JAORMX

Parent: #518

Outcome

Operators select one explicit auth mode for a named global MCP server. Local interactive deployments may authorize; headless and one-shot deployments use cached/pre-provisioned credentials or static bearer and fail promptly otherwise.

Design requirements

  • Extend the shared server parser in internal/cliconfig/mcpserver.go with one operator-tier per-server auth mode: none, existing static bearer, or OAuth. Preserve current name, case, and insecure-HTTP gates.
  • Carry only mecatl-owned auth policy/options on internal/adapter/mcp.ServerConfig; wire concrete store and presenter dependencies in internal/app.
  • MVP OAuth applies only to operator-configured global MCP entries. ACP per-session specs, inline agent-definition MCP, and discovered sources remain OAuth-disabled.
  • Local interactive mecated may use the browser flow. Headless mecated, mecatequi, and mecak8s never open browsers or callbacks implicitly. Missing credentials produce classified login-required promptly.
  • Preserve manager fail-soft behavior for an unavailable server while making auth failures immediate and actionable. The explicit login operation exits nonzero on auth failure.
  • Local encrypted storage is opt-in and single-user. mecak8s must not silently select it or describe it as multi-replica persistence.
  • OAuth policy and client registration are operator-tier only; project and ACP input cannot select another credential identity.

Acceptance criteria

  • All composition roots share one parser and reject ambiguous/duplicate auth declarations, static + OAuth, prohibited transport, and stale references.
  • Default/OAuth-off creates no credential file, key-source access, callback listener, goroutine, or additional request.
  • Headless clean-store startup produces typed login-required with zero browser/listener activity; warm startup connects silently.
  • Static bearer behavior remains byte-compatible, including origin scoping and insecure-loopback policy.
  • A local Buzz custom runtime can configure OAuth entirely in mecatl configuration; no Buzz MCP injection or URL elicitation is assumed.
  • No OAuth option is accepted for ACP per-session or inline agent-definition MCP in the MVP.

Verification

Shared parser/finalize tables across real mains; composition selection tests; default no-side-effect tests; headless timing/browser/listener spies; static-bearer regression suite.

Dependencies and sizing

Depends on the controller and local login flow. Parser preparation may begin after the controller auth-mode type is fixed.

Size: L. Complexity: medium-high. Execution: single 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

    Dependency update from #518: headless/Kubernetes credential-source work is now tracked in #542. Final composition here should depend on #542 so mecated --headless, mecatequi, and mecak8s can select an injected read-only environment/mounted-secret source without pretending the local encrypted backend is portable. Durable refresh rotation still requires a mutable CAS backend; read-only Secret-backed sources must surface their restart-durability limitation honestly.

  4. JAORMX commented on Aug 15, 2026

    @JAORMX
    ContributorAuthor

    Implementation is complete on feat/issue-523-mcp-oauth-config, stacked through #519/#520/#521/#542/#522. It adds strict operator-only mcp.servers auth profiles (none/static_bearer/oauth), canonical profile loading and lifecycle, local mutable encrypted credentials or Kubernetes env Reader, exact secret-reference/tiering/egress validation, all-root wiring, fail-soft redacted remedies, and the canonical mecated mcp login SERVER [--no-browser] command with explicit config-file selection. Legacy --mcp-server/MCP_<NAME>_TOKEN remains compatible; ACP/inline/discovered OAuth remains excluded. Parallel security/architecture/QA/UX reviews drove repair waves for redirects, CIMD origins, root/profile parity, cleanup, help side effects, profile diagnostics, SSRF private-origin handling, and login errors. Final security review is clean; lint, race/full tests, docs/site checks, and offline demo pass. Branch pushed; PR waits on stacked prerequisites for a clean diff.

  5. added a commit that references this issue on Aug 15, 2026
    0ba4c1a
  6. added a commit that references this issue on Aug 15, 2026
    edd944e
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