Skip to content

Support MCP OAuth provisioning for remote clients #740

Closed

Description

@jhrozek

Problem

MCP OAuth login and credential provisioning are currently local operator/browser flows. A remote gRPC or HTTP/SSE client can use MCP tools already configured on the server, but cannot initiate or complete OAuth provisioning through the server API.

This prevents a remote client from onboarding an MCP integration without separate access to the server host or an operator-side setup step.

Desired outcome

Provide a supported remote-client flow for MCP OAuth provisioning, with an explicit authorization and credential-ownership model suitable for a server deployment.

Scope to clarify

  • Which API surface(s) support provisioning: gRPC, HTTP/SSE, or both.
  • Who owns credentials: server operator, authenticated caller, or a scoped tenant identity.
  • How browser redirects/device authorization are presented to a remote client.
  • How credentials are stored, refreshed, revoked, and isolated across callers.
  • Which authorization policy gates credential creation and use.

Current behavior

The existing behavior is appropriate for local setup but leaves remote clients dependent on preconfigured server-side MCP credentials.

Activity

  1. jhrozek commented on Sep 9, 2026

    @jhrozek
    ContributorAuthor

    Implemented, via a different shape than originally sketched: instead of mecatl storing/owning per-upstream MCP OAuth credentials itself, ToolHive owns the entire upstream authorization chain (PKCE, callback correlation, token storage/refresh, provider-specific injection) and mecatl owns only a session-scoped enrollment boundary. See ADR 0311 (docs/adr/0311-per-upstream-mcp-broker-oauth-grants.md) and ADR 0322 (docs/adr/0322-broker-mcp-status.md) for the authorization/ownership model this settles on.

    The remote-client surface is internal/adapter/server/workspace_enrollment.go + mcp_broker.go, wired into both gRPC and HTTP (grpc.go/http.go) — a remote client can begin/observe/cancel MCP OAuth enrollment through the server API (opaque enrollment reference, aggregate status, presentation URL only; no upstream OAuth state, tokens, or provider keys leak to the client) without needing local/operator access to the server host.

    Closing as done. If a specific scope item from this issue (e.g. HTTP/SSE vs gRPC parity, or a particular credential-isolation guarantee) still needs dedicated follow-up, happy to reopen or split into a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions