Skip to content

MCP client: credential-source seam for refreshing short-lived bearer tokens #342

Description

@JAORMX

Gap. MCP auth headers are captured once at connect (internal/adapter/mcp); reconnect (ADR 0056) reuses the same static headers. A run outliving a short-lived per-run token (schedulers mint 5–10m identities; k8s projected SA tokens are kubelet-refreshed on disk) loses access mid-run with no re-mint path.

What

  • A credential-source seam for MCP server auth: re-read per request or on reconnect/401 — a file-based source covers k8s projected-token auto-refresh; env stays for static tokens.
  • 401/403 → one credential re-read + retry before failing the tool call.
  • Preserve the existing redirect hardening (no Authorization forwarding on cross-host redirects).

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