Repository navigation
Description
Problem
Mecatl can connect to protected Streamable HTTP MCP servers through the ToolHive broker, and the broker now supports DCR. It does not yet provide a direct MCP-client path that lets a desktop operator configure only an MCP endpoint and have mecatl discover the resource/OAuth metadata, dynamically register a client, complete the interactive authorization flow through a localhost callback, and persist the resulting client/credential lifecycle without ToolHive.
The trigger endpoint is https://connector-gateway.stacklok.dev/gw/mcp, which publishes RFC 9728 protected-resource metadata at https://connector-gateway.stacklok.dev/.well-known/oauth-protected-resource/gw/mcp and uses OAuth 2.1 DCR.
Desired outcome
For a supported remote Streamable HTTP MCP server, a desktop operator supplies the endpoint URL as the only initial per-server configuration. Mecatl discovers and validates all protocol metadata required for OAuth/DCR, drives the first interactive authorization flow through a localhost callback, and stores the client registration, tokens, and other lifecycle state in the local auth.yaml credential file so it can reconnect and refresh without manually pasted client IDs/tokens.
auth.yaml is the operator-machine-local secret/state store for this desktop flow; no remote provisioning API, Kubernetes secret writer, or headless/browserless enrollment is implied.
Implementation options
-
Direct desktop MCP client (baseline). Mecatl owns protected-resource and authorization-server discovery, DCR, the localhost PKCE callback, and the durable
auth.yamllifecycle. This is the smallest conceptual match for endpoint-only desktop onboarding and has no ToolHive runtime dependency. -
Adapt the bundled ToolHive broker from feat(mcp): DCR client mode for the broker's MCP OAuth surface #1244 for a local single-user mode. The recent DCR support was primarily delivered for the
mecak8sbroker deployment, using ToolHive memory/Redis state and a public HTTPS callback. The broker runtime itself is shared bymecatedandmecak8s, so a desktop adaptation is technically possible. It would retain ToolHive's multi-upstream OAuth/DCR coordinator, authorization sequencing, callback state handling, registration cache, refresh, and backend token injection.This is not a configuration-only change: current broker DCR requires explicit authorization and token endpoints alongside its DCR discovery URL, requires a canonical public HTTPS callback, and uses ToolHive-owned storage. A local mode would need a localhost callback topology,
auth.yaml-backed durable state or a documented separate state store, a single-user authority model, and protected-resource discovery before it could offer endpoint-only onboarding. Evaluate this alternative against the direct-client design rather than assuming feat(mcp): DCR client mode for the broker's MCP OAuth surface #1244 can simply be enabled locally.
Scope to clarify
- Select the direct-client baseline or local ToolHive-broker adaptation; either is a sibling of, not a replacement for, the deployed ToolHive-backed MCP broker.
- The exact discovery chain and bindings: MCP endpoint, RFC 9728 protected-resource metadata, authorization-server metadata, DCR registration endpoint, localhost redirect URI, scopes, and token endpoint.
- Safe
auth.yamlschema, owner-only permissions, atomic/CAS update behavior, refresh rotation, revocation/logout, retry/reconnect, metadata drift, and migration behavior. - Configuration shape that keeps endpoint-only onboarding while retaining necessary operator security policy controls.
Existing related work
- Support MCP OAuth provisioning for remote clients #740 covers remote-client OAuth provisioning through server APIs.
- Native OAuth for streaming-HTTP MCP servers #518 and Qualify the official MCP Go SDK authorization-code profile #520–Native MCP OAuth end-to-end acceptance gate and rollout docs #524 cover the existing MCP OAuth lifecycle.
- feat(mcp): DCR client mode for the broker's MCP OAuth surface #1244 added DCR to the ToolHive-backed MCP broker; its current
mecak8s-oriented configuration does not add a direct desktop client path.
Activity
jhrozek commentedon Sep 10, 2026
self-assigned, I ahve a branch that I'm going to PR today