Skip to content

Forward-port Hugging Face auth provider - #4475

Merged
jlowin merged 1 commit into
mainfrom
codex/forward-port-huggingface-auth
Jul 9, 2026
Merged

Forward-port Hugging Face auth provider#4475
jlowin merged 1 commit into
mainfrom
codex/forward-port-huggingface-auth

Conversation

@jlowin

@jlowin jlowin commented Jul 9, 2026

Copy link
Copy Markdown
Member

The 3.4.4 release added first-class Hugging Face OAuth support on the maintenance branch. Main should carry the same provider so SDK-v2 work does not leave the new auth integration behind.

This adds a Hugging Face OAuthProxy provider for public PKCE apps, confidential apps, and CIMD flows. Opaque access tokens are verified through Hugging Face userinfo/whoami endpoints, while scopes from the upstream token response remain the source of truth for FastMCP-issued tokens.

from fastmcp import FastMCP
from fastmcp.server.auth.providers.huggingface import HuggingFaceProvider

auth = HuggingFaceProvider(
    client_id="hf-client-id",
    client_secret="hf-client-secret",
    base_url="https://mcp.example.com",
)

mcp = FastMCP("Hugging Face MCP", auth=auth)

@marvin-context-protocol marvin-context-protocol Bot added feature Major new functionality. Reserved for 2-4 significant PRs per release. Not for issues. auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. labels Jul 9, 2026
@jlowin
jlowin merged commit 9f251ba into main Jul 9, 2026
20 checks passed
@jlowin
jlowin deleted the codex/forward-port-huggingface-auth branch July 9, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. feature Major new functionality. Reserved for 2-4 significant PRs per release. Not for issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant